grafana / grafana/pyroscope-java
Propagating Pyroscope labels to async worker threads in Java
- Dominant language
- Java
- Stars
- 126
- Forks
- 48
- Avg merge
- 4d 14h
- Merged PRs (30d)
- 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.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.