Skip to content

[sql] Parse db.operation.name and db.collection.name from db.query.text #2222

@alanwest

Description

@alanwest

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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions