34 references to OtlpHelpers
aspire (25)
Commands\TelemetryCommandHelpers.cs (1)
240var text = displayText ?? OtlpHelpers.ToShortenedId(traceId);
Commands\TelemetryLogsCommand.cs (1)
253var timestamp = OtlpHelpers.FormatNanoTimestamp(log.TimeUnixNano);
Commands\TelemetrySpansCommand.cs (2)
257var duration = OtlpHelpers.CalculateDuration(span.StartTimeUnixNano, span.EndTimeUnixNano); 263var shortSpanId = OtlpHelpers.ToShortenedId(spanId);
Commands\TelemetryTracesCommand.cs (3)
255var duration = OtlpHelpers.CalculateDuration(span.StartTimeUnixNano, span.EndTimeUnixNano); 301var duration = OtlpHelpers.CalculateDuration(span.StartTimeUnixNano, span.EndTimeUnixNano); 380var 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)
180var result = OtlpHelpers.ToShortenedId("abc1234567890"); 188var result = OtlpHelpers.ToShortenedId("abc"); 197var result = OtlpHelpers.FormatNanoTimestamp(nanoTimestamp); 220var 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");