Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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;
}
}
Expand Down
1 change: 0 additions & 1 deletion src/Shared/SpanAttributeConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down