'Jaeger not receiving any OpenTelemetry trace
So I'm trying send OpenTelemetry trace back to Jaeger. I've tried sending the traces to console and it works. But I'm not getting anything when sending it to Jaeger.
builder.Services.AddOpenTelemetryTracing(b =>
{
b.SetResourceBuilder(ResourceBuilder.CreateDefault().AddService("ServiceA"))
.AddSource("TelemetryDemo")
.AddHttpClientInstrumentation()
.AddAspNetCoreInstrumentation()
.AddOtlpExporter(o =>
{
o.Endpoint = new Uri("http://localhost:4317");
o.ExportProcessorType = ExportProcessorType.Simple;
})
.AddConsoleExporter();
});
I'm running Jaeger's All-in-One from Docker hub: https://hub.docker.com/r/jaegertracing/all-in-one
This is the command that I'm running:
docker run -d --name jaeger -p 16686:16686 -p 6831:6831/udp -p 4317:4317 -p 55680:55680 jaegertracing/all-in-one
The traces is showing on the console, but when I open Jaeger's dashboard, I got nothing. What is wrong here?
Edit: Figured it out. Jaeger has 2 Docker images: one that is Otel-compliant, and one that is not. In this question I was using the one that is not, so that is why the Otlp Exporter did not work.
I have since changed to use the OTel-compliant image in https://hub.docker.com/r/jaegertracing/opentelemetry-all-in-one/ (notice this one has "OTEL" name in it)
Solution 1:[1]
You need to use the JaegerExporter or send the traces to a otel-collector and from the collector to Jaeger.
For .net you need something like this:
.AddJaegerExporter(o =>
{
o.AgentHost = "localhost";
o.AgentPort = 14250;
})
Make sure you expose the Jaeger port to your localhost.
That's the easiest way, and you can stop here if you want.
But if you think about changing the backend in the future, maybe it would be a good idea to invest some time in configuring the otel-collector now.
You would need a conf.yml like this (logging is optional in this case):
receivers:
otlp:
protocols:
grpc:
http:
exporters:
jaeger:
endpoint: "jaeger:14250"
tls:
insecure: true
logging:
loglevel: debug
service:
pipelines:
traces:
receivers: [otlp]
processors: []
exporters: [logging,jaeger]
And your collector Dockerfile would be something like this:
FROM otel/opentelemetry-collector-contrib:0.48.0
COPY conf.yml .
EXPOSE 1888
EXPOSE 8888
EXPOSE 8889
EXPOSE 13133
EXPOSE 4317
EXPOSE 55670
CMD [ "--config=conf.yml" ]
You can send the trace to the collector, the collector will receive OTLP and will send to Jaeger.
In this 2nd scenario, you can continue using "http://localhost:4317" if you configure your collector to expose its ports to localhost.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Juliano Costa |
