kpater87
kpater87

Reputation: 1270

Connect java-spanner OpenTelemetry spans to micrometer/brave parent

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?

Upvotes: 0

Views: 521

Answers (1)

Gregor Zeitlinger
Gregor Zeitlinger

Reputation: 439

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

Upvotes: 0

Related Questions