diff --git a/CHANGELOG.md b/CHANGELOG.md index d7ae4d86c6..0445425997 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,9 +12,12 @@ This component adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.h - Added support for `Elastic.Transport` traces instrumentation 0.4.16+. `Elastic.Clients.Elasticsearch` 8.10.0+ traces instrumentation is covered by `Elastic.Transport` traces instrumentation. +- Added `telemetry.distro.name` resource attribute. The value is set to `opentelemetry-dotnet-instrumentation`. ### Changed +- Change telemetry resource attribute name from `telemetry.auto.version` to `telemetry.distro.version`. + #### Dependency updates - .NET Framework only, `Google.Protobuf` updated from `3.24.3` to `3.24.4`. diff --git a/src/OpenTelemetry.AutoInstrumentation/Configurations/ResourceConfigurator.cs b/src/OpenTelemetry.AutoInstrumentation/Configurations/ResourceConfigurator.cs index 6720c46958..26825848c2 100644 --- a/src/OpenTelemetry.AutoInstrumentation/Configurations/ResourceConfigurator.cs +++ b/src/OpenTelemetry.AutoInstrumentation/Configurations/ResourceConfigurator.cs @@ -33,7 +33,8 @@ public static ResourceBuilder CreateResourceBuilder(IReadOnlyList[] { - new(Constants.Tracer.AutoInstrumentationVersionName, AutoInstrumentationVersion.Version) + new(Constants.DistributionAttributes.TelemetryDistroNameAttributeName, Constants.DistributionAttributes.TelemetryDistroNameAttributeValue), + new(Constants.DistributionAttributes.TelemetryDistroVersionAttributeName, AutoInstrumentationVersion.Version) }); foreach (var enabledResourceDetector in enabledResourceDetectors) diff --git a/src/OpenTelemetry.AutoInstrumentation/Constants.cs b/src/OpenTelemetry.AutoInstrumentation/Constants.cs index 57a0770e10..68799945ba 100644 --- a/src/OpenTelemetry.AutoInstrumentation/Constants.cs +++ b/src/OpenTelemetry.AutoInstrumentation/Constants.cs @@ -18,9 +18,11 @@ namespace OpenTelemetry.AutoInstrumentation; internal static class Constants { - public static class Tracer + public static class DistributionAttributes { - public const string AutoInstrumentationVersionName = "telemetry.auto.version"; + public const string TelemetryDistroNameAttributeName = "telemetry.distro.name"; + public const string TelemetryDistroNameAttributeValue = "opentelemetry-dotnet-instrumentation"; + public const string TelemetryDistroVersionAttributeName = "telemetry.distro.version"; } public static class ConfigurationValues diff --git a/test/IntegrationTests/SmokeTests.cs b/test/IntegrationTests/SmokeTests.cs index 169feedd8f..21d42bc1ed 100644 --- a/test/IntegrationTests/SmokeTests.cs +++ b/test/IntegrationTests/SmokeTests.cs @@ -494,7 +494,8 @@ private static void ExpectResources(OtlpResourceExpector resourceExpector) resourceExpector.Expect("telemetry.sdk.name", "opentelemetry"); resourceExpector.Expect("telemetry.sdk.language", "dotnet"); resourceExpector.Expect("telemetry.sdk.version", typeof(OpenTelemetry.Resources.Resource).Assembly.GetCustomAttribute()!.InformationalVersion.Split('+')[0]); - resourceExpector.Expect("telemetry.auto.version", typeof(OpenTelemetry.AutoInstrumentation.Constants).Assembly.GetCustomAttribute()!.InformationalVersion.Split('+')[0]); + resourceExpector.Expect("telemetry.distro.name", "opentelemetry-dotnet-instrumentation"); + resourceExpector.Expect("telemetry.distro.version", typeof(OpenTelemetry.AutoInstrumentation.Constants).Assembly.GetCustomAttribute()!.InformationalVersion.Split('+')[0]); } private void VerifyTestApplicationInstrumented(TestAppStartupMode startupMode = TestAppStartupMode.Auto)