You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/attributes-registry/db.md
+13-24Lines changed: 13 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,16 +21,16 @@ This group defines the attributes used to describe telemetry in the context of d
21
21
|---|---|---|---|---|
22
22
| <aid="db-client-connection-pool-name"href="#db-client-connection-pool-name">`db.client.connection.pool.name`</a> | string | The name of the connection pool; unique within the instrumented application. In case the connection pool implementation doesn't provide a name, instrumentation SHOULD use a combination of parameters that would make the name unique, for example, combining attributes `server.address`, `server.port`, and `db.namespace`, formatted as `server.address:server.port/db.namespace`. Instrumentations that generate connection pool name following different patterns SHOULD document it. |`myDataSource`||
23
23
| <aid="db-client-connection-state"href="#db-client-connection-state">`db.client.connection.state`</a> | string | The state of a connection in the pool |`idle`||
24
-
| <aid="db-collection-name"href="#db-collection-name">`db.collection.name`</a> | string | The name of a collection (table, container) within the database. [1]|`public.users`; `customers`||
25
-
| <aid="db-namespace"href="#db-namespace">`db.namespace`</a> | string | The name of the database, fully qualified within the server address and port. [2]|`customers`; `test.users`||
26
-
| <aid="db-operation-batch-size"href="#db-operation-batch-size">`db.operation.batch.size`</a> | int | The number of queries included in a batch operation. [3]|`2`; `3`; `4`||
27
-
| <aid="db-operation-name"href="#db-operation-name">`db.operation.name`</a> | string | The name of the operation or command being executed. [4]|`findAndModify`; `HMSET`; `SELECT`||
28
-
| <aid="db-operation-parameter"href="#db-operation-parameter">`db.operation.parameter.<key>`</a> | string | A database operation parameter, with `<key>` being the parameter name, and the attribute value being a string representation of the parameter value. [5]|`someval`; `55`||
29
-
| <aid="db-query-summary"href="#db-query-summary">`db.query.summary`</a> | string | Low cardinality representation of a database query text. [6]|`SELECT wuser_table`; `INSERT shipping_details SELECT orders`; `get user by id`||
30
-
| <aid="db-query-text"href="#db-query-text">`db.query.text`</a> | string | The database query being executed. [7]|`SELECT * FROM wuser_table where username = ?`; `SET mykey ?`||
24
+
| <aid="db-collection-name"href="#db-collection-name">`db.collection.name`</a> | string | The name of a collection (table, container) within the database. [1]|`public.users`; `customers`||
25
+
| <aid="db-namespace"href="#db-namespace">`db.namespace`</a> | string | The name of the database, fully qualified within the server address and port. [2]|`customers`; `test.users`||
26
+
| <aid="db-operation-batch-size"href="#db-operation-batch-size">`db.operation.batch.size`</a> | int | The number of queries included in a batch operation. [3]|`2`; `3`; `4`||
27
+
| <aid="db-operation-name"href="#db-operation-name">`db.operation.name`</a> | string | The name of the operation or command being executed. [4]|`findAndModify`; `HMSET`; `SELECT`||
28
+
| <aid="db-operation-parameter"href="#db-operation-parameter">`db.operation.parameter.<key>`</a> | string | A database operation parameter, with `<key>` being the parameter name, and the attribute value being a string representation of the parameter value. [5]|`someval`; `55`||
29
+
| <aid="db-query-summary"href="#db-query-summary">`db.query.summary`</a> | string | Low cardinality representation of a database query text. [6]|`SELECT wuser_table`; `INSERT shipping_details SELECT orders`; `get user by id`||
30
+
| <aid="db-query-text"href="#db-query-text">`db.query.text`</a> | string | The database query being executed. [7]|`SELECT * FROM wuser_table where username = ?`; `SET mykey ?`||
31
31
| <aid="db-response-returned-rows"href="#db-response-returned-rows">`db.response.returned_rows`</a> | int | Number of rows returned by the operation. |`10`; `30`; `1000`||
| <aid="db-system"href="#db-system">`db.system`</a> | string | The database management system (DBMS) product as identified by the client instrumentation. [9]|`other_sql`; `adabas`; `cache`||
| <aid="db-system"href="#db-system">`db.system`</a> | string | The database management system (DBMS) product as identified by the client instrumentation. [9]|`other_sql`; `adabas`; `cache`||
34
34
35
35
**[1]`db.collection.name`:** It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization.
36
36
@@ -40,15 +40,11 @@ unless the query format is known to only ever have a single collection name pres
40
40
For batch operations, if the individual operations are known to have the same collection name
41
41
then that collection name SHOULD be used.
42
42
43
-
This attribute has stability level RELEASE CANDIDATE.
44
-
45
43
**[2]`db.namespace`:** If a database system has multiple namespace components, they SHOULD be concatenated (potentially using database system specific conventions) from most general to most specific namespace component, and more specific namespaces SHOULD NOT be captured without the more general namespaces, to ensure that "startswith" queries for the more general namespaces will be valid.
46
44
Semantic conventions for individual database systems SHOULD document what `db.namespace` means in the context of that system.
47
45
It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization.
48
-
This attribute has stability level RELEASE CANDIDATE.
49
46
50
47
**[3]`db.operation.batch.size`:** Operations are only considered batches when they contain two or more operations, and so `db.operation.batch.size` SHOULD never be `1`.
51
-
This attribute has stability level RELEASE CANDIDATE.
52
48
53
49
**[4]`db.operation.name`:** It is RECOMMENDED to capture the value as provided by the application
54
50
without attempting to do any case normalization.
@@ -61,27 +57,20 @@ then that operation name SHOULD be used prepended by `BATCH `,
61
57
otherwise `db.operation.name` SHOULD be `BATCH` or some other database
62
58
system specific term if more applicable.
63
59
64
-
This attribute has stability level RELEASE CANDIDATE.
65
-
66
60
**[5]`db.operation.parameter`:** If a parameter has no name and instead is referenced only by index, then `<key>` SHOULD be the 0-based index.
67
61
If `db.query.text` is also captured, then `db.operation.parameter.<key>` SHOULD match up with the parameterized placeholders present in `db.query.text`.
68
-
This attribute has stability level RELEASE CANDIDATE.
69
62
70
63
**[6]`db.query.summary`:**`db.query.summary` provides static summary of the query text. It describes a class of database queries and is useful as a grouping key, especially when analyzing telemetry for database calls involving complex queries.
71
64
Summary may be available to the instrumentation through instrumentation hooks or other means. If it is not available, instrumentations that support query parsing SHOULD generate a summary following [Generating query summary](../../docs/database/database-spans.md#generating-a-summary-of-the-query-text) section.
72
-
This attribute has stability level RELEASE CANDIDATE.
73
65
74
66
**[7]`db.query.text`:** For sanitization see [Sanitization of `db.query.text`](../../docs/database/database-spans.md#sanitization-of-dbquerytext).
75
67
For batch operations, if the individual operations are known to have the same query text then that query text SHOULD be used, otherwise all of the individual query texts SHOULD be concatenated with separator `; ` or some other database system specific separator if more applicable.
76
68
Even though parameterized query text can potentially have sensitive data, by using a parameterized query the user is giving a strong signal that any sensitive data will be passed as parameter values, and the benefit to observability of capturing the static part of the query text by default outweighs the risk.
77
-
This attribute has stability level RELEASE CANDIDATE.
78
69
79
70
**[8]`db.response.status_code`:** The status code returned by the database. Usually it represents an error code, but may also represent partial success, warning, or differentiate between various types of successful outcomes.
80
71
Semantic conventions for individual database systems SHOULD document what `db.response.status_code` means in the context of that system.
81
-
This attribute has stability level RELEASE CANDIDATE.
82
72
83
73
**[9]`db.system`:** The actual DBMS may differ from the one identified by the client. For example, when using PostgreSQL client libraries to connect to a CockroachDB, the `db.system` is set to `postgresql` based on the instrumentation's best knowledge.
84
-
This attribute has stability level RELEASE CANDIDATE.
85
74
86
75
---
87
76
@@ -128,21 +117,21 @@ This attribute has stability level RELEASE CANDIDATE.
|`mssql`| Microsoft SQL Server (This value has stability level RELEASE CANDIDATE) ||
124
+
|`mssql`| Microsoft SQL Server (This value has stability level RELEASE CANDIDATE) ||
136
125
|`mssqlcompact`| Deprecated, Microsoft SQL Server Compact is discontinued. |<br>Removed, use `other_sql` instead. |
137
-
|`mysql`| MySQL (This value has stability level RELEASE CANDIDATE) ||
126
+
|`mysql`| MySQL (This value has stability level RELEASE CANDIDATE) ||
0 commit comments