-
Notifications
You must be signed in to change notification settings - Fork 283
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] Update to follow new DB span conventions #2229
[Instrumentation.SqlClient] Update to follow new DB span conventions #2229
Conversation
src/OpenTelemetry.Instrumentation.SqlClient/SqlClientTraceInstrumentationOptions.cs
Show resolved
Hide resolved
src/OpenTelemetry.Instrumentation.SqlClient/SqlClientTraceInstrumentationOptions.cs
Show resolved
Hide resolved
src/OpenTelemetry.Instrumentation.SqlClient/Implementation/SqlClientDiagnosticListener.cs
Show resolved
Hide resolved
src/OpenTelemetry.Instrumentation.SqlClient/SqlClientTraceInstrumentationOptions.cs
Show resolved
Hide resolved
if (!this.EnableConnectionLevelAttributes) | ||
{ | ||
sqlActivity.SetTag(SemanticConventions.AttributePeerService, dataSource); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This instrumentation should not be emitting peer.service
.
But just a reminder here... when peer.service
was removed from HTTP client instrumentation it was unexpected see #1761.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general LGTM.
Some todos/nits only.
@@ -115,15 +126,31 @@ public override void OnEventWritten(string name, object? payload) | |||
case CommandType.StoredProcedure: | |||
if (this.options.SetDbStatementForStoredProcedure) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before making this package stable, we should reconsider this feature flag name.
same for SetDbStatementForText
. It can be separate issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, all of the options will need to be reviewed before we ship stable. I lean toward only having one option for turning collection of db.query.text
on/off. These options are also related to the sanitization I'll implement with #2221. Rather than just on/off, these options may need to be something like: off, on w/ sanitization, and on w/o sanitization.
* **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 | ||
the `EnableConnectionLevelAttributes` option is enabled. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT: Can it be done as separate, tiny PR? With information that it is updating network sem conv to exact version?
It will be easier to follow changes for end-users.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With information that it is updating network sem conv to exact version?
What do you mean? Are you saying the changelog should reference the version of semantic conventions where these changes were introduced?
Fixes #2225
This PR is the first in a series of PRs. It introduces support for the
OTEL_SEMCONV_STABILITY_OPT_IN
environment variable to gate using the old or new conventions. It does not aim to fully adopt the new database conventions. It only updates conventions for the attributes currently reported by the instrumentation.The documentation in the readme still only refers to the old attributes. I will update the readme in a different PR.