44 references to OtlpHelpers
aspire (33)
Commands\TelemetryCommandHelpers.cs (5)
491var matches = OtlpHelpers.ResolveResourceNameMatches(resourceName, ToOtlpResources(resources)); 547var text = displayText ?? OtlpHelpers.ToShortenedId(traceId); 642colorMap.ResolveAll(allResources.Select(r => OtlpHelpers.GetResourceName(r, allResources))); 646/// Resolves the display name for an OTLP resource using <see cref="OtlpHelpers.GetResourceName"/>, 657return OtlpHelpers.GetResourceName(otlpResource, allResources);
Commands\TelemetryLogsCommand.cs (3)
177Func<IOtlpResource, string> getResourceName = s => OtlpHelpers.GetResourceName(s, allResources); 202Func<IOtlpResource, string> getResourceName = s => OtlpHelpers.GetResourceName(s, allResources); 255? FormatHelpers.FormatConsoleTime(_timeProvider, OtlpHelpers.UnixNanoSecondsToDateTime(log.TimeUnixNano.Value))
Commands\TelemetrySpansCommand.cs (5)
169Func<IOtlpResource, string> getResourceName = s => OtlpHelpers.GetResourceName(s, allResources); 194Func<IOtlpResource, string> getResourceName = s => OtlpHelpers.GetResourceName(s, allResources); 256var duration = OtlpHelpers.CalculateDuration(span.StartTimeUnixNano, span.EndTimeUnixNano); 263? FormatHelpers.FormatConsoleTime(_timeProvider, OtlpHelpers.UnixNanoSecondsToDateTime(span.StartTimeUnixNano.Value)) 265var shortSpanId = OtlpHelpers.ToShortenedId(spanId);
Commands\TelemetryTracesCommand.cs (8)
162Func<IOtlpResource, string> getResourceName = s => OtlpHelpers.GetResourceName(s, allOtlpResources); 215Func<IOtlpResource, string> getResourceName = s => OtlpHelpers.GetResourceName(s, allOtlpResources); 262var duration = OtlpHelpers.CalculateDuration(span.StartTimeUnixNano, span.EndTimeUnixNano); 288? FormatHelpers.FormatConsoleTime(_timeProvider, OtlpHelpers.UnixNanoSecondsToDateTime(info.StartTimeNano.Value)) 290var shortTraceId = OtlpHelpers.ToShortenedId(info.TraceId); 319var duration = OtlpHelpers.CalculateDuration(span.StartTimeUnixNano, span.EndTimeUnixNano); 328var shortTraceId = OtlpHelpers.ToShortenedId(traceId); 404var shortenedSpanId = OtlpHelpers.ToShortenedId(span.SpanId);
Mcp\Tools\ListStructuredLogsTool.cs (1)
119getResourceName: s => OtlpHelpers.GetResourceName(s, resources.Select(r => new SimpleOtlpResource(r.Name, r.InstanceId)).ToList()),
Mcp\Tools\ListTracesTool.cs (1)
119getResourceName: s => OtlpHelpers.GetResourceName(s, resources.Select(r => new SimpleOtlpResource(r.Name, r.InstanceId)).ToList()),
Mcp\Tools\ListTraceStructuredLogsTool.cs (1)
109getResourceName: s => OtlpHelpers.GetResourceName(s, resources.Select(r => new SimpleOtlpResource(r.Name, r.InstanceId)).ToList()),
src\Shared\ConsoleLogs\SharedAIHelpers.cs (9)
223foreach (var attr in span.Attributes.Where(a => a.Key != OtlpHelpers.AspireDestinationNameAttribute)) 226attributesObj[attr.Key!] = context.AddValue(attrValue, id => $@"Duplicate of attribute ""{id.Key}"" for span {OtlpHelpers.ToShortenedId(id.SpanId)}", (SpanId: spanId, attr.Key)); 242var destination = GetAttributeStringValue(span.Attributes, OtlpHelpers.AspireDestinationNameAttribute); 252? OtlpHelpers.UnixNanoSecondsToDateTime(startNano) 261["name"] = context.AddValue(span.Name, sId => $@"Duplicate of ""name"" for span {OtlpHelpers.ToShortenedId(sId)}", spanId), 263["statusMessage"] = context.AddValue(span.Status?.Message, sId => $@"Duplicate of ""statusMessage"" for span {OtlpHelpers.ToShortenedId(sId)}", spanId), 397? OtlpHelpers.UnixNanoSecondsToDateTime(startNano) 672return attributes.Where(a => a.Key is not (ExceptionStackTraceField or ExceptionMessageField or ExceptionTypeField or OtlpHelpers.AspireLogIdAttribute)); 718var logIdString = GetAttributeStringValue(logEntry.LogRecord.Attributes, OtlpHelpers.AspireLogIdAttribute);
Aspire.Cli.Tests (11)
Commands\TelemetryCommandTests.cs (5)
82var result = OtlpHelpers.ToShortenedId("abc1234567890"); 90var result = OtlpHelpers.ToShortenedId("abc"); 98var dateTime = OtlpHelpers.UnixNanoSecondsToDateTime(1769860800123000000UL); 122var result = OtlpHelpers.CalculateDuration(start, end); 187var matches = OtlpHelpers.ResolveResourceNameMatches("API-1", resources);
Mcp\ExcludeFromMcpTests.cs (1)
481Attributes = [new OtlpKeyValueJson { Key = OtlpHelpers.AspireLogIdAttribute, Value = new OtlpAnyValueJson { IntValue = 1 } }]
Mcp\ListStructuredLogsToolTests.cs (5)
104new OtlpKeyValueJson { Key = OtlpHelpers.AspireLogIdAttribute, Value = new OtlpAnyValueJson { StringValue = "42" } }, 119new OtlpKeyValueJson { Key = OtlpHelpers.AspireLogIdAttribute, Value = new OtlpAnyValueJson { IntValue = 43 } } 133new OtlpKeyValueJson { Key = OtlpHelpers.AspireLogIdAttribute, Value = new OtlpAnyValueJson { IntValue = 44 } } 203Assert.False(firstLogAttributes.ContainsKey(OtlpHelpers.AspireLogIdAttribute), "aspire.log_id should be filtered from attributes"); 216Assert.False(secondLogAttributes.ContainsKey(OtlpHelpers.AspireLogIdAttribute), "aspire.log_id should be filtered from attributes");