-
Notifications
You must be signed in to change notification settings - Fork 40.8k
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
Adding custom ObservationHandler does not preserve the default ObservationHandlers #34510
Comments
See also #34399. |
yep, because of the mentioned issue, in the example I added |
I think that the default observation handlers should not have conditional on missing bean |
That doesn't feel very Boot-like to me. It would leave users who want to have the auto-configured handlers back off and replaced with their own with a problem. They'd have to exclude |
If you don't want the default tracing handler you register your own tracing handler before the default one because only one can be used. Same for metrics. We are grouping all handlers for exactly this reason - that you can put your own handlers before the existing ones. Another option for @violetagg would be never to extend from the ones that we provide but delegate to them (that way the types would not be the same and |
Yes we do exactly that our tracing handlers are implemented in a way that The scenario here is that we do want the default Spring Boot tracing for the server. What we want to enable is the tracing for Reactor Netty HttpClient only.
|
Yeah so all of your custom handlers wouldn't extend from the default ones, they would delegate to them. So you would never hit the |
So we have to delegate to the default in both cases when in Spring Boot application and when in standalone Reactor Netty. |
So if you have 3 custom types that extend
|
@marcingrzejszczak and I tried the variant with delegation. (reactor/reactor-netty@e02e722) On the other hand if default Basically the variant with delegation is a workaround to have the default |
Spring Boot version
3.0.4
Reproducible example
https://github.com/violetagg/netty-observation-repro
Problem description
I would like to use Reactor Netty tracing capabilities in Spring Boot application.
For this purpose I need to reuse the
ObservationRegistry
created by Spring Boot and to addObservationHandler
s provided by Reactor Netty.Observations:
ObservationRegistry
without adding theObservationHandler
s provided by Reactor Netty - the tracing information is correctly visualised but the span tags are duplicated and one and the same Timer object is created every time.If I reuse the
ObservationRegistry
and addObservationHandler
s provided by Reactor Netty - the tracing information is NOT correctly visualised.If I reuse the
ObservationRegistry
, addObservationHandler
s provided by Reactor Netty and in addition add all defaultObservationHandler
s provided by Spring Boot - the tracing information is correctly visualised, the span tags are not duplicated and one and the same Timer object is created only once. Reactor Netty tracing capabilities are working as expected.Desired solution
Spring Boot should preserve the default
ObservationHandler
s when customObservationHandler
s are added to the configuration.The text was updated successfully, but these errors were encountered: