Skip to content

[dynamic control] Add pipeline config initialization from file#2753

Open
jackshirazi wants to merge 2 commits intoopen-telemetry:mainfrom
jackshirazi:policy23
Open

[dynamic control] Add pipeline config initialization from file#2753
jackshirazi wants to merge 2 commits intoopen-telemetry:mainfrom
jackshirazi:policy23

Conversation

@jackshirazi
Copy link
Copy Markdown
Contributor

Description:

Adding a method to read a pipeline initialization file in yaml (preferred) or json format.

Existing Issue(s):

#2546

Testing:

Added

Documentation:

Added

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 in this PR
  • 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)
  • 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 9, 2026 12:00
Copilot AI review requested due to automatic review settings April 9, 2026 12:00
@github-actions github-actions bot requested a review from LikeTheSalad April 9, 2026 12:00
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 support in the dynamic-control module to initialize the policy pipeline configuration from an external YAML (preferred) or JSON file, selected via OpenTelemetry ConfigProperties.

Changes:

  • Added PolicyInitConfig.readFromConfigProperties(ConfigProperties) to load init configuration from a YAML/JSON file path configured via properties.
  • Added unit tests covering YAML-vs-JSON precedence, fallback when YAML property is blank, and failure scenarios (missing/unparseable files).

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/registry/PolicyInitConfig.java Adds config-property driven file loading (YAML preferred, JSON supported) with logging on failure.
dynamic-control/src/test/java/io/opentelemetry/contrib/dynamic/policy/registry/PolicyInitConfigTest.java Adds coverage for selection logic and error handling behavior.

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.

3 participants