Skip to content

Commit cc7eb70

Browse files
authored
[Instrumentation.EntityFrameworkCore] Stop emitting db.statement_type attribute (#1559)
1 parent 410ddc6 commit cc7eb70

File tree

4 files changed

+3
-5
lines changed

4 files changed

+3
-5
lines changed

src/OpenTelemetry.Instrumentation.EntityFrameworkCore/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
## Unreleased
44

5+
* **Breaking Change**: Stop emitting `db.statement_type` attribute.
6+
([#1559](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1559))
7+
58
## 1.0.0-beta.9
69

710
Released 2024-Jan-03

src/OpenTelemetry.Instrumentation.EntityFrameworkCore/Implementation/EntityFrameworkDiagnosticListener.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,6 @@ public override void OnCustom(string name, Activity? activity, object? payload)
194194
switch (commandType)
195195
{
196196
case CommandType.StoredProcedure:
197-
activity.AddTag(SpanAttributeConstants.DatabaseStatementTypeKey, nameof(CommandType.StoredProcedure));
198197
if (this.options.SetDbStatementForStoredProcedure)
199198
{
200199
activity.AddTag(AttributeDbStatement, commandText);
@@ -203,7 +202,6 @@ public override void OnCustom(string name, Activity? activity, object? payload)
203202
break;
204203

205204
case CommandType.Text:
206-
activity.AddTag(SpanAttributeConstants.DatabaseStatementTypeKey, nameof(CommandType.Text));
207205
if (this.options.SetDbStatementForText)
208206
{
209207
activity.AddTag(AttributeDbStatement, commandText);
@@ -212,7 +210,6 @@ public override void OnCustom(string name, Activity? activity, object? payload)
212210
break;
213211

214212
case CommandType.TableDirect:
215-
activity.AddTag(SpanAttributeConstants.DatabaseStatementTypeKey, nameof(CommandType.TableDirect));
216213
break;
217214
}
218215
}

src/Shared/SpanAttributeConstants.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ internal static class SpanAttributeConstants
1111
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
1212
public const string StatusCodeKey = "otel.status_code";
1313
public const string StatusDescriptionKey = "otel.status_description";
14-
public const string DatabaseStatementTypeKey = "db.statement_type";
1514

1615
#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member
1716
}

test/OpenTelemetry.Instrumentation.EntityFrameworkCore.Tests/EntityFrameworkDiagnosticListenerTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,6 @@ private static void VerifyActivityData(Activity activity, bool isError = false,
241241
Assert.DoesNotContain(activity.Tags, t => t.Key == EntityFrameworkDiagnosticListener.AttributePeerService);
242242

243243
Assert.Equal(altDisplayName ?? "main", activity.Tags.FirstOrDefault(t => t.Key == EntityFrameworkDiagnosticListener.AttributeDbName).Value);
244-
Assert.Equal(CommandType.Text.ToString(), activity.Tags.FirstOrDefault(t => t.Key == SpanAttributeConstants.DatabaseStatementTypeKey).Value);
245244

246245
if (!isError)
247246
{

0 commit comments

Comments
 (0)