Skip to content
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

Update database span name: clarify target and remove fallback #1069

Merged
merged 7 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .chloggen/1069.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
change_type: enhancement

component: db

note: 'Update database span name: clarify that target depends on the operation and should not be set when corresponding data is not available.'

issues: [1045]
15 changes: 10 additions & 5 deletions docs/database/database-spans.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,19 @@ If there is no (low-cardinality) `db.operation.name` available, database span na
SHOULD be [`{target}`](#target-placeholder).
<!-- markdown-link-check-enable -->

If neither `db.operation.name` nor `{target}` are available, span name SHOULD be `db.system`.
lmolkova marked this conversation as resolved.
Show resolved Hide resolved

Semantic conventions for individual database systems MAY specify different span name format.

The <span id="target-placeholder">`{target}`</span> SHOULD adhere to one of the following values, arranged in prioritized order, provided they are accessible:
The <span id="target-placeholder">`{target}`</span> SHOULD describe the entity that the operation is performed against
and SHOULD adhere to one of the following values, provided they are accessible:

- `db.collection.name` SHOULD be used for data manipulation operations or operations on database collections.
- `db.namespace` SHOULD be used only for operations on a specific database namespace.
- `server.address:server.port` SHOULD be used for other operations not targeting any specific database(s) or collection(s)

- `db.collection.name`
- `db.namespace`
- `server.address:server.port`
- `db.system`
If a corresponding `{target}` value is not available for a specific operation, the instrumentation SHOULD NOT populate `{target}`.
lmolkova marked this conversation as resolved.
Show resolved Hide resolved
For example, for an operation describing SQL query on an anonymous table `SELECT * FROM (VALUES 'a', 'b', 'c') AS t (name)`, span name should be `SELECT`.

## Common attributes

Expand Down
Loading