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:
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.
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:
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.