open-telemetry / open-telemetry/opentelemetry-java-contrib

Export profiles using async-profiler via OTLP

Open
#2,804 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Java
Stars
269
Forks
196
Avg merge
2d 7h
Merged PRs (30d)
38

Description

Component(s)

No response

Is your feature request related to a problem? Please describe.

I'd like to profile Java applications while linking traces and profiles.

Describe the solution you'd like

I'd like to add a profiling component which uses async-profiler that emits profiles from the SDK via OTLP when profiling is enabled (eg. by setting OTEL_PROFILES_EXPORTER=otlp).

Describe alternatives you've considered

I considered using Grafana's Pyroscope integration with the Java Otel SDK https://github.com/grafana/otel-profiling-java. It uses async-profiler to export profiles and a SpanProcessor extension to link spans and profiles. However Pyroscope does not export profiles via OTLP.

I also considered using inferred-spans component which also uses async-profiler v4.
However inferred-spans exports traces and not profiles.

Additional context

Async-profiler v4 supports exporting profiles in OTLP format: https://github.com/async-profiler/async-profiler/blob/master/docs/OutputFormats.md

Tip

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.

Contributor guide

Open the contributing guide

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.

Research direction

Start by reading the async-profiler v4 OutputFormats documentation and inspect the inferred-spans component for existing async-profiler usage. Compare that with the linked Pyroscope SpanProcessor to understand how profiles and spans are linked, then trace the SDK's OTEL_PROFILES_EXPORTER handling. Done means an async-profiler-based profiling component emits profiles through OTLP when profiling is enabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
observability
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.