Search code examples
spring-bootjaegeropen-telemetry

Spring boot and opentelemetry: UNIMPLEMENTED: unknown service opentelemetry.proto.collector.metrics.v1.MetricsService


I am trying to integrate opentelemetry in in my spring boot application with jaeger. I am running jaeger on my local machine (started with binary not with docker) and I am starting my spring boot application with following command:

java -javaagent:/Users/<user-name>/temp/opentelemetry-javaagent-all.jar -Dotel.traces.exporter=jaeger -Dotel.exporter.jaeger.endpoint=localhost:14250 -Dotel.resource.attributes=service.name=playground-app -Dotel.javaagent.debug=false -Dotel.metrics.exporter=jaeger -Dotel.exporter.otlp.endpoint=localhost:14250 -Dotel.exporter.otlp.traces.endpoint=localhost:14250 -Dotel.exporter.otlp.metrics.endpoint=localhost:14250 -jar playground-app-0.0.1-SNAPSHOT.jar

when I hit a endpoint I am getting following error on command line:

[opentelemetry.auto.trace 2021-11-15 17:11:29:043 +0530] [grpc-default-executor-0] WARN io.opentelemetry.exporter.otlp.trace.OtlpGrpcSpanExporter - Failed to export spans. Error message: UNIMPLEMENTED: unknown service opentelemetry.proto.collector.trace.v1.TraceService

followed by

[opentelemetry.auto.trace 2021-11-15 17:12:08:513 +0530] [grpc-default-executor-0] WARN io.opentelemetry.exporter.otlp.metrics.OtlpGrpcMetricExporter - Failed to export metrics io.grpc.StatusRuntimeException: UNIMPLEMENTED: unknown service opentelemetry.proto.collector.metrics.v1.MetricsService at io.grpc.Status.asRuntimeException(Status.java:533) at io.grpc.stub.ClientCalls$UnaryStreamToFuture.onClose(ClientCalls.java:533) at io.grpc.internal.DelayedClientCall$DelayedListener$3.run(DelayedClientCall.java:464) at io.grpc.internal.DelayedClientCall$DelayedListener.delayOrExecute(DelayedClientCall.java:428) at io.grpc.internal.DelayedClientCall$DelayedListener.onClose(DelayedClientCall.java:461) at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:617) at io.grpc.internal.ClientCallImpl.access$300(ClientCallImpl.java:70) at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInternal(ClientCallImpl.java:803) at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:782) at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37) at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829)

Here is the dependencies section from build.gradle

implementation platform("io.opentelemetry:opentelemetry-bom:1.9.0")
implementation platform('io.opentelemetry:opentelemetry-bom-alpha:1.9.0-alpha')

implementation('io.opentelemetry:opentelemetry-api')
implementation('io.opentelemetry:opentelemetry-api-metrics')
implementation group: 'io.opentelemetry', name: 'opentelemetry-proto', version: '1.7.1-alpha'

I could not find anything on web with respect to this problem. Any idea what i am doing wrong. I didn't make ay other changes in my application for this integration.


Solution

  • My guess:

    -Dotel.metrics.exporter=jaeger is a problem. What I have seen only prometheus metrics exporter is implemented for now (if you are using https://github.com/open-telemetry/opentelemetry-java-instrumentation). There is no jaeger metric exporter.

    Also I don't understand why you need OTLP endpoint (OTLP != Jaeger). I would remove them:

    -Dotel.exporter.otlp.endpoint=localhost:14250 
    -Dotel.exporter.otlp.traces.endpoint=localhost:14250 
    -Dotel.exporter.otlp.metrics.endpoint=localhost:14250
    

    Simple config:

    -Dotel.traces.exporter=jaeger 
    -Dotel.exporter.jaeger.endpoint=http://localhost:14250  
    -Dotel.resource.attributes=service.name=playground-app 
    

    should be fine as a starting point.