-
Notifications
You must be signed in to change notification settings - Fork 430
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
Aspire Dashboard: Traces: Span links aren't shown in span details #2577
Comments
Sample code for the API Service to create an unparented linked span: var apiActivitySource = new ActivitySource("CustomActivitySource");
app.MapGet("/weatherforecast", () =>
{
var parent = Activity.Current;
Activity.Current = null;
var links = new List<ActivityLink>
{
new ActivityLink(parent.Context),
};
var pContext = new ActivityContext(parent.Context.TraceId, new ActivitySpanId(), ActivityTraceFlags.Recorded);
var activity = apiActivitySource.StartActivity("LinkTest", ActivityKind.Internal, pContext, null, links);
WeatherForecast[] forecast;
using (activity)
{
forecast = Enumerable.Range(1, 5).Select(index =>
new WeatherForecast
(
DateOnly.FromDateTime(DateTime.Now.AddDays(index)),
Random.Shared.Next(-20, 55),
summaries[Random.Shared.Next(summaries.Length)]
))
.ToArray();
}
Activity.Current = parent;
return forecast;
}); Add the following to tracing.AddSource("CustomActivitySource");
tracing.AddConsoleExporter(); You want a trace with the following properties to test with: Activity.TraceId: 5f27e3762a87be1eea8bc65a70ec2893
Activity.SpanId: f77c6ad8a3d3cedc
Activity.TraceFlags: Recorded
Activity.ActivitySourceName: CustomActivitySource
Activity.DisplayName: LinkTest
Activity.Kind: Internal
Activity.StartTime: 2024-03-02T00:15:59.6368281Z
Activity.Duration: 00:00:00.0014354
Activity.Links:
5f27e3762a87be1eea8bc65a70ec2893 e66a00a9ee3f676c
Resource associated with Activity:
telemetry.distro.name: Azure.Monitor.OpenTelemetry.AspNetCore
service.name: apiservice
service.instance.id: apiservice-32dv1ro
telemetry.sdk.name: opentelemetry
telemetry.sdk.language: dotnet
telemetry.sdk.version: 1.7.0 It doesn't have an |
Sure, we can do this. Links are not must have and no one has asked for it yet so it probably won't happen before V1. |
Moving to backlog |
I only just figured out that this wasn't supported. I had people mentioning it in my talk today, and found out I can't use it for my workshop since messaging is normally span links. For another datapoint, ServiceBus's instrumentation OOTB (the experimental flagged one) creates links for the Receive spans, which makes the dashboard very confusing. I think this is going to become a bigger issue as the Messaging semantic conventions will be being stablised in the next few months, making it non-experimental in the .NET Azure SDKs. |
I've been working on some tracing of a message bus library (AWS based) I look after and discovered this same issue, I was (and still am) expecting to see linked spans displayed in a meaningful way in the Aspire dashboard. This is an important feature for successful adoption. |
Any interest in a contribution? 🙂 |
Request to people who are interested in this:
We already capture span links. The work involved is displaying it in the UI. It would be great to see how systems represent links between spans. Ideas for displaying span link:
When you click on a span link I expect that it would:
|
Span links are multiple per span, and can be attached to any span (root or In terms of navigation, I'd expect to be taken to the details view of the Span links are most useful when they link between spans in different Happy to send some honeycomb/jaeger screenshots, but it'll be next week. Bonus points if you backlink automatically (which is probably easier with the inmemory model). |
Backlinking shouldn't be difficult. Although, the UI would be slow if a span has thousands of backlinks to display. Simple fix is to put a limit on rendered backlinks (e.g. 100). If there is feedback that people have spans with lots of backlinks and they want to see them all then the UI could be virtualized. |
The rendering is the same problem either way really. A span could have a link to 100 other spans. A span could be linked to from 100 other spans. If you're putting in backlinks then you need to distinguish them from outbound/forward links in the UI somehow. Which does make it complicated and there aren't any solutions right now doing it that I know about. The main thing is how the display works with 100+ outbound links. |
We are actually using span links to break up our traces in more managable chunks while still retaining the ability to see the big picture. The full picture is just too big to render all at the same time. I noticed app insights renders the links but the aspire dashboard indeed doesn't. Would be nice to see this working in the aspire dashboard soon so kudos to JamesNK. |
When dealing with messaging systems, you typically don't want spans trying to encapsulate the processing of messages that you don't have control over, so rather than having a parent/child relationship, links can be used instead.
The dashboard does not currently display links in the details view for spans.
Also linked spans are not shown unless they have the same TraceID and it's unclear if that will always happen in a message based system.
We should :-
The text was updated successfully, but these errors were encountered: