Jaeger没有收到任何opentelemetry Trace
因此,我正在尝试将OpenTelemetry Trace发送回Jaeger。我尝试将轨迹发送到控制台,并且可以正常工作。但是将其发送给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();
});
我正在Docker Hub中运行Jaeger的助攻: https:// https:// .docker.com/r/jaegertracing/All-In-In-a>
这是我正在运行的命令: docker run -d -name jaeger -p 16686:16686 -p 6831:6831/udp -p 4317:4317:4317 -P 55680:55680 jaegertracing/all -in -in -in -in -in -in -inn -One
控制台,但是当我打开Jaeger的仪表板时,我什么都没有。这里怎么了?
编辑: 弄清楚了。 Jaeger有2个Docker图像:一张符合Otel的图像,另一幅不符合Otel的图像。在这个问题中,我使用的不是一个,所以这就是为什么OTLP出口商不起作用的原因。
此后,我更改了 https:// https:/// hub.docker.com/r/jaegertracing/opentelemetry-all-in-one/ (请注意,其中有“ Otel”名称)
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)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我相信到 2022 年,AIO 镜像确实支持 OTLP。
尝试使用下面的命令运行 docker 容器,
替换为您拥有的任何版本的映像。我试过1.37
I believe as of 2022, the AIO image does support OTLP.
Try running the docker container using below
Replace with whatever version of image you have. I tried with 1.37
更新 05/2023
对于 .net,您需要这样的内容:
有关此处的更多详细信息:https://opentelemetry.io/docs/instrumentation/net/exporters/#otlp-endpoint
通过在 .NET 应用程序中进行设置,您可以启动Jaeger 一体化容器,解释如下: https ://www.jaegertracing.io/docs/1.45/getting-started/#all-in-one
或者通过 OTel Collector 发送跟踪,使用以下收集器配置:
旧答案
您需要使用 JaegerExporter 或将跟踪发送到 otel-collector,然后从收集器发送到 Jaeger。
对于 .net,您需要这样的东西:
确保将 Jaeger 端口公开到您的本地主机。
这是最简单的方法,如果您愿意,可以停在这里。
但如果您考虑将来更改后端,也许现在花一些时间配置 otel-collector 是个好主意。
OTel-collector 文档
您需要一个
conf.yml
,例如this(在这种情况下,日志记录是可选的):您的收集器 Dockerfile 将如下所示:
您可以将跟踪发送到收集器,收集器将接收 OTLP 并将发送给 Jaeger。
在第二种情况下,如果您将收集器配置为将其端口公开给 localhost,则可以继续使用
"http://localhost:4317"
。Update 05/2023
For .net you need something like this:
More details about that in here: https://opentelemetry.io/docs/instrumentation/net/exporters/#otlp-endpoint
With that set in your .NET app, you can either spin up a Jaeger All-in-one container, explained here: https://www.jaegertracing.io/docs/1.45/getting-started/#all-in-one
Or send the trace through the OTel Collector, with the following Collector config:
Old answer
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:
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.
OTel-collector docs
You would need a
conf.yml
like this (logging is optional in this case):And your collector Dockerfile would be something like this:
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.