grafana / grafana/pyroscope-java

Propagating Pyroscope labels to async worker threads in Java

Aperta
#237 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Java
Stelle
126
Fork
48
Merge medio
4g 14h
PR unite (30g)
5

Descrizione

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.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.