0

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

Jan Garaj
  • 25,598
  • 3
  • 38
  • 59
harshit2811
  • 827
  • 1
  • 7
  • 21
  • `jaegertracing/opentelemetry-all-in-one` is discontinued image. I would recommend to use `jaegertracing/all-in-one` (I'm not saying that will solve the problem!) – Jan Garaj May 09 '22 at 20:23

1 Answers1

0

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).

Jan Garaj
  • 25,598
  • 3
  • 38
  • 59
  • I have changed to jaegertracing/all-in-one. I don't see OTLP protocol (grpc) on the document. Which port/protocol I should use? – harshit2811 May 17 '22 at 13:10
  • On that page there are only UDP protocol at agent component side. It doesn't have gRPC mentioned. – harshit2811 May 17 '22 at 14:40