diff --git a/src/OpenTelemetry.Instrumentation.EntityFrameworkCore/CHANGELOG.md b/src/OpenTelemetry.Instrumentation.EntityFrameworkCore/CHANGELOG.md index 77d8c86da5..155c2bd5c3 100644 --- a/src/OpenTelemetry.Instrumentation.EntityFrameworkCore/CHANGELOG.md +++ b/src/OpenTelemetry.Instrumentation.EntityFrameworkCore/CHANGELOG.md @@ -2,6 +2,9 @@ ## Unreleased +* **Breaking Change**: Stop emitting `db.statement_type` attribute. + ([#1559](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1559)) + ## 1.0.0-beta.9 Released 2024-Jan-03 diff --git a/src/OpenTelemetry.Instrumentation.EntityFrameworkCore/Implementation/EntityFrameworkDiagnosticListener.cs b/src/OpenTelemetry.Instrumentation.EntityFrameworkCore/Implementation/EntityFrameworkDiagnosticListener.cs index d53a1edefc..b0392ff40d 100644 --- a/src/OpenTelemetry.Instrumentation.EntityFrameworkCore/Implementation/EntityFrameworkDiagnosticListener.cs +++ b/src/OpenTelemetry.Instrumentation.EntityFrameworkCore/Implementation/EntityFrameworkDiagnosticListener.cs @@ -194,7 +194,6 @@ public override void OnCustom(string name, Activity? activity, object? payload) switch (commandType) { case CommandType.StoredProcedure: - activity.AddTag(SpanAttributeConstants.DatabaseStatementTypeKey, nameof(CommandType.StoredProcedure)); if (this.options.SetDbStatementForStoredProcedure) { activity.AddTag(AttributeDbStatement, commandText); @@ -203,7 +202,6 @@ public override void OnCustom(string name, Activity? activity, object? payload) break; case CommandType.Text: - activity.AddTag(SpanAttributeConstants.DatabaseStatementTypeKey, nameof(CommandType.Text)); if (this.options.SetDbStatementForText) { activity.AddTag(AttributeDbStatement, commandText); @@ -212,7 +210,6 @@ public override void OnCustom(string name, Activity? activity, object? payload) break; case CommandType.TableDirect: - activity.AddTag(SpanAttributeConstants.DatabaseStatementTypeKey, nameof(CommandType.TableDirect)); break; } } diff --git a/src/Shared/SpanAttributeConstants.cs b/src/Shared/SpanAttributeConstants.cs index 4d0f6dfa53..9c21fb3bf2 100644 --- a/src/Shared/SpanAttributeConstants.cs +++ b/src/Shared/SpanAttributeConstants.cs @@ -11,7 +11,6 @@ internal static class SpanAttributeConstants #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member public const string StatusCodeKey = "otel.status_code"; public const string StatusDescriptionKey = "otel.status_description"; - public const string DatabaseStatementTypeKey = "db.statement_type"; #pragma warning restore CS1591 // Missing XML comment for publicly visible type or member } diff --git a/test/OpenTelemetry.Instrumentation.EntityFrameworkCore.Tests/EntityFrameworkDiagnosticListenerTests.cs b/test/OpenTelemetry.Instrumentation.EntityFrameworkCore.Tests/EntityFrameworkDiagnosticListenerTests.cs index 0f6c7fc0e6..80a72fa847 100644 --- a/test/OpenTelemetry.Instrumentation.EntityFrameworkCore.Tests/EntityFrameworkDiagnosticListenerTests.cs +++ b/test/OpenTelemetry.Instrumentation.EntityFrameworkCore.Tests/EntityFrameworkDiagnosticListenerTests.cs @@ -241,7 +241,6 @@ private static void VerifyActivityData(Activity activity, bool isError = false, Assert.DoesNotContain(activity.Tags, t => t.Key == EntityFrameworkDiagnosticListener.AttributePeerService); Assert.Equal(altDisplayName ?? "main", activity.Tags.FirstOrDefault(t => t.Key == EntityFrameworkDiagnosticListener.AttributeDbName).Value); - Assert.Equal(CommandType.Text.ToString(), activity.Tags.FirstOrDefault(t => t.Key == SpanAttributeConstants.DatabaseStatementTypeKey).Value); if (!isError) {