grafana / grafana/pyroscope-java
Propagating Pyroscope labels to async worker threads in Java
- Langage dominant
- Java
- Étoiles
- 126
- Forks
- 48
- Merge moyen
- 4 j 14 h
- PR mergées (30 j)
- 5
Description
Hello,
I'm using the Pyroscope Java profiling agent to profile a Java application which does a lot of async tasks. I have a method like this:
```java
public CompletableFuture method() {
return Pyroscope.LabelsWrapper.run(new LabelsSet(key, value), () -> doStuff());
}
```
The issue is that `doStuff()` triggers async operations executed on different worker threads. The labels set via LabelsWrapper.run() don't propagate to these worker threads, so the async work isn't profiled with the correct labels.
Is there a recommended way to handle this without adding significant verbosity to the existing code? I'm hoping to avoid manually wrapping every async call.
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Piste de recherche
Commencez par examiner le comportement de LabelsWrapper dans le Java agent et la manière dont les opérations asynchrones déclenchées par doStuff() déplacent le travail vers d’autres threads. Déterminez si la propagation des labels peut être prise en charge sans envelopper manuellement chaque appel asynchrone ; c’est considéré comme terminé lorsque le profiling du thread worker conserve les labels de l’opération d’origine.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- java
- Domaine
- observability-sre
- Type d'issue
- Fonctionnalité
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Activité
- À l'abandon
- Clarté
- À clarifier
- Accessibilité débutants
- 30/100