5 instantiations of OtlpSpan
Aspire.Dashboard (3)
Otlp\Model\OtlpSpan.cs (1)
85return new OtlpSpan(item.Source, trace, item.Scope)
Otlp\Storage\SqliteTelemetryRepository.Traces.Reads.cs (1)
788var modelSpan = new OtlpSpan(view, trace, scope)
Otlp\Storage\SqliteTelemetryRepository.Traces.Writes.cs (1)
926var modelSpan = new OtlpSpan(resourceView, trace, scope)
Aspire.Dashboard.Components.Tests (1)
tests\Shared\Telemetry\TelemetryTestHelpers.cs (1)
271return new OtlpSpan(resource.GetView([]), trace, scope)
Aspire.Dashboard.Tests (1)
tests\Shared\Telemetry\TelemetryTestHelpers.cs (1)
271return new OtlpSpan(resource.GetView([]), trace, scope)
248 references to OtlpSpan
Aspire.Dashboard (147)
Api\TelemetryApiService.cs (2)
267await foreach (var span in telemetryRepository.WatchSpansAsync(watchRequest, cancellationToken).ConfigureAwait(false)) 477/// <see cref="OtlpSpan.GetFieldValue"/>. Returns null for unrecognized keys.
Components\Controls\Chart\ChartBase.cs (6)
68private Dictionary<SpanKey, OtlpSpan> _currentCache = new Dictionary<SpanKey, OtlpSpan>(); 69private Dictionary<SpanKey, OtlpSpan> _newCache = new Dictionary<SpanKey, OtlpSpan>(); 215_newCache = new Dictionary<SpanKey, OtlpSpan>(); 229if (!_currentCache.TryGetValue(key, out var span))
Components\Controls\Chart\ChartExemplar.cs (1)
16public required OtlpSpan? Span { get; init; }
Components\Controls\PropertyValues\SpanKindValue.razor.cs (1)
22public required OtlpSpan Span { get; set; }
Components\Controls\PropertyValues\SpanStatusValue.razor.cs (1)
18public required OtlpSpan Span { get; set; }
Components\Controls\SpanActions.razor.cs (1)
27public required EventCallback<OtlpSpan> OnLaunchGenAI { get; set; }
Components\Controls\SpanDetails.razor.cs (1)
28public EventCallback<OtlpSpan> LaunchGenAICallback { get; set; }
Components\Dialogs\GenAIVisualizerDialog.razor.cs (8)
35private List<OtlpSpan> _contextSpans = default!; 119var span = newContextSpans.Find(s => s.SpanId == Content.Span.SpanId)!; 237if (TryGetContextSpanByIndex(_currentSpanContextIndex - 1, out var span)) 245if (TryGetContextSpanByIndex(_currentSpanContextIndex + 1, out var span)) 251private bool TryGetContextSpanByIndex(int index, [NotNullWhen(true)] out OtlpSpan? span) 257private async Task<bool> TryUpdateViewedGenAISpanAsync(OtlpSpan newSpan) 388OtlpSpan span, long? selectedLogEntryId, 389ITelemetryRepository telemetryRepository, ITelemetryErrorRecorder errorRecorder, List<OtlpResource> resources, Func<List<OtlpSpan>> getContextGenAISpans,
Components\Pages\StructuredLogs.razor.cs (3)
554var span = TelemetryRepository.GetSpan(logEntry.TraceId, logEntry.SpanId)!; 571var genAISpans = new List<OtlpSpan>(); 572foreach (var s in trace.Spans)
Components\Pages\TraceDetail.razor.cs (6)
187var headerSpan = _trace.RootOrFirstSpan; 312foreach (var span in trace.Spans) 535private async Task OnGenAIClickedAsync(OtlpSpan span) 546var genAISpans = new List<OtlpSpan>(); 696foreach (var span in _trace.Spans) 715var fieldValues = OtlpSpan.GetFieldValuesFromTraces([_trace], attributeName);
Components\Pages\Traces.razor.cs (1)
429var firstSpan = trace.Spans.FirstOrDefault(s => GenAIHelpers.HasGenAIAttribute(s.Attributes));
Model\DashboardSqliteOutgoingPeerResolver.cs (1)
14var isDashboardSqlite = string.Equals(attributes.GetValue(OtlpSpan.PeerServiceAttributeKey), DashboardRunStore.DatabaseFileName, StringComparison.Ordinal) &&
Model\ExportHelpers.cs (1)
24public static async Task<ExportResult> GetSpanAsJsonAsync(OtlpSpan span, ITelemetryRepository telemetryRepository, CancellationToken cancellationToken)
Model\GenAI\GenAIItemViewModel.cs (1)
27public required OtlpSpan Parent { get; init; }
Model\GenAI\GenAIVisualizerDialogViewModel.cs (4)
26public required OtlpSpan Span { get; init; } 30public required Func<List<OtlpSpan>> GetContextGenAISpans { get; init; } 55Func<List<OtlpSpan>> getContextGenAISpans, 597private static async Task<List<OtlpLogEntry>> GetSpanLogEntriesAsync(ITelemetryRepository telemetryRepository, OtlpSpan span, CancellationToken cancellationToken)
Model\Otlp\SpanWaterfallViewModel.cs (5)
15public required OtlpSpan Span { get; init; } 65public static string GetTitle(OtlpSpan span, List<OtlpResource> allResources) 76TraceHelpers.VisitSpans(trace, (OtlpSpan span, SpanWaterfallViewModelState s) => 89static SpanWaterfallViewModel CreateViewModel(OtlpSpan span, int depth, bool hidden, TraceDetailState state, List<LogSummary>? spanLogs, ref int currentSpanLogIndex) 158private static string? ResolveUninstrumentedPeerName(OtlpSpan span, List<OtlpResource> allResources)
Model\Otlp\TelemetryFilter.cs (1)
59/// milliseconds stored in the field value from <see cref="OtlpSpan.GetFieldValue"/> / <see cref="OtlpLogEntry.GetFieldValue"/>.
Model\SpanDetailsViewModel.cs (3)
15public required OtlpSpan Span { get; init; } 22public static SpanDetailsViewModel Create(OtlpSpan span, ITelemetryRepository telemetryRepository, List<OtlpResource> resources) 68var linkSpan = trace?.Spans.FirstOrDefault(s => s.SpanId == spanId);
Model\SpanLinkViewModel.cs (1)
13public required OtlpSpan? Span { get; init; }
Model\SpanMenuBuilder.cs (2)
56OtlpSpan span, 58EventCallback<OtlpSpan> onLaunchGenAI,
Model\TelemetryExportService.cs (6)
272internal static OtlpTelemetryDataJson ConvertSpansToOtlpJson(IReadOnlyList<OtlpSpan> spans) 279var firstSpan = resourceGroup.First(); 306internal static string ConvertSpanToJson(OtlpSpan span, List<OtlpLogEntry>? logs = null, bool indent = true) 338var firstSpan = resourceGroup.First(); 383private static OtlpSpanJson ConvertSpan(OtlpSpan span) 831private static string? GetDestination(OtlpSpan span)
Model\TraceHelpers.cs (17)
16public static void VisitSpans<TState>(OtlpTrace trace, Func<OtlpSpan, TState, TState> spanAction, TState state) 19var spanLookup = new Dictionary<OtlpSpan, List<OtlpSpan>>(); 20var unrootedSpans = new List<OtlpSpan>(); 21foreach (var item in trace.Spans) 23if (string.IsNullOrEmpty(item.ParentSpanId) || !trace.Spans.TryGetValue(item.ParentSpanId, out var parentSpan)) 35var orderByFunc = static (OtlpSpan s) => s.StartTime; 37foreach (var unrootedSpan in unrootedSpans.OrderBy(orderByFunc)) 44static void Visit(Dictionary<OtlpSpan, List<OtlpSpan>> spanLookup, OtlpSpan span, Func<OtlpSpan, TState, TState> spanAction, TState state, Func<OtlpSpan, DateTime> orderByFunc) 48foreach (var childSpan in childSpans.OrderBy(orderByFunc)) 69VisitSpans(trace, (OtlpSpan span, OrderedResourcesState state) => 90private static void ProcessSpanResource(OtlpSpan span, OtlpResource resource, Dictionary<OtlpResource, OrderedResource> resourceFirstTimes, DateTime currentMinDate) 129public static Icon? TryGetSpanIcon(OtlpSpan span, IconVariant iconVariant)
Model\TraceLinkHelpers.cs (1)
20Func<string, string, OtlpSpan?> getSpan,
Otlp\Model\OtlpHelpers.cs (5)
414var address = GetValue(values, OtlpSpan.PeerServiceAttributeKey); 421if (GetValue(values, OtlpSpan.ServerAddressAttributeKey) is { } server) 423if (GetValue(values, OtlpSpan.ServerPortAttributeKey) is { } serverPort) 431if (GetValue(values, OtlpSpan.NetPeerNameAttributeKey) is { } peer) 433if (GetValue(values, OtlpSpan.NetPeerPortAttributeKey) is { } peerPort)
Otlp\Model\OtlpSpan.cs (10)
50public IEnumerable<OtlpSpan> GetChildSpans() => GetChildSpans(this, Trace.Spans); 51public static IEnumerable<OtlpSpan> GetChildSpans(OtlpSpan parentSpan, OtlpSpanCollection spans) => spans.Where(s => s.ParentSpanId == parentSpan.SpanId); 61public OtlpSpan? GetParentSpan() 68if (Trace.Spans.TryGetValue(ParentSpanId, out var span)) 83public static OtlpSpan Clone(OtlpSpan item, OtlpTrace trace) 171static string BuildDisplaySummary(OtlpSpan span) 230public static FieldValues GetFieldValue(OtlpSpan span, string field) 259foreach (var span in trace.Spans)
Otlp\Model\OtlpSpanCollection.cs (4)
8public sealed class OtlpSpanCollection : KeyedCollection<string, OtlpSpan> 17protected override string GetKeyForItem(OtlpSpan item) 22public new List<OtlpSpan>.Enumerator GetEnumerator() 25return ((List<OtlpSpan>)this.Items).GetEnumerator();
Otlp\Model\OtlpSpanEvent.cs (1)
16public class OtlpSpanEvent(OtlpSpan span) : IPropertyGridItem
Otlp\Model\OtlpTrace.cs (19)
11private OtlpSpan? _rootSpan; 18public OtlpSpan FirstSpan => Spans[0]; // There should always be at least one span in a trace. 20public OtlpSpan? RootSpan => _rootSpan; 21public OtlpSpan RootOrFirstSpan => RootSpan ?? FirstSpan; 26public int CalculateDepth(OtlpSpan span) 29var currentSpan = span; 40public void AddSpan(OtlpSpan span, bool skipLastUpdatedDate = false) 70foreach (var existingSpan in Spans) 93static string BuildFullName(OtlpSpan existingSpan) 99private static bool HasCircularReference(OtlpSpan span) 109var currentSpan = span; 127var span = Spans[index]; 146foreach (var item in trace.Spans) 148newTrace.AddSpan(OtlpSpan.Clone(item, newTrace), skipLastUpdatedDate: true); 158foreach (var span in Spans) 173public void SetSpanUninstrumentedPeer(OtlpSpan span, OtlpResource? resource) 184private sealed class SpanStartDateComparer : IComparer<OtlpSpan> 188public int Compare(OtlpSpan? x, OtlpSpan? y)
Otlp\Storage\GetSpansResponse.cs (1)
10public required PagedResult<OtlpSpan> PagedResult { get; init; }
Otlp\Storage\ITelemetryRepository.cs (3)
51OtlpSpan? GetSpan(string traceId, string spanId); 52OtlpResource? GetPeerResource(OtlpSpan span); 67IAsyncEnumerable<OtlpSpan> WatchSpansAsync(WatchSpansRequest request, CancellationToken cancellationToken);
Otlp\Storage\SqliteTelemetryRepository.cs (2)
226public OtlpSpan? GetSpan(string traceId, string spanId) => GetSpanFromDatabase(traceId, spanId); 227public OtlpResource? GetPeerResource(OtlpSpan span) => span.UninstrumentedPeer;
Otlp\Storage\SqliteTelemetryRepository.Runtime.cs (10)
199private void NotifySpansAdded(List<OtlpSpan> spans) 218public async IAsyncEnumerable<OtlpSpan> WatchSpansAsync( 222var channel = Channel.CreateBounded<OtlpSpan>(new BoundedChannelOptions(1000) 247foreach (var span in existingSpans.PagedResult.Items.OrderBy(span => span.StartTime)) 252while (channel.Reader.TryRead(out var pendingSpan)) 260await foreach (var span in channel.Reader.ReadAllAsync(cancellationToken).ConfigureAwait(false)) 335private void PushSpansToWatchers(List<OtlpSpan> spans) 362foreach (var span in spans) 424private sealed class SpanWatcher(WatchSpansRequest request, Channel<OtlpSpan> channel) 427public Channel<OtlpSpan> Channel => channel;
Otlp\Storage\SqliteTelemetryRepository.Traces.Reads.cs (3)
407PagedResult = new PagedResult<OtlpSpan> 675private OtlpSpan? GetSpanFromDatabase(string traceId, string spanId) 788var modelSpan = new OtlpSpan(view, trace, scope)
Otlp\Storage\SqliteTelemetryRepository.Traces.Writes.cs (14)
25private async Task<List<OtlpSpan>> AddTracesToDatabaseAsync(AddContext context, RepeatedField<ResourceSpans> resourceSpans) 27var addedSpans = new List<OtlpSpan>(); 339var modelSpan = CreateSqliteSpan(resourceView, trace, scope, span); 408var incomingPrimarySpan = GetPrimarySpan(trace); 444static bool HasGenAI(IEnumerable<OtlpSpan> spans) => spans.Any(span => span.Attributes.Any(attribute => 448private static OtlpSpan GetPrimarySpan(OtlpTrace trace) 450var primarySpan = trace.Spans[0]; 451foreach (var span in trace.Spans.Skip(1)) 505var span = pendingSpan.Span; 557var span = pendingSpan.Span; 651var span = pendingSpan.Span; 918private OtlpSpan CreateSqliteSpan(OtlpResourceView resourceView, OtlpTrace trace, OtlpScope scope, Span span) 926var modelSpan = new OtlpSpan(resourceView, trace, scope) 1249private sealed record PendingSpan(long ResourceId, long ResourceViewId, long ScopeId, long ReceivedTimestampTicks, OtlpSpan Span)
ServiceClient\TracingSqliteConnection.cs (1)
85activity.SetTag(OtlpSpan.PeerServiceAttributeKey, databaseName);
Aspire.Dashboard.Components.Tests (9)
Controls\GenAIVisualizerDialogTests.cs (5)
100var span = CreateOtlpSpan(resource, trace, scope, spanId: "abc", parentSpanId: null, startDate: s_testTime, attributes: [ 131var span = CreateOtlpSpan(resource, trace, scope, spanId: GetHexId("abc"), parentSpanId: null, startDate: s_testTime); 217var span = trace.Spans[0]; 301var span = trace.Spans[0]; 304List<OtlpSpan> GetContextGenAISpans()
Shared\TestTelemetryRepository.cs (3)
48public OtlpSpan? GetSpan(string traceId, string spanId) => inner.GetSpan(traceId, spanId); 49public OtlpResource? GetPeerResource(OtlpSpan span) => inner.GetPeerResource(span); 55public IAsyncEnumerable<OtlpSpan> WatchSpansAsync(WatchSpansRequest request, CancellationToken cancellationToken) => inner.WatchSpansAsync(request, cancellationToken);
tests\Shared\Telemetry\TelemetryTestHelpers.cs (1)
267public static OtlpSpan CreateOtlpSpan(OtlpResource resource, OtlpTrace trace, OtlpScope scope, string spanId, string? parentSpanId, DateTime startDate,
Aspire.Dashboard.Tests (92)
DashboardSqliteOutgoingPeerResolverTests.cs (2)
25[InlineData(OtlpSpan.PeerServiceAttributeKey, "postgresql")] 44KeyValuePair.Create(OtlpSpan.PeerServiceAttributeKey, "dashboard.db"),
Integration\OtlpHttpJsonTests.cs (1)
540var span = trace.Spans.First();
Model\DashboardSqliteDatabaseTests.cs (2)
116Assert.Equal("dashboard.db", activity.GetTagItem(OtlpSpan.PeerServiceAttributeKey)); 194Assert.Equal("dashboard.db", activity.GetTagItem(OtlpSpan.PeerServiceAttributeKey));
Model\GenAIVisualizerDialogViewModelTests.cs (30)
51var span = repository.GetSpan(GetHexId("1"), GetHexId("1-1"))!; 102var span = repository.GetSpan(GetHexId("1"), GetHexId("1-1"))!; 187var span = repository.GetSpan(GetHexId("1"), GetHexId("1-1"))!; 279var span = repository.GetSpan(GetHexId("1"), GetHexId("1-1"))!; 349var span = repository.GetSpan(GetHexId("1"), GetHexId("1-1"))!; 428var span = repository.GetSpan(GetHexId("1"), GetHexId("1-1"))!; 478var span = repository.GetSpan(GetHexId("1"), GetHexId("1-1"))!; 559var span = repository.GetSpan(GetHexId("1"), GetHexId("1-1"))!; 676var span = repository.GetSpan(GetHexId("1"), GetHexId("1-1"))!; 757var span = repository.GetSpan(GetHexId("1"), GetHexId("1-1"))!; 842var span = repository.GetSpan(GetHexId("1"), GetHexId("1-1"))!; 896var span = repository.GetSpan(GetHexId("1"), GetHexId("1-1"))!; 973var span = repository.GetSpan(GetHexId("1"), GetHexId("1-1"))!; 1057var span = repository.GetSpan(GetHexId("1"), GetHexId("1-1"))!; 1166var span = repository.GetSpan(GetHexId("1"), GetHexId("1-1"))!; 1238var span = repository.GetSpan(GetHexId("1"), GetHexId("1-1"))!; 1281var span = repository.GetSpan(GetHexId("1"), GetHexId("1-1"))!; 1369var span = repository.GetSpan(GetHexId("1"), GetHexId("1-1"))!; 1459var span = repository.GetSpan(GetHexId("1"), GetHexId("1-1"))!; 1533var span = repository.GetSpan(GetHexId("1"), GetHexId("1-1"))!; 1642var span = repository.GetSpan(GetHexId("1"), GetHexId("1-1"))!; 1722var span = repository.GetSpan(GetHexId("1"), GetHexId("1-1"))!; 1803var span = repository.GetSpan(GetHexId("1"), GetHexId("1-1"))!; 1887var span = repository.GetSpan(GetHexId("1"), GetHexId("1-1"))!; 1970var span = repository.GetSpan(GetHexId("1"), GetHexId("1-1"))!; 2059var span = repository.GetSpan(GetHexId("1"), GetHexId("1-1"))!; 2132var span = repository.GetSpan(GetHexId("1"), GetHexId("1-1"))!; 2219var span = repository.GetSpan(GetHexId("1"), GetHexId("1-1"))!; 2292var span = repository.GetSpan(GetHexId("1"), GetHexId("1-1"))!; 2362var span = repository.GetSpan(GetHexId("1"), GetHexId("1-1"))!;
Model\ResourceMenuBuilderTests.cs (2)
133TelemetryTestHelpers.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), 134TelemetryTestHelpers.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 (1)
118attributes: [KeyValuePair.Create(OtlpSpan.ServerAddressAttributeKey, "localhost")],
Model\TelemetryExportServiceTests.cs (5)
487var parentSpan = CreateOtlpSpan( 494attributes: [KeyValuePair.Create(OtlpSpan.PeerServiceAttributeKey, "raw-address")], 496var childSpan = CreateOtlpSpan( 1054var span = (await repositoryContext.Repository.GetTracesAsync(GetTracesRequest.ForResourceKey(repositoryContext.Repository.GetResources()[0].ResourceKey), cancellationToken: CancellationToken.None)).PagedResult.Items[0].Spans[0]; 1107var span = (await repositoryContext.Repository.GetTracesAsync(GetTracesRequest.ForResourceKey(repositoryContext.Repository.GetResources()[0].ResourceKey), cancellationToken: CancellationToken.None)).PagedResult.Items[0].Spans[0];
Model\TraceDetailPageViewModelTests.cs (6)
40var span = TelemetryTestHelpers.CreateOtlpSpan(resource, trace, scope, spanId: "span1", parentSpanId: null, startDate: DateTime.UtcNow); 73var selectedSpan = TelemetryTestHelpers.CreateOtlpSpan(resource, trace, scope, spanId: "span1", parentSpanId: null, startDate: DateTime.UtcNow); 74var otherSpan = TelemetryTestHelpers.CreateOtlpSpan(resource, trace, scope, spanId: "span2", parentSpanId: null, startDate: DateTime.UtcNow); 108var span = TelemetryTestHelpers.CreateOtlpSpan(resource, trace, scope, spanId: "span1", parentSpanId: null, startDate: DateTime.UtcNow); 149var span = TelemetryTestHelpers.CreateOtlpSpan(resource, trace, scope, spanId: "span1", parentSpanId: null, startDate: DateTime.UtcNow); 169private static SpanWaterfallViewModel CreateSpanWaterfallViewModel(OtlpSpan span, List<SpanLogEntryViewModel>? spanLogs = null)
TelemetryRepositoryTests\OtlpSpanTests.cs (6)
25var span = TelemetryTestHelpers.CreateOtlpSpan(app1, trace, scope, spanId: "abc", parentSpanId: null, startDate: s_testTime, 76var span = TelemetryTestHelpers.CreateOtlpSpan(app1, trace, scope, spanId: "abc", parentSpanId: null, startDate: s_testTime); 95var span = TelemetryTestHelpers.CreateOtlpSpan(app1, trace, scope, spanId: "abc", parentSpanId: null, startDate: s_testTime, 115var parentSpan = TelemetryTestHelpers.CreateOtlpSpan(app1, trace, scope, spanId: "abc", parentSpanId: null, startDate: s_testTime, 117var childSpan = TelemetryTestHelpers.CreateOtlpSpan(app2, trace, scope, spanId: "abc-2", parentSpanId: "abc", startDate: s_testTime, 178var span = TelemetryTestHelpers.CreateOtlpSpan(app, trace, scope, spanId: "abc", parentSpanId: null, startDate: s_testTime,
TelemetryRepositoryTests\SqliteTelemetryPersistenceTests.cs (3)
111var span = Assert.Single(Assert.Single((await repositoryContext.Repository.GetTracesAsync(GetTracesRequest.ForResourceKey(cachedResource.ResourceKey), cancellationToken: CancellationToken.None)).PagedResult.Items).Spans); 157attributes: [KeyValuePair.Create(OtlpSpan.PeerServiceAttributeKey, "backend")], 177var span = Assert.Single(reopenedContext.Repository.GetTrace(GetHexId("peer-trace"))!.Spans);
TelemetryRepositoryTests\TelemetryRepositoryTests.cs (13)
388var receivedSpans = new List<OtlpSpan>(); 394await foreach (var span in repositoryContext.Repository.WatchSpansAsync(new WatchSpansRequest { ResourceKeys = [], Filters = [] }, cts.Token)) 456await foreach (var span in repositoryContext.Repository.WatchSpansAsync(new WatchSpansRequest { ResourceKeys = [], Filters = [] }, cts.Token)) 660var receivedSpans = new List<OtlpSpan>(); 665await foreach (var span in repositoryContext.Repository.WatchSpansAsync(new WatchSpansRequest { ResourceKeys = [], Filters = [] }, linkedCts.Token)) 738var receivedSpans = new List<OtlpSpan>(); 743await foreach (var span in repositoryContext.Repository.WatchSpansAsync(new WatchSpansRequest { ResourceKeys = [], Filters = [] }, linkedCts.Token)) 807var receivedSpans = new List<OtlpSpan>(); 812await foreach (var span in repositoryContext.Repository.WatchSpansAsync(new WatchSpansRequest { ResourceKeys = [new ResourceKey("service1", "inst1")], Filters = [] }, cts.Token)) 882var receivedSpans = new List<OtlpSpan>(); 887await foreach (var span in repositoryContext.Repository.WatchSpansAsync(new WatchSpansRequest { ResourceKeys = [new ResourceKey("service1", "inst1"), new ResourceKey("service2", "inst2")], Filters = [] }, cts.Token)) 1346var receivedSpans = new List<OtlpSpan>(); 1351await foreach (var span in repositoryContext.Repository.WatchSpansAsync(new WatchSpansRequest { ResourceKeys = [], Filters = filters }, cts.Token))
TelemetryRepositoryTests\TraceTests.cs (20)
404attributes: [KeyValuePair.Create(OtlpSpan.PeerServiceAttributeKey, "dashboard.db")], 1649var expected = OtlpSpan.GetFieldValuesFromTraces(traces, field); 1780Spans = { 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) } 2631CreateSpan(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), 2632CreateSpan(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) 2710attributes: [KeyValuePair.Create(OtlpSpan.PeerServiceAttributeKey, "value-1")], 2740attributes: [KeyValuePair.Create(OtlpSpan.PeerServiceAttributeKey, "value-2")], 2797CreateSpan(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) 2838attributes: [KeyValuePair.Create(OtlpSpan.PeerServiceAttributeKey, "value-1")], 2900CreateSpan(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), 2901CreateSpan(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) 3009attributes: [KeyValuePair.Create(OtlpSpan.PeerServiceAttributeKey, "localhost")], 3023var span = Assert.Single(trace.Spans); 3053attributes: [KeyValuePair.Create(OtlpSpan.PeerServiceAttributeKey, "localhost")], 3069var span = Assert.Single(repositoryContext.Repository.GetTrace(GetHexId("1"))!.Spans); 3114CreateSpan(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), 3115CreateSpan(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) 3253var span = Assert.Single(result.PagedResult.Items); 3478attributes: [KeyValuePair.Create(OtlpSpan.PeerServiceAttributeKey, "peer")], 4966var span = trace.Spans[index];
tests\Shared\Telemetry\TelemetryTestHelpers.cs (1)
267public static OtlpSpan CreateOtlpSpan(OtlpResource resource, OtlpTrace trace, OtlpScope scope, string spanId, string? parentSpanId, DateTime startDate,