-
Notifications
You must be signed in to change notification settings - Fork 812
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should AutoConfigurationCustomizerProvider provide guarantees around the order in which customisations are processed? #4555
Comments
We could add a default method to
If this is a useful concept, we could extend it to other SPIs as needed, perhaps adding a super interface (i.e. I do think in this case honeycomb is perhaps making a stronger statement than they intend. By calling |
You could bring the javaagent's |
this would be nice I think @anuraaga @jkwatson? (comment already got 👍 from @jack-berg) |
Yeah when someone needs ordering is when it's time to implement ordering. The javaagent interface looks good |
I agree, and I think they did too - they've now merged a PR I produced to make their own From my POV as an end user, having to resort to getting a PR into a vendor's distro (and then waiting for a release), obviously doesn't feel like the right solution. The suggestion about An important point on implementation, though: The way Simply controlling the order in which Lines 300 to 303 in 7d80a99
would not have worked, because I install a "SamplerCustomizer", while Honeycomb was using a "TracerProviderCustomizer" to call setTracer() , which currently always executes after all SamplerCustomizers have been run:Lines 324 to 331 in 7d80a99
So I think doing the ordering properly would mean getting the full suite of customisations in each Perhaps the power afforded to a TracerProviderCustomizer - of being able to set anything on a |
Thanks @mateuszrzeszutek ! (And reviewers! 🙂) |
Is your feature request related to a problem? Please describe.
I've encountered this issue with Honeycomb's agent where their
AutoConfigurationCustomizerProvider
callssetSampler()
, which overrides aSampler
which is installed as a decorator by an extension I've written.Because
AutoConfigurationCustomizerProvider
s are loaded and executed non-deterministically, andtracerProviderCustomizer
s are run aftersamplerCustomizer
s, there is no way to force my decorating Sampler to be installed after Honeycomb's override of the sampler.Describe the solution you'd like
Either of the following changes in this project would make it possible to fix this particular problem:
AutoConfigurationCustomizerProvider
s can be prioritised so that the order in which they're run is deterministic.samplerCustomizer
s aftertracerProviderCustomizer
s, instead of before.Describe alternatives you've considered
I've proposed a change to Honeycomb to make their own Sampler a decorator rather than an override.
That would solve my problem, but wouldn't solve the more generic problem that
AutoConfigurationCustomizerProvider
s are ordered non-deterministically (I believe?) and can contain a mix of both decorating and overriding operations.Additional context
More detail about the extension I'm creating is here, but probably isn't necessary to understand the issue: open-telemetry/opentelemetry-java-instrumentation#5008 (comment)
/cc @trask (who suggested raising this issue)
The text was updated successfully, but these errors were encountered: