[dynamic control] Add file reader with line-by-line policy provider#2622
Merged
trask merged 6 commits intoopen-telemetry:mainfrom Feb 16, 2026
Merged
[dynamic control] Add file reader with line-by-line policy provider#2622trask merged 6 commits intoopen-telemetry:mainfrom
trask merged 6 commits intoopen-telemetry:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
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
PolicyProviderinterface with polling (fetchPolicies) and optional push (startWatching) update mechanism. - Adds
LinePerPolicyFileProviderto 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. |
...control/src/main/java/io/opentelemetry/contrib/dynamic/policy/LinePerPolicyFileProvider.java
Outdated
Show resolved
Hide resolved
...control/src/main/java/io/opentelemetry/contrib/dynamic/policy/LinePerPolicyFileProvider.java
Outdated
Show resolved
Hide resolved
...control/src/main/java/io/opentelemetry/contrib/dynamic/policy/LinePerPolicyFileProvider.java
Outdated
Show resolved
Hide resolved
dynamic-control/src/main/java/io/opentelemetry/contrib/dynamic/policy/PolicyProvider.java
Show resolved
Hide resolved
dynamic-control/src/main/java/io/opentelemetry/contrib/dynamic/policy/PolicyProvider.java
Outdated
Show resolved
Hide resolved
...control/src/main/java/io/opentelemetry/contrib/dynamic/policy/LinePerPolicyFileProvider.java
Outdated
Show resolved
Hide resolved
jaydeluca
reviewed
Feb 12, 2026
...control/src/main/java/io/opentelemetry/contrib/dynamic/policy/LinePerPolicyFileProvider.java
Show resolved
Hide resolved
...control/src/main/java/io/opentelemetry/contrib/dynamic/policy/LinePerPolicyFileProvider.java
Outdated
Show resolved
Hide resolved
...control/src/main/java/io/opentelemetry/contrib/dynamic/policy/LinePerPolicyFileProvider.java
Show resolved
Hide resolved
...control/src/main/java/io/opentelemetry/contrib/dynamic/policy/LinePerPolicyFileProvider.java
Show resolved
Hide resolved
…/policy/LinePerPolicyFileProvider.java Co-authored-by: Jay DeLuca <jaydeluca4@gmail.com>
jaydeluca
approved these changes
Feb 12, 2026
Member
jaydeluca
left a comment
There was a problem hiding this comment.
lgtm.
cc @LikeTheSalad for final review
LikeTheSalad
approved these changes
Feb 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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