Skip to content

feat: add trace_id pprof label#89

Merged
marcsanmi merged 3 commits into
mainfrom
feat/trace-id-label
Jun 23, 2026
Merged

feat: add trace_id pprof label#89
marcsanmi merged 3 commits into
mainfrom
feat/trace-id-label

Conversation

@marcsanmi

@marcsanmi marcsanmi commented May 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Attaches a trace_id pprof label (32-char W3C hex) to profile samples, enabling traces↔profiles correlation by trace ID server-side. Emitted unconditionally, matching the Go/Python SDKs; span_id and pyroscope.profile.id behavior is unchanged.

Uses the ProfilerApi.setTraceId(String) / clearTraceId() methods added in grafana/pyroscope-java#313 (the otel-extension path). The library processor calls the native AsyncProfiler.setTraceId(hi, lo) directly, with an allocation-free hex parser.

Requires pyroscope-java >= 2.6.0 (now on Maven Central).

@cla-assistant

cla-assistant Bot commented May 21, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@cla-assistant

cla-assistant Bot commented May 21, 2026

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

1 similar comment
@cla-assistant

cla-assistant Bot commented May 21, 2026

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@marcsanmi marcsanmi force-pushed the feat/trace-id-label branch from 568e680 to 86d019e Compare May 21, 2026 11:38
@marcsanmi marcsanmi changed the title feat: add trace_id pprof label for trace-to-profile correlation feat: add trace_id pprof label May 21, 2026
@marcsanmi marcsanmi requested a review from simonswine May 21, 2026 11:49
simonswine
simonswine previously approved these changes May 29, 2026

@simonswine simonswine left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs rebase to pass the tests, but in general looks good to me

@marcsanmi marcsanmi force-pushed the feat/trace-id-label branch from ee61f37 to b2327dc Compare June 19, 2026 07:55
@marcsanmi marcsanmi marked this pull request as ready for review June 19, 2026 07:55
@marcsanmi marcsanmi requested review from a team as code owners June 19, 2026 07:55
@marcsanmi marcsanmi requested a review from simonswine June 19, 2026 07:56
@korniltsev-grafanista

Copy link
Copy Markdown
Contributor

wait, why does querying by trace_id series label work on your screenshot? I thought we removed trace_id label same way as span_id

Comment thread lib/src/main/java/io/otel/pyroscope/PyroscopeOtelSpanProcessor.java Outdated
Comment thread otel-extension/src/main/java/io/otel/pyroscope/PyroscopeOtelSpanProcessor.java Outdated
@marcsanmi

Copy link
Copy Markdown
Contributor Author

why does querying by trace_id series label work on your screenshot?

Yes, this was the first test I did on all the SDKs before the fix I did on Pyroscope.

@marcsanmi marcsanmi merged commit 03b0c33 into main Jun 23, 2026
70 of 76 checks passed
@marcsanmi marcsanmi deleted the feat/trace-id-label branch June 23, 2026 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants