[dynamic control] add initializing from declarative config#2881
[dynamic control] add initializing from declarative config#2881jackshirazi wants to merge 8 commits into
Conversation
|
@jack-berg I mentioned a while back that the documentation for this type of declarative config addition was minimal, so would love for you to review the implementation here. |
|
I'm struggling to visualize the UX for this. From what I can tell:
If that's about right, then it seems convoluted. Maybe necessarily so based on the hooks available today, but if so, maybe the answer is to go and fix the hooks so this flows more cleanly. In my head, a user should opt into dynamic control with a config file something like: When the I.e.
Caveat: I'm not currently doing any dynamic config tasks. Just trying to help and make sure that we're not trying to solve this problem strictly through the tools we already have. We can change / add tools if needed. |
The README has the details
Some components need specific resource items at initialization. In the current particular case an OpAMP client needs to know both the service name and the environment
There are two different considerations
Please keep these separate. I want this extension functioning then we can evolve it. (Note it is already fully functioning for autoconfiguration, this particular PR enables it to function in the same way for declarative config).
This is exactly how it works with this PR.
These don't currently work. Sampler can't be set there, and even if you added it, it's currently final at initialization. Logging is much worse, you need to install your preferred logging framework at exactly the right point, not too early (or you hit cyclic dependencies) nor too late (it just won't install correctly), and definitely not dynamically currently I agree this is the way it should work. We can open a separate issue on changing the SDK to make it work, but that's really extensive changes even for these two features, and there are many more to consider What I'm hoping for here in review terms is whether the declarative config implementation is the correct way for what needs to be done here, ie
|
👍
Just because we haven't made it mutable yet. I don't think there is any fundamental limitation from making it mutable like the logger / tracer / meter configurators.
I'm not following. Updating the otel log SDK with the set of loggers that should be enabled / disabled is an independent problem from installing / initializing your preferred log framework.
I won't claim there is a correct way at this point, but it does look like you've managed to make it work despite subpar hooks. See recent comments for thoughts. None are blocking. Just things to consider since I'm not an owner of this component. |
I'll open an issue in the SDK with changes suggested
In the Elastic distribution we install log4j as the preferred logging framework. When you do that you also have to initialize it, otherwise weird things happen. If you do that too early, you get a class circularity error (and in fact when too early is changes with different SDK versions because the class circularity is with MethodHandles and is painful). If you leave it too late, log4j doesn't correctly install into the SDK and you get a sort of partial logging. |
jack-berg
left a comment
There was a problem hiding this comment.
Seems reasonable enough. I'm not a code owner and have just scanned this, so take the approval with a grain of salt
Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
|
|
moved change set to #2967 (unless someone knows how to authorize cursor as co-author) |
…pen-telemetry#2881) (open-telemetry#2967) Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Description:
Sorry for the change set being a little larger than normal, but I thought it was better to combine all the declarative config support changes together, rather than adding them piecemeal. I think it may be easier to understand the whole than the parts
This contains
DeclarativeConfigurationCustomizerProviderthat reads top-leveltelemetry_policy/developmentfrom declarative config and routes it intoPolicyInitComponentProviderfortelemetry_policy/developmentto add the delagating sampler - initially for the rate sampling policy, but will later make more generic (includes a TODO for that)Existing Issue(s):
part of #2868
Testing:
Unit tests added, plus a manual end-to-end test using declarative config was performed
Documentation:
TBD see #2868
Outstanding items:
see #2868