44 references to OtlpHelpers
aspire (33)
Commands\TelemetryCommandHelpers.cs (5)
544var matches = OtlpHelpers.ResolveResourceNameMatches(resourceName, ToOtlpResources(resources)); 600var text = displayText ?? OtlpHelpers.ToShortenedId(traceId); 751colorMap.ResolveAll(allResources.Select(r => OtlpHelpers.GetResourceName(r, allResources))); 755/// Resolves the display name for an OTLP resource using <see cref="OtlpHelpers.GetResourceName"/>, 766return 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)
172Func<IOtlpResource, string> getResourceName = s => OtlpHelpers.GetResourceName(s, allResources); 197Func<IOtlpResource, string> getResourceName = s => OtlpHelpers.GetResourceName(s, allResources); 259var duration = OtlpHelpers.CalculateDuration(span.StartTimeUnixNano, span.EndTimeUnixNano); 266? FormatHelpers.FormatConsoleTime(_timeProvider, OtlpHelpers.UnixNanoSecondsToDateTime(span.StartTimeUnixNano.Value)) 268var shortSpanId = OtlpHelpers.ToShortenedId(spanId);
Commands\TelemetryTracesCommand.cs (8)
166Func<IOtlpResource, string> getResourceName = s => OtlpHelpers.GetResourceName(s, allOtlpResources); 221Func<IOtlpResource, string> getResourceName = s => OtlpHelpers.GetResourceName(s, allOtlpResources); 268var duration = OtlpHelpers.CalculateDuration(span.StartTimeUnixNano, span.EndTimeUnixNano); 294? FormatHelpers.FormatConsoleTime(_timeProvider, OtlpHelpers.UnixNanoSecondsToDateTime(info.StartTimeNano.Value)) 296var shortTraceId = OtlpHelpers.ToShortenedId(info.TraceId); 325var duration = OtlpHelpers.CalculateDuration(span.StartTimeUnixNano, span.EndTimeUnixNano); 334var shortTraceId = OtlpHelpers.ToShortenedId(traceId); 410var shortenedSpanId = OtlpHelpers.ToShortenedId(span.SpanId);
Mcp\Tools\ListStructuredLogsTool.cs (1)
120getResourceName: s => OtlpHelpers.GetResourceName(s, resources.Select(r => new SimpleOtlpResource(r.Name, r.InstanceId)).ToList()),
Mcp\Tools\ListTracesTool.cs (1)
120getResourceName: s => OtlpHelpers.GetResourceName(s, resources.Select(r => new SimpleOtlpResource(r.Name, r.InstanceId)).ToList()),
Mcp\Tools\ListTraceStructuredLogsTool.cs (1)
110getResourceName: 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)
91var result = OtlpHelpers.ToShortenedId("abc1234567890"); 99var result = OtlpHelpers.ToShortenedId("abc"); 107var dateTime = OtlpHelpers.UnixNanoSecondsToDateTime(1769860800123000000UL); 131var result = OtlpHelpers.CalculateDuration(start, end); 196var matches = OtlpHelpers.ResolveResourceNameMatches("API-1", resources);
Mcp\ExcludeFromMcpTests.cs (1)
515Attributes = [new OtlpKeyValueJson { Key = OtlpHelpers.AspireLogIdAttribute, Value = new OtlpAnyValueJson { IntValue = 1 } }]
Mcp\ListStructuredLogsToolTests.cs (5)
216new OtlpKeyValueJson { Key = OtlpHelpers.AspireLogIdAttribute, Value = new OtlpAnyValueJson { StringValue = "42" } }, 231new OtlpKeyValueJson { Key = OtlpHelpers.AspireLogIdAttribute, Value = new OtlpAnyValueJson { IntValue = 43 } } 245new OtlpKeyValueJson { Key = OtlpHelpers.AspireLogIdAttribute, Value = new OtlpAnyValueJson { IntValue = 44 } } 315Assert.False(firstLogAttributes.ContainsKey(OtlpHelpers.AspireLogIdAttribute), "aspire.log_id should be filtered from attributes"); 328Assert.False(secondLogAttributes.ContainsKey(OtlpHelpers.AspireLogIdAttribute), "aspire.log_id should be filtered from attributes");