Skip to content

[dynamic control] Add file reader with line-by-line policy provider#2622

Merged
trask merged 6 commits intoopen-telemetry:mainfrom
jackshirazi:policy5
Feb 16, 2026
Merged

[dynamic control] Add file reader with line-by-line policy provider#2622
trask merged 6 commits intoopen-telemetry:mainfrom
jackshirazi:policy5

Conversation

@jackshirazi
Copy link
Contributor

Per #2546

A basic policy provider which reads a file line-by-line (supporting JSON format and ley=value format) and returns policies

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

Copilot AI review requested due to automatic review settings February 10, 2026 12:59
@jackshirazi jackshirazi requested a review from a team as a code owner February 10, 2026 12:59
@jackshirazi jackshirazi changed the title Add file reader with line-by-line policy provider [dynamic control] Add file reader with line-by-line policy provider Feb 10, 2026
Copy link
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 a new PolicyProvider SPI and an initial file-backed implementation that reads one policy per line (JSON or key=value) to produce TelemetryPolicy instances.

Changes:

  • Introduces PolicyProvider interface with polling (fetchPolicies) and optional push (startWatching) update mechanism.
  • Adds LinePerPolicyFileProvider to load policies from a local file with basic parsing and validator dispatch.

Reviewed changes

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

File Description
dynamic-control/src/main/java/io/opentelemetry/contrib/dynamic/policy/PolicyProvider.java Defines the provider contract for fetching and optionally watching policy updates.
dynamic-control/src/main/java/io/opentelemetry/contrib/dynamic/policy/LinePerPolicyFileProvider.java Implements file-based policy loading and validation dispatch for JSON / alias lines.

Copy link
Member

@jaydeluca jaydeluca left a comment

Choose a reason for hiding this comment

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

lgtm.

cc @LikeTheSalad for final review

@trask trask added this pull request to the merge queue Feb 16, 2026
Merged via the queue into open-telemetry:main with commit f72f3f6 Feb 16, 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

Comments