12 writes to Key
Aspire.Dashboard (6)
Model\TelemetryExportService.cs (5)
622
Key
= OtlpResource.SERVICE_NAME,
627
Key
= OtlpResource.SERVICE_INSTANCE_ID,
637
Key
= property.Key,
674
Key
= attributes[i].Key,
685
Key
= additionalAttributes[i].Key,
OtlpJsonSerializerContext.OtlpKeyValueJson.g.cs (1)
59
Setter = static (obj, value) => ((global::Aspire.Otlp.Serialization.OtlpKeyValueJson)obj).
Key
= value!,
Aspire.Dashboard.Tests (6)
Model\TelemetryImportServiceTests.cs (6)
439
new OtlpKeyValueJson {
Key
= "service.name", Value = new OtlpAnyValueJson { StringValue = serviceName } },
440
new OtlpKeyValueJson {
Key
= "service.instance.id", Value = new OtlpAnyValueJson { StringValue = instanceId } }
484
new OtlpKeyValueJson {
Key
= "service.name", Value = new OtlpAnyValueJson { StringValue = serviceName } },
485
new OtlpKeyValueJson {
Key
= "service.instance.id", Value = new OtlpAnyValueJson { StringValue = instanceId } }
529
new OtlpKeyValueJson {
Key
= "service.name", Value = new OtlpAnyValueJson { StringValue = serviceName } },
530
new OtlpKeyValueJson {
Key
= "service.instance.id", Value = new OtlpAnyValueJson { StringValue = instanceId } }
24 references to Key
Aspire.Dashboard (13)
Otlp\Model\Serialization\OtlpJsonProtobufConverter.cs (2)
785
if (json.
Key
is not null)
787
kv.Key = json.
Key
;
OtlpJsonSerializerContext.OtlpKeyValueJson.g.cs (2)
58
Getter = static obj => ((global::Aspire.Otlp.Serialization.OtlpKeyValueJson)obj).
Key
,
106
string __value_Key = ((global::Aspire.Otlp.Serialization.OtlpKeyValueJson)value).
Key
;
src\Shared\ConsoleLogs\SharedAIHelpers.cs (8)
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
));
294
var key = attribute.
Key
;
499
if (attr.
Key
== key)
536
return attributes.Where(a => a.
Key
is not (ExceptionStackTraceField or ExceptionMessageField or ExceptionTypeField or OtlpHelpers.AspireLogIdAttribute));
588
attributesObject[attr.
Key
!] = context.AddValue(attrValue, id => $@"Duplicate of attribute ""{id.Key}"" for log entry {id.LogId}", (LogId: logId, attr.
Key
));
src\Shared\Otlp\Serialization\OtlpResourceJson.cs (1)
44
if (attr.
Key
== "service.name" && attr.Value?.StringValue is not null)
Aspire.Dashboard.Tests (11)
Model\TelemetryExportServiceTests.cs (10)
70
Assert.Contains(resourceLogs.Resource.Attributes, a => a.
Key
== OtlpResource.SERVICE_NAME && a.Value?.StringValue == "TestService");
71
Assert.Contains(resourceLogs.Resource.Attributes, a => a.
Key
== OtlpResource.SERVICE_INSTANCE_ID && a.Value?.StringValue == "instance-1");
92
Assert.Contains(logRecord.Attributes, a => a.
Key
== "custom.attr" && a.Value?.StringValue == "custom-value");
129
var logIdAttribute = Assert.Single(logRecord.Attributes, a => a.
Key
== OtlpHelpers.AspireLogIdAttribute);
304
Assert.Contains(resourceSpans.Resource.Attributes, a => a.
Key
== OtlpResource.SERVICE_NAME && a.Value?.StringValue == "TestService");
327
Assert.Contains(span.Attributes, a => a.
Key
== "http.method" && a.Value?.StringValue == "GET");
419
Assert.Contains(span.Attributes, a => a.
Key
== OtlpHelpers.AspireDestinationNameAttribute && a.Value?.StringValue == "target-service");
462
Assert.DoesNotContain(span.Attributes, a => a.
Key
== OtlpHelpers.AspireDestinationNameAttribute);
519
Assert.Contains(resourceMetrics.Resource.Attributes, a => a.
Key
== OtlpResource.SERVICE_NAME && a.Value?.StringValue == "TestService");
864
var japaneseAttr = Assert.Single(logRecord.Attributes, a => a.
Key
== "japanese.attr");
Model\TelemetryImportServiceTests.cs (1)
349
Assert.Contains(exportedLogRecord.Attributes!, a => a.
Key
== OtlpHelpers.AspireLogIdAttribute && a.Value?.StringValue == originalInternalId.ToString(CultureInfo.InvariantCulture));