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

Trace span names not showing useful titles #4302

Closed
slang25 opened this issue May 26, 2024 · 7 comments · Fixed by #4661
Closed

Trace span names not showing useful titles #4302

slang25 opened this issue May 26, 2024 · 7 comments · Fixed by #4661
Assignees
Labels
area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication area-dashboard area-telemetry
Milestone

Comments

@slang25
Copy link

slang25 commented May 26, 2024

I'm on the latest version of Aspire, and when I look at traces, they have the guids as the span service names like this:
image

In demos, I typically see a nice service name here instead. Is there something I need to do so that I have nice service names here?

@slang25
Copy link
Author

slang25 commented May 26, 2024

The guid matches the service.instance.id for the container

@slang25
Copy link
Author

slang25 commented May 28, 2024

Playing around here, I've managed to find the offending code, so this only happens when I specify a service name and/or version like this:

.WithTracing((builder) =>
{
    builder.SetResourceBuilder(ResourceBuilder.CreateDefault().AddService(ApplicationTelemetry.ServiceName))
         // ...
}

We want the service name and version for our prod OTEL data, so I can workaround this for now by making this a conditional thing. However I think this is still a bug, providing a service name shouldn't make the trace viewing experience worse, right?

@leslierichardson95 leslierichardson95 added the area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication label May 28, 2024
@mitchdenny mitchdenny added this to the Backlog milestone Jun 4, 2024
@JamesNK
Copy link
Member

JamesNK commented Jun 4, 2024

Are you seeing this on your local machine when running the Aspire app host project?

Could you upload a simple repo to GitHub? I can take a look and see what is wrong.

@slang25
Copy link
Author

slang25 commented Jun 5, 2024

This was really hard to replicate, but I finally got it 😅 It only happens when the Aspire resource name matches the service name, then the Aspire dashboard starts displaying things in terms of replica sets incorrectly:
image

In the case for this screenshot, if I rename either the service name or resource name from "myapp" to "myapp2", everything works as expected. I'll push something up to GH shortly.

@slang25
Copy link
Author

slang25 commented Jun 5, 2024

Here's the example, again change the resource name or service name from "myapp" to anything else and it works, otherwise things become a bit broken:
https://github.com/slang25/aspire-issue/

I can work around this for now, but my assumption would be that these names clashing would be supported, and a common occurrence.

@slang25
Copy link
Author

slang25 commented Jun 7, 2024

I'm also see this issue crop up when I see peoples demos and blogs, take a look at the screenshots here as an example:
https://nikiforovall.github.io/dotnet/opentelemtry/2024/06/07/test-instrumentation-with-otel-aspire.html

@lmolkova
Copy link
Contributor

lmolkova commented Jun 16, 2024

+1

I have a basic Java app used with otel java agent that populates both service.name and service.instance.id by default.
Instance id is random guid generated at start time.

Span names appear with instance id prefix (which is not really helpful).

image

Happy to share repro too if it's helpful.

I believe the reason it's not affecting .NET apps that much is because OTel .NET set service.instance.id to service name by default, so things look good.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication area-dashboard area-telemetry
Projects
None yet
7 participants