34 references to OtlpHelpers
aspire (25)
Commands\TelemetryCommandHelpers.cs (1)
240
var text = displayText ??
OtlpHelpers
.ToShortenedId(traceId);
Commands\TelemetryLogsCommand.cs (1)
253
var timestamp =
OtlpHelpers
.FormatNanoTimestamp(log.TimeUnixNano);
Commands\TelemetrySpansCommand.cs (2)
257
var duration =
OtlpHelpers
.CalculateDuration(span.StartTimeUnixNano, span.EndTimeUnixNano);
263
var shortSpanId =
OtlpHelpers
.ToShortenedId(spanId);
Commands\TelemetryTracesCommand.cs (3)
255
var duration =
OtlpHelpers
.CalculateDuration(span.StartTimeUnixNano, span.EndTimeUnixNano);
301
var duration =
OtlpHelpers
.CalculateDuration(span.StartTimeUnixNano, span.EndTimeUnixNano);
380
var shortenedSpanId =
OtlpHelpers
.ToShortenedId(span.SpanId);
Mcp\Tools\ListStructuredLogsTool.cs (1)
85
getResourceName: s =>
OtlpHelpers
.GetResourceName(s, resources.Select(r => new SimpleOtlpResource(r.Name, r.InstanceId)).ToList()),
Mcp\Tools\ListTracesTool.cs (1)
85
getResourceName: s =>
OtlpHelpers
.GetResourceName(s, resources.Select(r => new SimpleOtlpResource(r.Name, r.InstanceId)).ToList()),
Mcp\Tools\ListTraceStructuredLogsTool.cs (1)
85
getResourceName: s =>
OtlpHelpers
.GetResourceName(s, resources.Select(r => new SimpleOtlpResource(r.Name, r.InstanceId)).ToList()),
src\Shared\ConsoleLogs\SharedAIHelpers.cs (15)
221
foreach (var attr in span.Attributes.Where(a => a.Key !=
OtlpHelpers
.AspireDestinationNameAttribute))
224
attributesObj[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)
240
var 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),
267
var traceId =
OtlpHelpers
.ToShortenedId(trace.TraceId);
271
?
OtlpHelpers
.UnixNanoSecondsToDateTime(startNano)
536
return attributes.Where(a => a.Key is not (ExceptionStackTraceField or ExceptionMessageField or ExceptionTypeField or
OtlpHelpers
.AspireLogIdAttribute));
580
var 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)
180
var result =
OtlpHelpers
.ToShortenedId("abc1234567890");
188
var result =
OtlpHelpers
.ToShortenedId("abc");
197
var result =
OtlpHelpers
.FormatNanoTimestamp(nanoTimestamp);
220
var result =
OtlpHelpers
.CalculateDuration(start, end);
Mcp\ListStructuredLogsToolTests.cs (5)
105
new OtlpKeyValueJson { Key =
OtlpHelpers
.AspireLogIdAttribute, Value = new OtlpAnyValueJson { StringValue = "42" } },
120
new OtlpKeyValueJson { Key =
OtlpHelpers
.AspireLogIdAttribute, Value = new OtlpAnyValueJson { IntValue = 43 } }
134
new OtlpKeyValueJson { Key =
OtlpHelpers
.AspireLogIdAttribute, Value = new OtlpAnyValueJson { IntValue = 44 } }
204
Assert.False(firstLogAttributes.ContainsKey(
OtlpHelpers
.AspireLogIdAttribute), "aspire.log_id should be filtered from attributes");
220
Assert.False(secondLogAttributes.ContainsKey(
OtlpHelpers
.AspireLogIdAttribute), "aspire.log_id should be filtered from attributes");