1

My structure log is Logstash, and I see my trace ID in every microservice log. However, my trace ID is not the same in all requests between microservices. How can I ensure that trace context (traceparent/baggage) is automatically propagated when using OpenFeign in Spring Boot 3.4 with Micrometer and OpenTelemetry?

All microservices have these dependencies:

      <dependency>
        <groupId>io.micrometer</groupId>
        <artifactId>micrometer-tracing-bridge-otel</artifactId>
    </dependency>
    <dependency>     
        <groupId>io.opentelemetry</groupId>
        <artifactId>opentelemetry-exporter-otlp</artifactId>
    </dependency>
   <dependency>
      <groupId>org.springframework.cloud</groupId>
      <artifactId>spring-cloud-starter-openfeign</artifactId>
    </dependency>

my spring property config:

management:
  tracing:
    sampling:
      probability: 1.0 # report 100% of traces
1
  • Consider adding more relevant code to allow people to spot potential errors in the setup Commented May 14 at 8:43

1 Answer 1

0
management:
  tracing:
    enabled: true
    propagation:
      type: W3C

in your configuration tells Spring Boot with Micrometer and OpenTelemetry to automatically propagate the tracing context across services, including Feign client calls.

Sign up to request clarification or add additional context in comments.

1 Comment

The default propagation type of OpenTelemetry is W3C; I think it doesn't need to be set.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.