41 references to OtlpHelpers
aspire (32)
Commands\TelemetryCommandHelpers.cs (5)
244var text = displayText ?? OtlpHelpers.ToShortenedId(traceId); 321/// Converts an array of <see cref="ResourceInfoJson"/> to a list of <see cref="IOtlpResource"/> for use with <see cref="OtlpHelpers.GetResourceName"/>. 339colorMap.ResolveAll(allResources.Select(r => OtlpHelpers.GetResourceName(r, allResources))); 343/// Resolves the display name for an OTLP resource using <see cref="OtlpHelpers.GetResourceName"/>, 354return OtlpHelpers.GetResourceName(otlpResource, allResources);
Commands\TelemetryLogsCommand.cs (1)
266? FormatHelpers.FormatConsoleTime(_timeProvider, OtlpHelpers.UnixNanoSecondsToDateTime(log.TimeUnixNano.Value))
Commands\TelemetrySpansCommand.cs (3)
275var duration = OtlpHelpers.CalculateDuration(span.StartTimeUnixNano, span.EndTimeUnixNano); 282? FormatHelpers.FormatConsoleTime(_timeProvider, OtlpHelpers.UnixNanoSecondsToDateTime(span.StartTimeUnixNano.Value)) 284var shortSpanId = OtlpHelpers.ToShortenedId(spanId);
Commands\TelemetryTracesCommand.cs (5)
275var duration = OtlpHelpers.CalculateDuration(span.StartTimeUnixNano, span.EndTimeUnixNano); 301? FormatHelpers.FormatConsoleTime(_timeProvider, OtlpHelpers.UnixNanoSecondsToDateTime(info.StartTimeNano.Value)) 303var shortTraceId = OtlpHelpers.ToShortenedId(info.TraceId); 331var duration = OtlpHelpers.CalculateDuration(span.StartTimeUnixNano, span.EndTimeUnixNano); 411var shortenedSpanId = OtlpHelpers.ToShortenedId(span.SpanId);
Mcp\Tools\ListStructuredLogsTool.cs (1)
85getResourceName: s => OtlpHelpers.GetResourceName(s, resources.Select(r => new SimpleOtlpResource(r.Name, r.InstanceId)).ToList()),
Mcp\Tools\ListTracesTool.cs (1)
85getResourceName: s => OtlpHelpers.GetResourceName(s, resources.Select(r => new SimpleOtlpResource(r.Name, r.InstanceId)).ToList()),
Mcp\Tools\ListTraceStructuredLogsTool.cs (1)
85getResourceName: s => OtlpHelpers.GetResourceName(s, resources.Select(r => new SimpleOtlpResource(r.Name, r.InstanceId)).ToList()),
src\Shared\ConsoleLogs\SharedAIHelpers.cs (15)
221foreach (var attr in span.Attributes.Where(a => a.Key != OtlpHelpers.AspireDestinationNameAttribute)) 224attributesObj[attr.Key!] = context.AddValue(attrValue, id => $@"Duplicate of attribute ""{id.Key}"" for span {OtlpHelpers.ToShortenedId(id.SpanId)}", (SpanId: spanId, attr.Key)); 233["trace_id"] = OtlpHelpers.ToShortenedId(link.TraceId ?? string.Empty), 234["span_id"] = OtlpHelpers.ToShortenedId(link.SpanId ?? string.Empty) 240var destination = GetAttributeStringValue(span.Attributes, OtlpHelpers.AspireDestinationNameAttribute); 251["span_id"] = OtlpHelpers.ToShortenedId(spanId), 252["parent_span_id"] = span.ParentSpanId is { } id ? OtlpHelpers.ToShortenedId(id) : null, 254["name"] = context.AddValue(span.Name, sId => $@"Duplicate of ""name"" for span {OtlpHelpers.ToShortenedId(sId)}", spanId), 256["status_message"] = context.AddValue(span.Status?.Message, sId => $@"Duplicate of ""status_message"" for span {OtlpHelpers.ToShortenedId(sId)}", spanId), 267var traceId = OtlpHelpers.ToShortenedId(trace.TraceId); 271? OtlpHelpers.UnixNanoSecondsToDateTime(startNano) 536return attributes.Where(a => a.Key is not (ExceptionStackTraceField or ExceptionMessageField or ExceptionTypeField or OtlpHelpers.AspireLogIdAttribute)); 580var logIdString = GetAttributeStringValue(logEntry.LogRecord.Attributes, OtlpHelpers.AspireLogIdAttribute); 595["span_id"] = OtlpHelpers.ToShortenedId(logEntry.LogRecord.SpanId ?? string.Empty), 596["trace_id"] = OtlpHelpers.ToShortenedId(logEntry.LogRecord.TraceId ?? string.Empty),
Aspire.Cli.Tests (9)
Commands\TelemetryCommandTests.cs (4)
83var result = OtlpHelpers.ToShortenedId("abc1234567890"); 91var result = OtlpHelpers.ToShortenedId("abc"); 99var dateTime = OtlpHelpers.UnixNanoSecondsToDateTime(1769860800123000000UL); 123var result = OtlpHelpers.CalculateDuration(start, end);
Mcp\ListStructuredLogsToolTests.cs (5)
105new OtlpKeyValueJson { Key = OtlpHelpers.AspireLogIdAttribute, Value = new OtlpAnyValueJson { StringValue = "42" } }, 120new OtlpKeyValueJson { Key = OtlpHelpers.AspireLogIdAttribute, Value = new OtlpAnyValueJson { IntValue = 43 } } 134new OtlpKeyValueJson { Key = OtlpHelpers.AspireLogIdAttribute, Value = new OtlpAnyValueJson { IntValue = 44 } } 204Assert.False(firstLogAttributes.ContainsKey(OtlpHelpers.AspireLogIdAttribute), "aspire.log_id should be filtered from attributes"); 220Assert.False(secondLogAttributes.ContainsKey(OtlpHelpers.AspireLogIdAttribute), "aspire.log_id should be filtered from attributes");