harshit2811
harshit2811

Reputation: 867

spring cloud sleuth otel - tracing data not visible to jaeger dashboard

I have followed multiple blogs to set-up working demo of Spring cloud Sleuth with OTEL. App ran successfully, trace and spanId are getting generated but service is not getting registered with local jaeger (dockerized) and hence not able to see any trace data.

Kindly review the configuration and help me.

Under

Dependency management
spring-boot-starter-parent=2.6.6
spring-cloud-dependencies:2021.0.1
spring-cloud-sleuth-otel-dependencies:1.1.0-M4

dependencies


 <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-sleuth</artifactId>
            <exclusions>
                <!-- Exclude Brave (the default) -->
                <exclusion>
                    <groupId>org.springframework.cloud</groupId>
                    <artifactId>spring-cloud-sleuth-brave</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
  <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-sleuth-otel-autoconfigure</artifactId>
        </dependency>
<dependency>
            <groupId>io.opentelemetry</groupId>
            <artifactId>opentelemetry-exporter-otlp-trace</artifactId>
        </dependency>
        <dependency>
            <groupId>io.grpc</groupId>
            <artifactId>grpc-okhttp</artifactId>
            <version>1.42.1</version>
        </dependency>

App config(yml)

spring:
  application:
    name: api-service
  sleuth:
    otel:
      exporter:
        otlp:
          endpoint: http://collector:6831

Docker compose

version: "3.5"

services:

  api-service:
    build: api-service/
    image: api-service:latest
    ports:
      - "8080:8080"
  collector:
    image: jaegertracing/opentelemetry-all-in-one
    ports:
      - 5775:5775/udp
      - 6831:6831/udp
      - 6832:6832/udp
      - 5778:5778
      - 16686:16686
      - 14268:14268
      - 14250:14250
      - 9411:9411

I made few API calls to api-service but not able to see any trace data and service name on jaeger dashboard (http://localhost:16686).

enter image description here

Upvotes: 0

Views: 1058

Answers (1)

Jan Garaj
Jan Garaj

Reputation: 28716

https://www.jaegertracing.io/docs/1.33/getting-started/#all-in-one

6831 port accepts jaeger.thrift over compact thrift protocol, but your exporter is sending OTLP GRPC protocol => you are mixing protocols.

I believe 55680 port was used for OTLP protocol, but jaegertracing/opentelemetry-all-in-one is discontinued image, so it is hard to find doc for that.

I would use jaegertracing/all-in-one image and jaeger exporter (not otlp).

Upvotes: 0

Related Questions