0

I have a spring-boot application and java spanner client. Spring boot is using micrometer and brave as a tracing instrumentation, while java spanner client is using OpenTelemetry.

By

I am able to send spanner tracing spans to Stackdriver, but they are not connected to the parent. It is because the OpenTelementry tracing context is not populated by Spring by default.

I have to keep the brave instrumentation as the main one, but would also like to connect OpenTelementry spans to the parent span.

One way to achieve it could be to manually start OpenTelementry span and copy data from brave context (like traceId/spanId/sampled). But then I will have parents set to spanner spans only in places where I will put my custom span.

Is there another way to propagate tracing context between to different tracing instrumentation (OpenTelemetry and Brave)? Maybe it would be possible to override some spring bean and manually copy data between two tracing context?

1 Answer 1

0

If you use the otel brige from micrometer, the context propagation should work. See https://spring.io/blog/2022/10/12/observability-with-spring-boot-3#resttemplate-client-application-setup

2
  • The point is my spring-boot applications is already using io.micrometer:micrometer-tracing-bridge-brave and I cannot replace it by otel bridge. It is also impossible to use both: Parameter 1 of method propagatingSenderTracingObservationHandler in org.springframework.boot.actuate.autoconfigure.tracing.MicrometerTracingAutoConfiguration required a single bean, but 2 were found -bravepropagator -otelPropagator
    – kpater87
    Commented Apr 16 at 7:38
  • Then there's no solution to your issue I'm aware of. Commented Apr 17 at 10:30

Not the answer you're looking for? Browse other questions tagged or ask your own question.