diff --git a/src/OpenTelemetry.Instrumentation.SqlClient/CHANGELOG.md b/src/OpenTelemetry.Instrumentation.SqlClient/CHANGELOG.md index a07be3094d7..3faea563a6b 100644 --- a/src/OpenTelemetry.Instrumentation.SqlClient/CHANGELOG.md +++ b/src/OpenTelemetry.Instrumentation.SqlClient/CHANGELOG.md @@ -2,6 +2,9 @@ ## Unreleased +* `ActivitySource.Version` is set to NuGet package version. + ([#5498](https://github.com/open-telemetry/opentelemetry-dotnet/pull/5498)) + ## 1.7.0-beta.1 Released 2024-Feb-09 diff --git a/src/OpenTelemetry.Instrumentation.SqlClient/Implementation/SqlActivitySourceHelper.cs b/src/OpenTelemetry.Instrumentation.SqlClient/Implementation/SqlActivitySourceHelper.cs index 287ee0d6dc0..f851ac41b22 100644 --- a/src/OpenTelemetry.Instrumentation.SqlClient/Implementation/SqlActivitySourceHelper.cs +++ b/src/OpenTelemetry.Instrumentation.SqlClient/Implementation/SqlActivitySourceHelper.cs @@ -17,8 +17,7 @@ internal sealed class SqlActivitySourceHelper public static readonly AssemblyName AssemblyName = typeof(SqlActivitySourceHelper).Assembly.GetName(); public static readonly string ActivitySourceName = AssemblyName.Name; - public static readonly Version Version = AssemblyName.Version; - public static readonly ActivitySource ActivitySource = new(ActivitySourceName, Version.ToString()); + public static readonly ActivitySource ActivitySource = new(ActivitySourceName, SignalVersionHelper.GetVersion()); public static readonly string ActivityName = ActivitySourceName + ".Execute"; public static readonly IEnumerable> CreationTags = new[] diff --git a/src/OpenTelemetry.Instrumentation.SqlClient/OpenTelemetry.Instrumentation.SqlClient.csproj b/src/OpenTelemetry.Instrumentation.SqlClient/OpenTelemetry.Instrumentation.SqlClient.csproj index 09d8a5782f6..c7f8d143c9b 100644 --- a/src/OpenTelemetry.Instrumentation.SqlClient/OpenTelemetry.Instrumentation.SqlClient.csproj +++ b/src/OpenTelemetry.Instrumentation.SqlClient/OpenTelemetry.Instrumentation.SqlClient.csproj @@ -13,6 +13,7 @@ +