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