Skip to content

[dynamic control] Add policy pipeline initializing manager#2826

Merged
jaydeluca merged 4 commits into
open-telemetry:mainfrom
jackshirazi:policy25
May 13, 2026
Merged

[dynamic control] Add policy pipeline initializing manager#2826
jaydeluca merged 4 commits into
open-telemetry:mainfrom
jackshirazi:policy25

Conversation

@jackshirazi

Copy link
Copy Markdown
Contributor

Description:

This adds PolicyInit which coordinates registration and initialization of policies when the policy pipeline is created

Existing Issue(s):

#2546

Testing:

The natural testing here is coordinated with at least one basic policy, but the policy registration hasn't yet been implemented in this PR (to keep it simpler), so testing will be added with the next PR with a policy registration added

Documentation:

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)
  • 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)
    • TBD
  • register implementers for policies (eg a new TraceSamplingRatePolicy is applied by a TraceSamplingRatePolicyImplementer)
    • TBD
  • link the provider to processing policies and applying implementers
    • DONE abstractly in this PR (PolicyInit)

Copilot AI review requested due to automatic review settings May 11, 2026 13:58
@jackshirazi
jackshirazi requested a review from a team as a code owner May 11, 2026 13:58
@github-actions
github-actions Bot requested a review from LikeTheSalad May 11, 2026 13: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

Adds a new “policy pipeline initialization manager” for the dynamic-control module to coordinate policy-type resolution, initialization, and source activation when telemetry policy wiring is configured.

Changes:

  • Added PolicyInit registry/bootstrap responsible for resolving configured policyType mappings, initializing policy types, and activating configured policy sources.
  • Extended PolicyInitConfig with an additional declarative-config parsing entrypoint for callers that already have the telemetry_policy subtree.
  • Exposed OpampPolicyProvider.resetForTest() publicly to support cross-package test reset usage.

Reviewed changes

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

File Description
dynamic-control/src/main/java/io/opentelemetry/contrib/dynamic/policy/registry/PolicyInitConfig.java Adds a helper to read config when already positioned at the telemetry_policy declarative block.
dynamic-control/src/main/java/io/opentelemetry/contrib/dynamic/policy/registry/PolicyInit.java Introduces central initialization/activation logic for the policy pipeline (type resolution, initializers, provider activation, merging).
dynamic-control/src/main/java/io/opentelemetry/contrib/dynamic/policy/OpampPolicyProvider.java Changes resetForTest() visibility to public.

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

4 participants