4 instantiations of OtlpSpan
Aspire.Dashboard (2)
Otlp\Model\OtlpSpan.cs (1)
82
return new
OtlpSpan
(item.Source, trace, item.Scope)
Otlp\Storage\TelemetryRepository.cs (1)
1223
var newSpan = new
OtlpSpan
(resourceView, trace, scope)
Aspire.Dashboard.Components.Tests (1)
tests\Shared\Telemetry\TelemetryTestHelpers.cs (1)
309
return new
OtlpSpan
(resource.GetView([]), trace, scope)
Aspire.Dashboard.Tests (1)
tests\Shared\Telemetry\TelemetryTestHelpers.cs (1)
309
return new
OtlpSpan
(resource.GetView([]), trace, scope)
103 references to OtlpSpan
Aspire.Dashboard (86)
Components\Controls\Chart\ChartBase.cs (6)
63
private Dictionary<SpanKey,
OtlpSpan
> _currentCache = new Dictionary<SpanKey,
OtlpSpan
>();
64
private Dictionary<SpanKey,
OtlpSpan
> _newCache = new Dictionary<SpanKey,
OtlpSpan
>();
315
if (!_currentCache.TryGetValue(key, out
var
span))
514
_newCache = new Dictionary<SpanKey,
OtlpSpan
>();
Components\Controls\Chart\ChartExemplar.cs (1)
16
public required
OtlpSpan
? Span { get; init; }
Components\Controls\PropertyValues\SpanKindValue.razor.cs (1)
22
public required
OtlpSpan
Span { get; set; }
Components\Controls\PropertyValues\SpanStatusValue.razor.cs (1)
18
public required
OtlpSpan
Span { get; set; }
Components\Pages\TraceDetail.razor.cs (3)
147
var
headerSpan = _trace.RootOrFirstSpan;
214
foreach (
var
span in _trace.Spans)
344
var
linkSpan = trace?.Spans.FirstOrDefault(s => s.SpanId == spanId);
Model\Otlp\SpanWaterfallViewModel.cs (5)
12
public required
OtlpSpan
Span { get; init; }
113
public static string GetTitle(
OtlpSpan
span, List<OtlpResource> allResources)
124
TraceHelpers.VisitSpans(trace, (
OtlpSpan
span, SpanWaterfallViewModelState s) =>
137
static SpanWaterfallViewModel CreateViewModel(
OtlpSpan
span, int depth, bool hidden, TraceDetailState state, List<OtlpLogEntry>? spanLogs, ref int currentSpanLogIndex)
206
private static string? ResolveUninstrumentedPeerName(
OtlpSpan
span, IOutgoingPeerResolver[] outgoingPeerResolvers)
Model\Otlp\TelemetryFilter.cs (2)
132
public bool Apply(
OtlpSpan
span)
134
var fieldValue =
OtlpSpan
.GetFieldValue(span, Field);
Model\SpanDetailsViewModel.cs (1)
10
public required
OtlpSpan
Span { get; init; }
Model\SpanLinkViewModel.cs (1)
13
public required
OtlpSpan
? Span { get; init; }
Model\TraceHelpers.cs (11)
15
public static void VisitSpans<TState>(OtlpTrace trace, Func<
OtlpSpan
, TState, TState> spanAction, TState state)
21
var orderByFunc = static (
OtlpSpan
s) => s.StartTime;
23
foreach (
var
unrootedSpan in trace.Spans.Where(s => s.GetParentSpan() == null).OrderBy(orderByFunc))
30
static void Visit(OtlpSpanCollection allSpans,
OtlpSpan
span, Func<
OtlpSpan
, TState, TState> spanAction, TState state, Func<
OtlpSpan
, DateTime> orderByFunc)
32
foreach (
var
childSpan in
OtlpSpan
.GetChildSpans(span, allSpans).OrderBy(orderByFunc))
52
VisitSpans(trace, (
OtlpSpan
span, OrderedResourcesState state) =>
72
private static void ProcessSpanResource(
OtlpSpan
span, OtlpResource resource, Dictionary<OtlpResource, OrderedResource> resourceFirstTimes, DateTime currentMinDate)
111
public static Icon? TryGetSpanIcon(
OtlpSpan
span, IconVariant iconVariant)
Model\TraceLinkHelpers.cs (1)
20
Func<string, string,
OtlpSpan
?> getSpan,
Otlp\Model\OtlpHelpers.cs (5)
349
var address = GetValue(values,
OtlpSpan
.PeerServiceAttributeKey);
356
if (GetValue(values,
OtlpSpan
.ServerAddressAttributeKey) is { } server)
358
if (GetValue(values,
OtlpSpan
.ServerPortAttributeKey) is { } serverPort)
366
if (GetValue(values,
OtlpSpan
.NetPeerNameAttributeKey) is { } peer)
368
if (GetValue(values,
OtlpSpan
.NetPeerPortAttributeKey) is { } peerPort)
Otlp\Model\OtlpSpan.cs (9)
47
public IEnumerable<
OtlpSpan
> GetChildSpans() => GetChildSpans(this, Trace.Spans);
48
public static IEnumerable<
OtlpSpan
> GetChildSpans(
OtlpSpan
parentSpan, OtlpSpanCollection spans) => spans.Where(s => s.ParentSpanId == parentSpan.SpanId);
58
public
OtlpSpan
? GetParentSpan()
65
if (Trace.Spans.TryGetValue(ParentSpanId, out
var
span))
80
public static
OtlpSpan
Clone(
OtlpSpan
item, OtlpTrace trace)
137
static string BuildDisplaySummary(
OtlpSpan
span)
192
public static FieldValues GetFieldValue(
OtlpSpan
span, string field)
Otlp\Model\OtlpSpanCollection.cs (4)
8
public sealed class OtlpSpanCollection : KeyedCollection<string,
OtlpSpan
>
17
protected override string GetKeyForItem(
OtlpSpan
item)
22
public new List<
OtlpSpan
>.Enumerator GetEnumerator()
25
return ((List<
OtlpSpan
>)this.Items).GetEnumerator();
Otlp\Model\OtlpSpanEvent.cs (1)
14
public class OtlpSpanEvent(
OtlpSpan
span) : IPropertyGridItem
Otlp\Model\OtlpTrace.cs (19)
11
private
OtlpSpan
? _rootSpan;
17
public
OtlpSpan
FirstSpan => Spans[0]; // There should always be at least one span in a trace.
19
public
OtlpSpan
? RootSpan => _rootSpan;
20
public
OtlpSpan
RootOrFirstSpan => RootSpan ?? FirstSpan;
27
foreach (
var
span in Spans)
41
public int CalculateDepth(
OtlpSpan
span)
44
var
currentSpan = span;
55
public void AddSpan(
OtlpSpan
span, bool skipLastUpdatedDate = false)
87
foreach (
var
existingSpan in Spans)
110
static string BuildFullName(
OtlpSpan
existingSpan)
116
private static bool HasCircularReference(
OtlpSpan
span)
126
var
currentSpan = span;
147
var
span = Spans[i];
168
foreach (
var
item in trace.Spans)
170
newTrace.AddSpan(
OtlpSpan
.Clone(item, newTrace), skipLastUpdatedDate: true);
181
public void SetSpanUninstrumentedPeer(
OtlpSpan
span, OtlpResource? resource)
192
private sealed class SpanStartDateComparer : IComparer<
OtlpSpan
>
196
public int Compare(
OtlpSpan
? x,
OtlpSpan
? y)
Otlp\Storage\TelemetryRepository.cs (15)
89
foreach (
var
span in trace.Spans)
532
foreach (
var
span in t.Spans)
592
foreach (
var
span in t.Spans)
715
foreach (
var
span in trace.Spans)
717
var values =
OtlpSpan
.GetFieldValue(span, attributeName);
827
private
OtlpSpan
? GetSpanAndCloneUnsynchronized(string traceId, string spanId)
835
foreach (
var
span in trace.Spans)
847
public
OtlpSpan
? GetSpan(string traceId, string spanId)
977
var
newSpan = CreateSpan(resourceView, span, trace, scope, _otlpContext);
995
var
linkedSpan = GetSpanAndCloneUnsynchronized(link.TraceId, link.SpanId);
1107
foreach (
var
span in trace.Spans)
1133
private static ResourceViewModel? ResolveUninstrumentedPeerResource(
OtlpSpan
span, IEnumerable<IOutgoingPeerResolver> outgoingPeerResolvers)
1173
foreach (
var
span in trace.Spans)
1199
private static
OtlpSpan
CreateSpan(OtlpResourceView resourceView, Span span, OtlpTrace trace, OtlpScope scope, OtlpContext context)
1223
var
newSpan = new OtlpSpan(resourceView, trace, scope)
Aspire.Dashboard.Components.Tests (1)
tests\Shared\Telemetry\TelemetryTestHelpers.cs (1)
305
public static
OtlpSpan
CreateOtlpSpan(OtlpResource resource, OtlpTrace trace, OtlpScope scope, string spanId, string? parentSpanId, DateTime startDate,
Aspire.Dashboard.Tests (16)
Model\ResourceMenuItemsTests.cs (2)
71
TelemetryTestHelpers.CreateSpan(traceId: "1", spanId: "1-1", startTime: s_testTime.AddMinutes(1), endTime: s_testTime.AddMinutes(10), attributes: [KeyValuePair.Create(
OtlpSpan
.PeerServiceAttributeKey, "value-1")], kind: Span.Types.SpanKind.Client),
72
TelemetryTestHelpers.CreateSpan(traceId: "1", spanId: "1-2", startTime: s_testTime.AddMinutes(5), endTime: s_testTime.AddMinutes(10), parentSpanId: "1-1", attributes: [KeyValuePair.Create(
OtlpSpan
.PeerServiceAttributeKey, "value-2")], kind: Span.Types.SpanKind.Client)
Model\SpanWaterfallViewModelTests.cs (5)
127
var
span = TelemetryTestHelpers.CreateOtlpSpan(
161
var
parentSpan = TelemetryTestHelpers.CreateOtlpSpan(app1, trace, scope, spanId: "parent", parentSpanId: null, startDate: new DateTime(2001, 1, 1, 1, 1, 2, DateTimeKind.Utc));
162
var
childSpan = TelemetryTestHelpers.CreateOtlpSpan(app1, trace, scope, spanId: "child", parentSpanId: "parent", startDate: new DateTime(2001, 1, 1, 1, 1, 3, DateTimeKind.Utc));
183
var
parentSpan = TelemetryTestHelpers.CreateOtlpSpan(app1, trace, scope, spanId: "parent", parentSpanId: null, startDate: new DateTime(2001, 1, 1, 1, 1, 2, DateTimeKind.Utc));
184
var
childSpan = TelemetryTestHelpers.CreateOtlpSpan(app1, trace, scope, spanId: "child", parentSpanId: "parent", startDate: new DateTime(2001, 1, 1, 1, 1, 3, DateTimeKind.Utc));
TelemetryRepositoryTests\OtlpSpanTests.cs (1)
25
var
span = TelemetryTestHelpers.CreateOtlpSpan(app1, trace, scope, spanId: "abc", parentSpanId: null, startDate: s_testTime,
TelemetryRepositoryTests\TraceTests.cs (7)
1257
Spans = { CreateSpan(traceId: "1", spanId: "1-1", startTime: s_testTime.AddMinutes(1), endTime: s_testTime.AddMinutes(10), attributes: [KeyValuePair.Create("key1", "value1"), KeyValuePair.Create(
OtlpSpan
.PeerServiceAttributeKey, "value-1")], kind: Span.Types.SpanKind.Client) }
1952
CreateSpan(traceId: "1", spanId: "1-1", startTime: s_testTime.AddMinutes(1), endTime: s_testTime.AddMinutes(10), attributes: [KeyValuePair.Create(
OtlpSpan
.PeerServiceAttributeKey, "value-1")], kind: Span.Types.SpanKind.Client),
1953
CreateSpan(traceId: "1", spanId: "1-2", startTime: s_testTime.AddMinutes(5), endTime: s_testTime.AddMinutes(10), parentSpanId: "1-1", attributes: [KeyValuePair.Create(
OtlpSpan
.PeerServiceAttributeKey, "value-2")], kind: Span.Types.SpanKind.Client)
2039
CreateSpan(traceId: "1", spanId: "1-1", startTime: s_testTime.AddMinutes(1), endTime: s_testTime.AddMinutes(10), attributes: [KeyValuePair.Create(
OtlpSpan
.PeerServiceAttributeKey, "value-1")], kind: Span.Types.SpanKind.Client),
2040
CreateSpan(traceId: "1", spanId: "1-2", startTime: s_testTime.AddMinutes(5), endTime: s_testTime.AddMinutes(10), parentSpanId: "1-1", attributes: [KeyValuePair.Create(
OtlpSpan
.PeerServiceAttributeKey, "value-2")], kind: Span.Types.SpanKind.Client)
2145
CreateSpan(traceId: "1", spanId: "1-1", startTime: s_testTime.AddMinutes(1), endTime: s_testTime.AddMinutes(10), attributes: [KeyValuePair.Create(
OtlpSpan
.PeerServiceAttributeKey, "value-1")], kind: Span.Types.SpanKind.Client),
2146
CreateSpan(traceId: "1", spanId: "1-2", startTime: s_testTime.AddMinutes(5), endTime: s_testTime.AddMinutes(10), parentSpanId: "1-1", attributes: [KeyValuePair.Create(
OtlpSpan
.PeerServiceAttributeKey, "value-2")], kind: Span.Types.SpanKind.Client)
tests\Shared\Telemetry\TelemetryTestHelpers.cs (1)
305
public static
OtlpSpan
CreateOtlpSpan(OtlpResource resource, OtlpTrace trace, OtlpScope scope, string spanId, string? parentSpanId, DateTime startDate,