Open SVronskiy opened 3 years ago
To set the name from unknown_service
to something descriptive:
public void ConfigureServices(IServiceCollection services)
{
// ... snip ...
services.AddOpenTelemetryTracing((builder) => {
builder
.SetResourceBuilder(ResourceBuilder
.CreateDefault()
.AddService(env.ApplicationName)) // <-- sets service name
.AddAspNetCoreInstrumentation();
// .AddMoreThings :D
// ... snip ...
}
Hello, @robrich!
Thank you for reply! Anfortunitely this is not a solution.
Above source code will return "env.ApplicationName" anythere, but we need to get text "google.com", "yandex.ru" etc according to url in httpclient, Take a look at at second screenshots at #2584 span.kind & peer.service - this is how it should work.
I am having exact same issue, getting warning for duplicate tag "peer.service". @SVronskiy Can we mark this as bug rather than question. I just want to get rid of warning message.
@ElectricVampire I do not have option to change issue kind ((
Can anyone share a repro code which results in duplicate peer.service tags?
@cijothomas Any trace going to DB or another API will show the warning of duplicate peer.service tag on jaeger UI if we use Zipkin exporter with http(s) endpoint on 9411 port. .AddZipkinExporter(options => { options.Endpoint = new Uri("http://zipkin.istio-system:9411/api/v2/spans"); })
Can anyone share a repro code which results in duplicate peer.service tags?
@cijothomas, I reproduced the Duplicate tag "peer.service:localhost:5001"
in this example. Maybe that's not an issue, but it could be a wrong setup. It happened with me when I used the AddZipkinExporter
method instead of using AddJaegerExporter
:
changing to AddJaegerExporter
the duplicate tag warning stopped to appear:
@ElectricVampire and @SVronskiy, as you're using the Jaeger UI, did you tried to use the AddJaegerExporter
method?
@luizhlelis it works with JaegerExporter but jaegerExporter has limitation that it doesn't support Http or grpc(https://github.com/open-telemetry/opentelemetry-dotnet/issues/2054) hence using ZipkinExporter which does support Http.
Jaeger has a port open for Zipkin traces as well (https://www.jaegertracing.io/docs/1.17/features/#backwards-compatibility-with-zipkin), hence we can still use ZipkinExporter for JaegerUI, so I would not say this as invalid configuration.
To set the name from
unknown_service
to something descriptive:public void ConfigureServices(IServiceCollection services) { // ... snip ... services.AddOpenTelemetryTracing((builder) => { builder .SetResourceBuilder(ResourceBuilder .CreateDefault() .AddService(env.ApplicationName)) // <-- sets service name .AddAspNetCoreInstrumentation(); // .AddMoreThings :D // ... snip ... }
@robrich , is there any particular reason why using the application name is not already the default when calling the OTel hosting extensions?
I've configured the instrumentation in a couple services here and only realized later how bad the default name really is.
@julealgon I agree, I think making the name more descriptive by default would be wonderful.
I just quickly scrolled through the issue and it looks related to this one https://github.com/open-telemetry/opentelemetry-dotnet/issues/2781
List of NuGet packages and version that you are using: "OpenTelemetry.Exporter.Console" Version="1.1.0-beta1" /> "OpenTelemetry.Exporter.Jaeger" Version="1.0.1" /> "OpenTelemetry.Exporter.Zipkin" Version="1.0.1" /> "OpenTelemetry.Extensions.Hosting" Version="1.0.0-rc4" /> "OpenTelemetry.Instrumentation.AspNetCore" Version="1.0.0-rc4" /> "OpenTelemetry.Instrumentation.Http" Version="1.0.0-rc4" /> "OpenTelemetry.Instrumentation.SqlClient" Version="1.0.0-rc4" />
Runtime version netcoreapp2.2
Question
In Jaeger I get "unknown_service:dotnet" and "Duplicate tag "peer.service:"
Describe your environment.
Startup.cs:
Run application under kubernetes 1.18, jaegertracing/all-in-one:1.20, istio 1.9.2.
What are you trying to achieve?
What did you expect to see?
I'de like to have name situated in "peer.service" instead of unknown_service:dotnet, on my screen it should be "content".
Additional Context
Problem is similar to described here: #2584 span.kind & peer.service
I still do not have any idea how to fix it. Could you help me, please.