114 references to OtlpHelpers
Aspire.Dashboard (76)
Api\TelemetryApiService.cs (1)
589var matches = OtlpHelpers.ResolveResourceNameMatches(resourceName, resources);
Components\Controls\Chart\ChartExemplar.cs (1)
15public DateTimeOffset Start => new(OtlpHelpers.UnixNanoSecondsToDateTime(TimeUnixNano), TimeSpan.Zero);
Components\Controls\Chart\MetricInstrumentDataCache.cs (1)
35StartTime = OtlpHelpers.UnixNanoSecondsToDateTime(Math.Min(latestValue.StartTimeUnixNano, alignedLookbackStartUnixNano))
Components\Controls\Chart\PlotlyChart.razor.cs (1)
167title = $"{Loc[nameof(ControlsStrings.PlotlyChartTrace)]}: {OtlpHelpers.ToShortenedId(exemplar.TraceId)}";
Components\Dialogs\ExemplarsDialog.razor.cs (1)
59: $"{Loc[nameof(Resources.Dialogs.ExemplarsDialogTrace)]}: {OtlpHelpers.ToShortenedId(exemplar.TraceId)}";
Components\Dialogs\ManageDataDialog.razor.cs (1)
340private string GetOtlpResourceName(OtlpResource resource) => OtlpHelpers.GetResourceName(resource, TelemetryRepository.GetResources());
Components\Pages\StructuredLogs.razor.cs (1)
398private string GetResourceName(OtlpResource resource) => OtlpHelpers.GetResourceName(resource, _resources);
Components\Pages\Traces.razor.cs (1)
250private string GetResourceName(OtlpResource app) => OtlpHelpers.GetResourceName(app, _resources);
Model\BrowserLinkOutgoingPeerResolver.cs (2)
37var url = OtlpHelpers.GetValue(attributes, "url.full") ?? OtlpHelpers.GetValue(attributes, "http.url");
Model\ExportHelpers.cs (2)
28var fileName = $"span-{OtlpHelpers.ToShortenedId(span.SpanId)}.json"; 51var fileName = $"trace-{OtlpHelpers.ToShortenedId(trace.TraceId)}.json";
Model\GenAI\GenAIVisualizerDialogViewModel.cs (5)
67SourceName = OtlpHelpers.GetResourceName(spanDetailsViewModel.Span.Source.Resource, resources), 69? OtlpHelpers.GetResourceName(peerResource, resources) 70: OtlpHelpers.GetPeerAddress(spanDetailsViewModel.Span.Attributes) ?? UnknownPeerName 318if (!string.IsNullOrEmpty(item.Message) && OtlpHelpers.GetEventName(item) is { } name && TryMapEventName(name, out var type)) 625if (OtlpHelpers.GetEventName(logEntry) == GenAIHelpers.GenAIEvaluationResultEventName)
Model\Otlp\ResourcesSelectHelpers.cs (1)
129Name = OtlpHelpers.GetResourceName(replica, resources)
Model\Otlp\SpanWaterfallViewModel.cs (3)
102var hasPeerService = OtlpHelpers.GetPeerAddress(span.Attributes) != null; 164return OtlpHelpers.GetResourceName(span.UninstrumentedPeer, allResources); 168return OtlpHelpers.GetPeerAddress(span.Attributes);
Model\ResourceOutgoingPeerResolver.cs (1)
185var address = OtlpHelpers.GetPeerAddress(attributes);
Model\SpanDetailsViewModel.cs (1)
35Value = OtlpHelpers.GetResourceName(destination, resources)
Model\StructureLogsDetailsViewModel.cs (1)
15if (OtlpHelpers.GetEventName(logEntry) is { Length: > 0 } eventName)
Model\TelemetryExportService.cs (9)
165var resourceName = OtlpHelpers.GetResourceName(resource, resources); 181var resourceName = OtlpHelpers.GetResourceName(resource, resources); 221var resourceName = OtlpHelpers.GetResourceName(resource, resources); 257TimeUnixNano = OtlpHelpers.DateTimeToUnixNanoseconds(log.TimeStamp), 263new KeyValuePair<string, string>(OtlpHelpers.AspireLogIdAttribute, log.InternalId.ToString(CultureInfo.InvariantCulture)) 396StartTimeUnixNano = OtlpHelpers.DateTimeToUnixNanoseconds(span.StartTime), 397EndTimeUnixNano = OtlpHelpers.DateTimeToUnixNanoseconds(span.EndTime), 399? () => [new KeyValuePair<string, string>(OtlpHelpers.AspireDestinationNameAttribute, destinationName)] 426TimeUnixNano = OtlpHelpers.DateTimeToUnixNanoseconds(evt.Time),
Model\TraceLinkHelpers.cs (1)
28string.Format(CultureInfo.InvariantCulture, loc[nameof(Dialogs.OpenSpanDialogMessage)], OtlpHelpers.ToShortenedId(spanId)),
Otlp\Model\MetricValues\DimensionScope.cs (3)
34OtlpHelpers.ValidateNumberDataPoint(d); 89OtlpHelpers.ValidateHistogramDataPoint(h); 117if (!double.IsFinite(exemplarValue) || !OtlpHelpers.TryValidateMetricExemplarTimestamp(exemplar, context))
Otlp\Model\MetricValues\HistogramValue.cs (1)
73: OtlpHelpers.UnixNanoSecondsToDateTime(end).Ticks;
Otlp\Model\MetricValues\MetricValue.cs (2)
14: this(value, OtlpHelpers.DateTimeToUnixNanoseconds(start), OtlpHelpers.DateTimeToUnixNanoseconds(end))
Otlp\Model\MetricValues\MetricValueBase.cs (3)
15public DateTime Start => OtlpHelpers.UnixNanoSecondsToDateTime(StartTimeUnixNano); 16public DateTime End => OtlpHelpers.UnixNanoSecondsToDateTime(EndTimeUnixNano); 48public DateTime Start => OtlpHelpers.UnixNanoSecondsToDateTime(TimeUnixNano);
Otlp\Model\OtlpLogEntryData.cs (3)
32case OtlpHelpers.AspireLogIdAttribute: 47? OtlpHelpers.TruncateString(body.GetString(), context.Options.MaxAttributeLength) 92return OtlpHelpers.UnixNanoSecondsToDateTime(resolvedTimeUnixNano);
Otlp\Model\OtlpResource.cs (1)
63OtlpHelpers.GetResourceName(resource.Resource, allResources);
Otlp\Model\OtlpSpan.cs (11)
189else if (!string.IsNullOrEmpty(OtlpHelpers.GetValue(span.Attributes, "db.system"))) 191var dbSystem = OtlpHelpers.GetValue(span.Attributes, "db.system"); 195else if (!string.IsNullOrEmpty(OtlpHelpers.GetValue(span.Attributes, "rpc.system"))) 197var rpcSystem = OtlpHelpers.GetValue(span.Attributes, "rpc.system"); 198var rpcService = OtlpHelpers.GetValue(span.Attributes, "rpc.service"); 199var rpcMethod = OtlpHelpers.GetValue(span.Attributes, "rpc.method"); 203var grpcStatusCode = OtlpHelpers.GetValue(span.Attributes, "rpc.grpc.status_code"); 216else if (!string.IsNullOrEmpty(OtlpHelpers.GetValue(span.Attributes, "messaging.system"))) 218var messagingSystem = OtlpHelpers.GetValue(span.Attributes, "messaging.system"); 219var messagingOperation = OtlpHelpers.GetValue(span.Attributes, "messaging.operation"); 220var destinationName = OtlpHelpers.GetValue(span.Attributes, "messaging.destination.name");
Otlp\Model\OtlpTrace.cs (1)
138TraceId = OtlpHelpers.ToHexString(traceId);
Otlp\Storage\SqliteTelemetryRepository.Metrics.Reads.cs (1)
195return endTimeUnixNano is not null ? OtlpHelpers.UnixNanoSecondsToDateTime(checked((ulong)endTimeUnixNano.Value)) : null;
Otlp\Storage\SqliteTelemetryRepository.Metrics.Writes.cs (7)
54context.FailureCount += resourceMetricsItem.ScopeMetrics.Sum(scope => scope.Metrics.Sum(OtlpHelpers.GetMetricDataPointCount)); 68context.FailureCount += scopeMetrics.Metrics.Sum(OtlpHelpers.GetMetricDataPointCount); 79context.FailureCount += OtlpHelpers.GetMetricDataPointCount(metric); 138var pointCount = OtlpHelpers.GetMetricDataPointCount(metric); 202OtlpHelpers.ValidateNumberDataPoint(point); 279OtlpHelpers.ValidateHistogramDataPoint(point); 764if (!double.IsFinite(value) || !OtlpHelpers.TryValidateMetricExemplarTimestamp(exemplar, _otlpContext))
Otlp\Storage\SqliteTelemetryRepository.Traces.Reads.cs (3)
475context.TraceId.Length >= OtlpHelpers.ShortenedIdLength 478sql.Append(context.TraceId.Length >= OtlpHelpers.ShortenedIdLength 681var usePrefix = traceId.Length >= OtlpHelpers.ShortenedIdLength;
Otlp\Storage\SqliteTelemetryRepository.Traces.Writes.cs (6)
559var hasPeerAddress = OtlpHelpers.GetPeerAddress(span.Attributes) is not null; 931Kind = OtlpHelpers.ConvertSpanKind(span.Kind), 932StartTime = OtlpHelpers.UnixNanoSecondsToDateTime(span.StartTimeUnixNano), 933EndTime = OtlpHelpers.UnixNanoSecondsToDateTime(span.EndTimeUnixNano), 936Attributes = span.Attributes.ToKeyValuePairs(_otlpContext, filter: attribute => attribute.Key != OtlpHelpers.AspireDestinationNameAttribute), 949Time = OtlpHelpers.UnixNanoSecondsToDateTime(spanEvent.TimeUnixNano),
Aspire.Dashboard.Components.Tests (2)
Controls\PlotlyChartTests.cs (1)
74<b>Trace: {OtlpHelpers.ToShortenedId(first.TraceId.ToHexString())}</b><br />
tests\Shared\Telemetry\TelemetryTestHelpers.cs (1)
44return OtlpHelpers.ToHexString(id);
Aspire.Dashboard.Playwright.Tests (1)
tests\Shared\Telemetry\TelemetryTestHelpers.cs (1)
44return OtlpHelpers.ToHexString(id);
Aspire.Dashboard.Tests (35)
HistogramAllocationTests.cs (1)
38Assert.Equal(OtlpHelpers.UnixNanoSecondsToDateTime(point.TimeUnixNano), previous.End);
Model\ApplicationsSelectHelpersTests.cs (1)
380var key = OtlpHelpers.GetResourceKey(resource);
Model\TelemetryExportServiceTests.cs (7)
96Assert.Equal(OtlpHelpers.DateTimeToUnixNanoseconds(s_testTime), logRecord.TimeUnixNano); 138var logIdAttribute = Assert.Single(logRecord.Attributes, a => a.Key == OtlpHelpers.AspireLogIdAttribute); 332Assert.Equal(OtlpHelpers.DateTimeToUnixNanoseconds(s_testTime), span.StartTimeUnixNano); 333Assert.Equal(OtlpHelpers.DateTimeToUnixNanoseconds(s_testTime.AddSeconds(5)), span.EndTimeUnixNano); 432Assert.Contains(span.Attributes, a => a.Key == OtlpHelpers.AspireDestinationNameAttribute && a.Value?.StringValue == "target-service"); 476Assert.Contains(span.Attributes, a => a.Key == OtlpHelpers.AspireDestinationNameAttribute && a.Value?.StringValue == "target-service"); 515attribute => attribute.Key == OtlpHelpers.AspireDestinationNameAttribute && attribute.Value?.StringValue == "destination-replica-1");
Model\TelemetryImportServiceTests.cs (6)
383Assert.Contains(exportedLogRecord.Attributes!, a => a.Key == OtlpHelpers.AspireLogIdAttribute && a.Value?.StringValue == originalInternalId.ToString(CultureInfo.InvariantCulture)); 420Assert.DoesNotContain(importedLogs.Items[0].Attributes, a => a.Key == OtlpHelpers.AspireLogIdAttribute); 481var timeUnixNano = OtlpHelpers.DateTimeToUnixNanoseconds(s_testTime); 522var timeUnixNano = OtlpHelpers.DateTimeToUnixNanoseconds(s_testTime); 523var endTimeUnixNano = OtlpHelpers.DateTimeToUnixNanoseconds(s_testTime.AddSeconds(1)); 570var timeUnixNano = OtlpHelpers.DateTimeToUnixNanoseconds(s_testTime);
TelemetryRepositoryTests\HistogramTests.cs (1)
1411StartTime = OtlpHelpers.UnixNanoSecondsToDateTime(start),
TelemetryRepositoryTests\MetricsTests.cs (2)
330var end = OtlpHelpers.UnixNanoSecondsToDateTime(nanoSeconds); 2113var afterMaximum = OtlpHelpers.UnixNanoSecondsToDateTime((ulong)long.MaxValue).AddTicks(1);
TelemetryRepositoryTests\OtlpHelpersTests.cs (11)
25var s = OtlpHelpers.GetString(anyValue); 41var s = OtlpHelpers.GetString(anyValue); 54var s = OtlpHelpers.GetString(anyValue); 90var s = OtlpHelpers.GetString(anyValue); 153var s = OtlpHelpers.GetString(anyValue); 166OtlpHelpers.CopyKeyValuePairs( 193OtlpHelpers.CopyKeyValuePairs( 233OtlpHelpers.CopyKeyValuePairs( 277OtlpHelpers.CopyKeyValuePairs( 311OtlpHelpers.CopyKeyValuePairs( 352OtlpHelpers.CopyKeyValuePairs(
TelemetryRepositoryTests\ResourceTests.cs (4)
141var instance1Name = OtlpHelpers.GetResourceName(resources[0], resources); 142var instance2Name = OtlpHelpers.GetResourceName(resources[1], resources); 168var instance1Name = OtlpHelpers.GetResourceName(instance1, resources); 169var instance2Name = OtlpHelpers.GetResourceName(instance2, resources);
TelemetryRepositoryTests\TraceTests.cs (1)
36var result = OtlpHelpers.ConvertSpanKind(value);
tests\Shared\Telemetry\TelemetryTestHelpers.cs (1)
44return OtlpHelpers.ToHexString(id);