[dynamic control] Register implementers#2858
Open
jackshirazi wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Wires dynamic-control policy implementers into the policy pipeline so implementers are registered with PolicyStore and receive relevant policy snapshots/updates.
Changes:
- Register initialized
PolicyImplementerinstances withPolicyStoreduringPolicyInitinitialization and clear the store on shutdown. - Extend
PolicyStoreto support implementer registration and to notify implementers when policies change (filtered by supported policy types). - Add unit tests verifying implementers receive current and updated relevant policies.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| dynamic-control/src/test/java/io/opentelemetry/contrib/dynamic/policy/PolicyStoreTest.java | Adds tests for implementer registration and update notifications. |
| dynamic-control/src/main/java/io/opentelemetry/contrib/dynamic/policy/registry/PolicyInit.java | Registers implementers with the store and clears store state during shutdown. |
| dynamic-control/src/main/java/io/opentelemetry/contrib/dynamic/policy/PolicyStore.java | Adds implementer registration, notification logic, and store clearing. |
Comment on lines
226
to
230
| try { | ||
| PolicyImplementer implementer = policyTypeInitializer.initialize(autoConfiguration); | ||
| initializedImplementers.put(policyClass, implementer); | ||
| // TODO: register implementer with policyStore, not yet implemented | ||
| // policyStore.registerImplementer(implementer); | ||
| policyStore.registerImplementer(implementer); | ||
| logger.log(Level.INFO, "Initialized policy class ''{0}''", policyClass.getName()); |
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.
Description:
Wire up implementers so they get applied by policies.
Existing Issue(s):
#2546
Testing:
Added
Documentation:
Previously included
Outstanding items:
Wiring up the policy pipeline:
Steps needed for the wiring: