-
Notifications
You must be signed in to change notification settings - Fork 887
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
Use low cardinality names for database spans #341
Comments
Based on discussion in SIG meeting today, let's proceed with this:
|
I have some changes for this issue, but have a couple of quick questions.
|
I agree, the SQL scrubbing brings this in alignment with the prepared statement implementation. I'll pull down those latest changes and test them in our environments. Up to you folk but I see no further need for this ticket then. Thanks. |
Great, I'm going to close it then 😄. |
Just for historical record. Otel spec (https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/semantic_conventions/database.md) says the following: "Span name should be set to low cardinality value representing the statement executed on the database". So we have to use sql statement for spans. |
Currently, in some cases database spans use the SQL statement as the span name. This creates a couple of issues:
db.statement
, mutating a primary index like span nameTo clarify, SQL templates without variables may work well as a span name. The spec currently recommends using SQL templates when available. But, when a template is not available, we should fall back to a low cardinality option.
Spec details: https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/semantic_conventions/database.md
The current spec is vague about what to use in place of a template. The suggestion I have heard requested the most is to use the SQL Command (SELECT, INSERT, UPDATE, etc). If it is easy enough to switch, I would suggest this option for now. Otherwise, falling back to the
db.instance
value would be sufficient.The text was updated successfully, but these errors were encountered: