Skip to content

[dynamic control] Create providers from SourceKind#2749

Merged
jaydeluca merged 5 commits intoopen-telemetry:mainfrom
jackshirazi:policy21
Apr 9, 2026
Merged

[dynamic control] Create providers from SourceKind#2749
jaydeluca merged 5 commits intoopen-telemetry:mainfrom
jackshirazi:policy21

Conversation

@jackshirazi
Copy link
Copy Markdown
Contributor

Description:

This adds getting PolicyProviders of specific implementations from SourceKind

Existing Issue(s):

#2546

Testing:

Added

Documentation:

To be added

Outstanding items:

Wiring up the policy pipeline:

  • message -> provider -> policy -> policy handler -> implementer
  • eg change sampling rate message -> OpampPolicyprovider -> TraceSamplingRatePolicy -> PolicyStore -> TraceSamplingRatePolicyImplementer

Steps needed for the wiring:

  • providers reading policies, eg OpampPolicyprovider
  • implementers applying policies, eg a TraceSamplingRatePolicyImplementer
  • policy structures (eg TraceSamplingRatePolicy) that the provider converts messages into
  • registering config to policy structures (eg "trace_sampling_rate_policy" registered to TraceSamplingRatePolicy)
  • initializing policy classes (eg TraceSamplingRatePolicy needs to install a custom sampler)
  • activate configured providers (eg start OpampPolicyprovider reading from it's source)
  • register implementers for policies (eg a new TraceSamplingRatePolicy is applied by a TraceSamplingRatePolicyImplementer)
  • link the provider to processing policies and applying implementers

@jackshirazi jackshirazi requested a review from a team as a code owner April 8, 2026 21:12
Copilot AI review requested due to automatic review settings April 8, 2026 21:12
@github-actions github-actions bot requested a review from LikeTheSalad April 8, 2026 21:12
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

Adds initial wiring to instantiate PolicyProvider implementations directly from SourceKind, enabling future policy pipeline setup for dynamic-control.

Changes:

  • Extend SourceKind with a per-kind provider factory and a createProvider(...) method.
  • Add OPAMP provider creation via OpampPolicyProvider when a location key is provided.
  • Add unit tests covering provider creation behavior and null-argument validation.

Reviewed changes

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

File Description
dynamic-control/src/main/java/io/opentelemetry/contrib/dynamic/policy/source/SourceKind.java Introduces provider factory dispatch on enum constants and adds OPAMP provider creation.
dynamic-control/src/test/java/io/opentelemetry/contrib/dynamic/policy/source/SourceKindTest.java Adds tests for createProvider(...) behavior across kinds and argument validation.

jackshirazi and others added 3 commits April 8, 2026 22:17
@jaydeluca jaydeluca added this pull request to the merge queue Apr 9, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Apr 9, 2026
@jaydeluca jaydeluca added this pull request to the merge queue Apr 9, 2026
Merged via the queue into open-telemetry:main with commit 47b401d Apr 9, 2026
21 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