Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Instrumentation.SqlClient] Stop emitting db.statement_type attribute #5301

Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 2 additions & 0 deletions src/OpenTelemetry.Instrumentation.SqlClient/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
* **Breaking Change**: Renamed `SqlClientInstrumentationOptions` to
`SqlClientTraceInstrumentationOptions`.
([#5285](https://github.com/open-telemetry/opentelemetry-dotnet/pull/5285))
* Stop emitting `db.statement_type` attribute.
Kielek marked this conversation as resolved.
Show resolved Hide resolved
([#5301](https://github.com/open-telemetry/opentelemetry-dotnet/pull/5301))

## 1.6.0-beta.3

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ public override void OnEventWritten(string name, object payload)
switch (commandType)
{
case CommandType.StoredProcedure:
activity.SetTag(SpanAttributeConstants.DatabaseStatementTypeKey, nameof(CommandType.StoredProcedure));
if (this.options.SetDbStatementForStoredProcedure)
{
activity.SetTag(SemanticConventions.AttributeDbStatement, (string)commandText);
Expand All @@ -117,7 +116,6 @@ public override void OnEventWritten(string name, object payload)
break;

case CommandType.Text:
activity.SetTag(SpanAttributeConstants.DatabaseStatementTypeKey, nameof(CommandType.Text));
if (this.options.SetDbStatementForText)
{
activity.SetTag(SemanticConventions.AttributeDbStatement, (string)commandText);
Expand All @@ -126,7 +124,6 @@ public override void OnEventWritten(string name, object payload)
break;

case CommandType.TableDirect:
activity.SetTag(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 @@ -12,5 +12,4 @@ internal static class SpanAttributeConstants
{
public const string StatusCodeKey = "otel.status_code";
public const string StatusDescriptionKey = "otel.status_description";
public const string DatabaseStatementTypeKey = "db.statement_type";
}
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,6 @@ private static void VerifyActivityData(

Assert.Equal("master", activity.GetTagValue(SemanticConventions.AttributeDbName));

// "db.statement_type" is never set by the SqlEventSource instrumentation
Assert.Null(activity.GetTagValue(SpanAttributeConstants.DatabaseStatementTypeKey));
if (captureText)
{
Assert.Equal(commandText, activity.GetTagValue(SemanticConventions.AttributeDbStatement));
Expand Down
Loading