Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In Jaeger I get "unknown_service:dotnet" and "Duplicate tag "peer.service:" #2027

Open
SVronskiy opened this issue May 3, 2021 · 11 comments
Labels
bug Something isn't working

Comments

@SVronskiy
Copy link

SVronskiy commented May 3, 2021

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:"

image

Describe your environment.

Startup.cs:

services.AddOpenTelemetryTracing((builder) => builder
    .AddAspNetCoreInstrumentation()
    .AddHttpClientInstrumentation()
    .AddSqlClientInstrumentation()
    .AddZipkinExporter(options =>
    {
        options.Endpoint = new Uri("http://zipkin.istio-system:9411/api/v2/spans");
    })
    );

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.

@SVronskiy SVronskiy added the question Further information is requested label May 3, 2021
@robrich
Copy link

robrich commented May 9, 2021

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 ...
}

@SVronskiy
Copy link
Author

SVronskiy commented May 9, 2021

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.

@ElectricVampire
Copy link

ElectricVampire commented May 21, 2021

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.

@SVronskiy
Copy link
Author

@ElectricVampire I do not have option to change issue kind ((

@cijothomas cijothomas added area:exporter bug Something isn't working and removed question Further information is requested labels Jun 23, 2021
@cijothomas
Copy link
Member

Can anyone share a repro code which results in duplicate peer.service tags?

@ElectricVampire
Copy link

@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");
})

@luizhlelis
Copy link
Contributor

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:

with-zipkin-exporter

changing to AddJaegerExporter the duplicate tag warning stopped to appear:

with-jaeger-exporter

@ElectricVampire and @SVronskiy, as you're using the Jaeger UI, did you tried to use the AddJaegerExporter method?

@ElectricVampire
Copy link

@luizhlelis it works with JaegerExporter but jaegerExporter has limitation that it doesn't support Http or grpc(#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.

@julealgon
Copy link

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.

@robrich
Copy link

robrich commented Jul 19, 2022

@julealgon I agree, I think making the name more descriptive by default would be wonderful.

@pellared
Copy link
Member

I just quickly scrolled through the issue and it looks related to this one #2781

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

8 participants