Skip to content

Adding custom ObservationHandler does not preserve the default ObservationHandlers #34510

Open
@violetagg

Description

@violetagg

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 add ObservationHandlers provided by Reactor Netty.

Observations:

  1. If I only reuse the ObservationRegistry without adding the ObservationHandlers 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.

Screenshot 2023-03-08 at 9 42 13 Screenshot 2023-03-08 at 9 42 25

  1. If I reuse the ObservationRegistry and add ObservationHandlers provided by Reactor Netty - the tracing information is NOT correctly visualised.

  2. If I reuse the ObservationRegistry, add ObservationHandlers provided by Reactor Netty and in addition add all default ObservationHandlers 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.

Screenshot 2023-03-08 at 9 51 18 Screenshot 2023-03-08 at 9 51 29

Desired solution

Spring Boot should preserve the default ObservationHandlers when custom ObservationHandlers are added to the configuration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: blockedAn issue that's blocked on an external project changetheme: observabilityIssues related to observabilitytype: enhancementA general enhancement

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions