Skip to content

Commit

Permalink
Merge branch 'main' into alanwest/sql-errors
Browse files Browse the repository at this point in the history
  • Loading branch information
alanwest authored Oct 31, 2024
2 parents 35f20b7 + d4b2e61 commit 43bc9c4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/OpenTelemetry.Instrumentation.SqlClient/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
[spans](https://github.com/open-telemetry/semantic-conventions/blob/v1.28.0/docs/database/database-spans.md).
([#2229](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/2229),
[#2277](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/2277),
[#2262](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/2262))
[#2262](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/2262),
[#2279](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/2279))
* **Breaking change**: The `peer.service` and `server.socket.address` attributes
are no longer emitted. Users should rely on the `server.address` attribute
for the same information. Note that `server.address` is only included when
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ public override void OnEventWritten(string name, object? payload)

if (this.options.EmitNewAttributes)
{
activity.SetTag(SemanticConventions.AttributeDbOperationName, "EXECUTE");
activity.SetTag(SemanticConventions.AttributeDbCollectionName, commandText);
activity.SetTag(SemanticConventions.AttributeDbQueryText, commandText);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,8 @@ internal static void VerifyActivityData(

if (emitNewAttributes)
{
Assert.Equal("EXECUTE", activity.GetTagValue(SemanticConventions.AttributeDbOperationName));
Assert.Equal(commandText, activity.GetTagValue(SemanticConventions.AttributeDbCollectionName));
Assert.Equal(commandText, activity.GetTagValue(SemanticConventions.AttributeDbQueryText));
}
}
Expand Down

0 comments on commit 43bc9c4

Please sign in to comment.