Skip to content

fix: allow OTLP allocation and lock thresholds - #351

Merged
korniltsev-grafanista merged 1 commit into
grafana:mainfrom
arnabnandy7:fix/otlp-event-thresholds
Aug 18, 2026
Merged

fix: allow OTLP allocation and lock thresholds#351
korniltsev-grafanista merged 1 commit into
grafana:mainfrom
arnabnandy7:fix/otlp-event-thresholds

Conversation

@arnabnandy7

Copy link
Copy Markdown
Contributor

Description

Allows OTLP export to use allocation and lock profiling thresholds when the threshold configures the selected primary event.

Valid configurations now include:

PYROSCOPE_FORMAT=otlp
PYROSCOPE_PROFILER_EVENT=alloc
PYROSCOPE_PROFILER_ALLOC=512k

and:

PYROSCOPE_FORMAT=otlp
PYROSCOPE_PROFILER_EVENT=lock
PYROSCOPE_PROFILER_LOCK=10ms

Previously, any use of PYROSCOPE_PROFILER_ALLOC or PYROSCOPE_PROFILER_LOCK with OTLP was rejected, even though async-profiler treats these values as thresholds for the selected event.

The validation still rejects distinct events running simultaneously. Multiple events remain supported in sampling mode, where they run sequentially.

Changes

  • Allow allocation thresholds when alloc is the primary event.
  • Allow lock thresholds when lock is the primary event.
  • Preserve validation against simultaneous OTLP profiling events.
  • Add coverage for allocation, lock, invalid simultaneous events, and sequential sampling.
  • Document the supported OTLP configurations.

Testing

./gradlew :agent:test --tests io.pyroscope.javaagent.config.OtlpConfigTest

Fixes #347

Signed-off-by: Arnab Nandy <arnab_nandy7@yahoo.com>
@arnabnandy7
arnabnandy7 requested review from a team as code owners August 16, 2026 12:30
@arnabnandy7

Copy link
Copy Markdown
Contributor Author

@korniltsev-grafanista to review

Comment thread README.md
The agent sends protobuf requests to `<server-address>/v1development/profiles`.

OTLP export requires the default `ASYNC` profiler and is not supported by the JFR profiler used on Windows.
Only one profiling event can run at a time. Allocation and lock thresholds can be configured when their event is

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.

do not update readme. The information here is quickly outdated. The documentation lives in grafana/pyroscope repo.

@korniltsev-grafanista
korniltsev-grafanista merged commit ca26a77 into grafana:main Aug 18, 2026
45 of 91 checks passed
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.

Allow single-event allocation and lock profiling with OTLP

2 participants