I'm trying to implement distributed tracing in .net 6. I am running jaeger from cmd by using .\jaeger-all-in-one.exe
. I am able to run and i can view through http://localhost:16686/
. now I added below code in program.cs
builder.Services.AddOpenTelemetryTracing(builder =>
{
builder
.SetResourceBuilder(ResourceBuilder.CreateDefault().AddService(" Api"))
.AddAspNetCoreInstrumentation()
.AddHttpClientInstrumentation()
.AddEntityFrameworkCoreInstrumentation(options => options.SetDbStatementForText = true)
.AddSource(namer) // when we manually create activities, we need to setup the sources here
.AddZipkinExporter(options =>
{
// not needed, it's the default
options.Endpoint = new Uri("http://localhost:9411/api/v2/spans");
})
.AddJaegerExporter(options =>
{
options.AgentHost = "localhost";
options.AgentPort = 6831;
});
});
After adding this when I run my web api project I am not able see my service name in jaeger ui.
how to fix this?
i have tried all suggestions, yt videos and chatgpt suggestions. but still not able to view my service name in jaeger ui list.
i need to list my service name so that i can trace all my apis request