11 writes to Key
Aspire.Dashboard (5)
Model\TelemetryExportService.cs (5)
613
Key
= property.Key,
630
Key
= OtlpResource.SERVICE_NAME,
635
Key
= OtlpResource.SERVICE_INSTANCE_ID,
668
Key
= attributes[i].Key,
679
Key
= additionalAttributes[i].Key,
Aspire.Dashboard.Tests (6)
Model\TelemetryImportServiceTests.cs (6)
492
new OtlpKeyValueJson {
Key
= "service.name", Value = new OtlpAnyValueJson { StringValue = serviceName } },
493
new OtlpKeyValueJson {
Key
= "service.instance.id", Value = new OtlpAnyValueJson { StringValue = instanceId } }
537
new OtlpKeyValueJson {
Key
= "service.name", Value = new OtlpAnyValueJson { StringValue = serviceName } },
538
new OtlpKeyValueJson {
Key
= "service.instance.id", Value = new OtlpAnyValueJson { StringValue = instanceId } }
582
new OtlpKeyValueJson {
Key
= "service.name", Value = new OtlpAnyValueJson { StringValue = serviceName } },
583
new OtlpKeyValueJson {
Key
= "service.instance.id", Value = new OtlpAnyValueJson { StringValue = instanceId } }
19 references to Key
Aspire.Dashboard (4)
Otlp\Model\Serialization\OtlpJsonProtobufConverter.cs (2)
785
if (json.
Key
is not null)
787
kv.Key = json.
Key
;
src\Shared\Otlp\Serialization\OtlpResourceJson.cs (2)
44
if (attr.
Key
== "service.name" && attr.Value?.StringValue is not null)
65
if (attr.
Key
== "service.instance.id" && attr.Value?.StringValue is not null)
Aspire.Dashboard.Tests (15)
Model\TelemetryExportServiceTests.cs (14)
78
Assert.Contains(resourceLogs.Resource.Attributes, a => a.
Key
== OtlpResource.SERVICE_NAME && a.Value?.StringValue == "TestService");
79
Assert.Contains(resourceLogs.Resource.Attributes, a => a.
Key
== OtlpResource.SERVICE_INSTANCE_ID && a.Value?.StringValue == "instance-1");
100
Assert.Contains(logRecord.Attributes, a => a.
Key
== "custom.attr" && a.Value?.StringValue == "custom-value");
138
var logIdAttribute = Assert.Single(logRecord.Attributes, a => a.
Key
== OtlpHelpers.AspireLogIdAttribute);
315
Assert.Contains(resourceSpans.Resource.Attributes, a => a.
Key
== OtlpResource.SERVICE_NAME && a.Value?.StringValue == "TestService");
338
Assert.Contains(span.Attributes, a => a.
Key
== "http.method" && a.Value?.StringValue == "GET");
432
Assert.Contains(span.Attributes, a => a.
Key
== OtlpHelpers.AspireDestinationNameAttribute && a.Value?.StringValue == "target-service");
476
Assert.Contains(span.Attributes, a => a.
Key
== OtlpHelpers.AspireDestinationNameAttribute && a.Value?.StringValue == "target-service");
515
attribute => attribute.
Key
== OtlpHelpers.AspireDestinationNameAttribute && attribute.Value?.StringValue == "destination-replica-1");
576
Assert.Contains(resourceMetrics.Resource.Attributes, a => a.
Key
== OtlpResource.SERVICE_NAME && a.Value?.StringValue == "TestService");
577
Assert.Contains(resourceMetrics.Resource.Attributes, a => a.
Key
== "service.version" && a.Value?.StringValue == "1.2.3");
833
Assert.All(exportedLogs, log => Assert.Contains(log.Attributes!, attribute => attribute.
Key
== "log.index"));
884
Assert.All(exportedSpans, span => Assert.Contains(span.Attributes!, attribute => attribute.
Key
== "trace.index"));
1027
var japaneseAttr = Assert.Single(logRecord.Attributes, a => a.
Key
== "japanese.attr");
Model\TelemetryImportServiceTests.cs (1)
383
Assert.Contains(exportedLogRecord.Attributes!, a => a.
Key
== OtlpHelpers.AspireLogIdAttribute && a.Value?.StringValue == originalInternalId.ToString(CultureInfo.InvariantCulture));