opentelemetry-dotnet-contrib
opentelemetry-dotnet-contrib copied to clipboard
[sql] Parse `db.operation.name` and `db.collection.name` from `db.query.text`
Component
OpenTelemetry.Instrumentation.SqlClient
What is the expected behavior?
The attributes db.operation.name
and db.collection.name
are conditionally required "if readily available".
Alternatively, they MAY be parsed from db.query.text
. See relevant footnotes.
[3]: If readily available. The collection name MAY be parsed from the query text, in which case it SHOULD be the first collection name found in the query. [6]: If readily available. The operation name MAY be parsed from the query text, in which case it SHOULD be the first operation name found in the query.
These attributes are very valuable to end users.
Parsing db.query.text
is a costly operation. What this issue does not attempt to address is whether parsing operation/collection from db.query.text
should be on by default. For now, it should be implemented as opt-in, though later we should decide whether it should be on by default.