-
Notifications
You must be signed in to change notification settings - Fork 302
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
SqlClient db metrics #2026
SqlClient db metrics #2026
Conversation
This PR was marked stale due to lack of activity. It will be closed in 7 days. |
src/OpenTelemetry.Instrumentation.SqlClient/Implementation/SqlActivitySourceHelper.cs
Outdated
Show resolved
Hide resolved
src/OpenTelemetry.Instrumentation.SqlClient/Implementation/SqlClientDiagnosticListener.cs
Outdated
Show resolved
Hide resolved
src/OpenTelemetry.Instrumentation.SqlClient/Implementation/SqlClientDiagnosticListener.cs
Outdated
Show resolved
Hide resolved
This PR was marked stale due to lack of activity. It will be closed in 7 days. |
This PR was marked stale due to lack of activity. It will be closed in 7 days. |
This PR was marked stale due to lack of activity. It will be closed in 7 days. |
{ | ||
if (this.exceptionFetcher.TryFetch(payload, out Exception? exception) && exception != null) | ||
{ | ||
tags.Add(SemanticConventions.AttributeErrorType, exception.Message); |
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.
the message has high cardinality, this should be the full name of the exception type.
We also added db.response.status_code
recently - ptal at some details on how to capture it
https://github.com/open-telemetry/semantic-conventions/blob/v1.28.0/docs/database/sql.md
{ | ||
if (hasError) | ||
{ | ||
var exceptionType = activity.Tags.SingleOrDefault(t => t.Key == SemanticConventions.AttributeExceptionType); |
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.
The exception.type
attribute is currently never set on the activity because it is a new attribute and the trace instrumentation has not yet been adapted to the new conventions.
Was your plan to update the trace instrumentation to follow the new conventions in this PR? Or were you looking to split the work up some how?
|
||
if (!string.IsNullOrEmpty(connectionDetails.Port)) | ||
{ | ||
// TODO: Should we continue to emit this if the default port (1433) is being used? |
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.
No, it should not be set if it is the default. See the following footnote from the conventions
[11]: If using a port other than the default port for this DBMS and if server.address is set.
This PR was marked stale due to lack of activity. It will be closed in 7 days. |
Closed as inactive. Feel free to reopen if this PR is still being worked on. |
Changes
Opening draft PR for feedback.
Some TODOs, including flaky tests, likely due to state.
Merge requirement checklist
CHANGELOG.md
files updated for non-trivial changes