grafana / grafana/pyroscope-java

Propagating Pyroscope labels to async worker threads in Java

Open
#237 2 comments 0 reactions 0 assignees View on GitHub
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.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.