Search code examples
javaspringjaegeropen-telemetry

Opentelemetry Java auto-instrumentation data to Jaeger


I'm new to the world of Opentelemetry and would like to send the Spring-petclinic instrumentation data to Jaeger which is running on my remote cloud system

Here is the bat file: java -javaagent:opentelemetry-javaagent-all.jar -Dotel.exporter=jaeger -Dotel.exporter.jaeger.endpoint=50.18.XXX.XX:14250 -Dotel.otlp.span.timeout=4000 -Dotel.jaeger.service.name=otel-ui -jar target/spring-petclinic-2.4.0.BUILD-SNAPSHOT.jar

When I run the bat file, I'm abe to open the petclinic app in browser (http://localhost:8080), I get the following error in the console: [opentelemetry.auto.trace 2021-01-06 17:22:21:008 +0530] [grpc-default-executor-1] WARN io.opentelemetry.exporter.otlp.OtlpGrpcSpanExporter - Failed to export spans. Error message: UNAVAILABLE: io exception

How to resolve this issue? Are there any other dependencies to be the added to the petclinic pom.xml or to the code?


Solution

  • gRPC port isn't enabled in your jaeger instance.

    You can try a docker-compose file like this

    version: "3.6"
    services:
      jaeger:
        image: jaegertracing/all-in-one
        ports:
          - 5775:5775/udp
          - 6831:6831/udp
          - 6832:6832/udp
          - 5778:5778
          - 16686:16686
          - 14268:14268
          - 14250:14250
          - 9411:9411
    

    And you can connect to it without problems