Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Propagating Pyroscope labels to async worker threads in Java

Open
#237 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
30/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
java

Research direction

Start by reviewing the Java agent's LabelsWrapper behavior and how the async operations triggered by doStuff() move work to other threads. Determine whether label propagation can be supported without manually wrapping each async call; done means worker-thread profiling retains the labels from the originating operation.

Written by the indexing model from the issue text.

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:

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.

Dominant language
Java
Stars
125
Forks
48
Avg merge
1h 8m
Merged PRs (30d)
1

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from grafana/pyroscope-java

All issues in grafana/pyroscope-java

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.