Skip to content

[dynamic-control] Add trace sampling-rate implementer#2634

Merged
jaydeluca merged 10 commits intoopen-telemetry:mainfrom
jackshirazi:policy6
Feb 24, 2026
Merged

[dynamic-control] Add trace sampling-rate implementer#2634
jaydeluca merged 10 commits intoopen-telemetry:mainfrom
jackshirazi:policy6

Conversation

@jackshirazi
Copy link
Copy Markdown
Contributor

Per #2546

A basic trace sampling-rate implementer which simplistically applies changes to the sample rate

A full working implementation of the open-telemetry/opentelemetry-specification#4738 is here in this branch

Note the final dynamic-control sampling management needs to be more sophisticated, to dynamically handle route exclusion/inclusions as well as sampling rate and needs to use the recently added composable samplers (by default), but that's all for later addition

Copilot AI review requested due to automatic review settings February 16, 2026 21:06
@jackshirazi jackshirazi requested a review from a team as a code owner February 16, 2026 21:06
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a trace sampling-rate policy implementer for the dynamic-control module, enabling runtime changes to trace sampling rates through the Telemetry Policy framework. This is part of a larger effort to implement experimental Telemetry Policy support (issue #2546) based on the draft OpenTelemetry specification.

Changes:

  • Introduces the PolicyImplementer interface for applying validated telemetry policies to runtime components
  • Implements TraceSamplingRatePolicyImplementer to dynamically update trace sampling rates via a DelegatingSampler
  • Adds comprehensive unit tests for the implementer covering various scenarios including null specs, probability application, policy filtering, and conflict resolution

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.

File Description
PolicyImplementer.java New interface defining the contract for policy implementers with clear documentation of responsibilities and lifecycle
TraceSamplingRatePolicyImplementer.java Implementation that translates trace-sampling policies into sampler configuration changes using the OpenTelemetry SDK
TraceSamplingRatePolicyImplementerTest.java Comprehensive unit tests covering core functionality including edge cases and policy precedence rules

jackshirazi and others added 5 commits February 17, 2026 09:39
…/policy/TraceSamplingRatePolicyImplementer.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…/policy/TraceSamplingRatePolicyImplementerTest.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@jaydeluca jaydeluca added this pull request to the merge queue Feb 24, 2026
Merged via the queue into open-telemetry:main with commit 5388395 Feb 24, 2026
20 of 21 checks passed
@jackshirazi jackshirazi deleted the policy6 branch April 1, 2026 13:17
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.

4 participants