Skip to content

[dynamic control] Register implementers#2858

Merged
jaydeluca merged 3 commits into
open-telemetry:mainfrom
jackshirazi:policy27
May 27, 2026
Merged

[dynamic control] Register implementers#2858
jaydeluca merged 3 commits into
open-telemetry:mainfrom
jackshirazi:policy27

Conversation

@jackshirazi

@jackshirazi jackshirazi commented May 22, 2026

Copy link
Copy Markdown
Contributor

Description:

Wire up implementers so they get applied by policies.

closes #2546

Existing Issue(s):

#2546

Testing:

Added

Documentation:

Previously included

Outstanding items:

Wiring up the policy pipeline:

  • Generic: message -> provider -> policy -> policy handler -> implementer
  • eg "change sampling rate" message -> OpampPolicyProvider -> TraceSamplingRatePolicy -> PolicyStore -> TraceSamplingRatePolicyImplementer

Steps needed for the wiring:

  • configuring the pipeline
    • DONE: PolicyInitConfig
  • providers reading policies, eg OpampPolicyProvider, FilePolicyProvider, etc
    • DONE: OpampPolicyProvider
  • implementers applying policies, eg TraceSamplingRatePolicyImplementer
    • DONE: TraceSamplingRatePolicyImplementer
  • policy structures (eg TraceSamplingRatePolicy) that the provider converts messages into
    • DONE: TraceSamplingRatePolicy
  • registering config to policy structures (eg "trace_sampling_rate_policy" registered to TraceSamplingRatePolicy)
    • DONE: PolicyInit static initialiizer
  • initializing policy classes (eg TraceSamplingRatePolicy needs to install a custom sampler)
    • DONE: TraceSamplingRatePolicy initialization
  • activate configured providers (eg start OpampPolicyprovider reading from it's source)
    • DONE
  • register implementers for policies (eg a new TraceSamplingRatePolicy is applied by a TraceSamplingRatePolicyImplementer)
    • This PR
  • link the provider to processing policies and applying implementers
    • DONE PolicyInit

@jackshirazi
jackshirazi requested a review from a team as a code owner May 22, 2026 17:59
Copilot AI review requested due to automatic review settings May 22, 2026 17:59
@github-actions
github-actions Bot requested a review from LikeTheSalad May 22, 2026 17:59

Copilot AI 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.

Pull request overview

Wires dynamic-control policy implementers into the policy pipeline so implementers are registered with PolicyStore and receive relevant policy snapshots/updates.

Changes:

  • Register initialized PolicyImplementer instances with PolicyStore during PolicyInit initialization and clear the store on shutdown.
  • Extend PolicyStore to support implementer registration and to notify implementers when policies change (filtered by supported policy types).
  • Add unit tests verifying implementers receive current and updated relevant policies.

Reviewed changes

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

File Description
dynamic-control/src/test/java/io/opentelemetry/contrib/dynamic/policy/PolicyStoreTest.java Adds tests for implementer registration and update notifications.
dynamic-control/src/main/java/io/opentelemetry/contrib/dynamic/policy/registry/PolicyInit.java Registers implementers with the store and clears store state during shutdown.
dynamic-control/src/main/java/io/opentelemetry/contrib/dynamic/policy/PolicyStore.java Adds implementer registration, notification logic, and store clearing.

Copilot AI 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.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

@jaydeluca
jaydeluca added this pull request to the merge queue May 27, 2026
Merged via the queue into open-telemetry:main with commit dae7ef5 May 27, 2026
22 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.

[Dynamic] Add basic Telemetry Policy support to dynamic-control

4 participants