18 KiB
Database
- Generic Database Attributes
- Cassandra Attributes
- CosmosDB Attributes
- Elasticsearch Attributes
- MongoDB Attributes
- MSSQL Attributes
- Redis Attributes
- SQL Attributes
- Deprecated DB Attributes
Generic Database Attributes
[1]: In some SQL databases, the database name to be used is called "schema name". In case there are multiple layers that could be considered for database name (e.g. Oracle instance name and schema name), the database name to be used is the more specific layer (e.g. Oracle schema name).
db.system has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
Cassandra Attributes
| Attribute | Type | Description | Examples | Stability |
|---|---|---|---|---|
db.cassandra.consistency_level |
string | The consistency level of the query. Based on consistency values from CQL. | all |
|
db.cassandra.coordinator.dc |
string | The data center of the coordinating node for a query. | us-west-2 |
|
db.cassandra.coordinator.id |
string | The ID of the coordinating node for a query. | be13faa2-8574-4d71-926d-27f16cf8a7af |
|
db.cassandra.idempotence |
boolean | Whether or not the query is idempotent. | ||
db.cassandra.page_size |
int | The fetch size used for paging, i.e. how many rows will be returned at once. | 5000 |
|
db.cassandra.speculative_execution_count |
int | The number of times a query was speculatively executed. Not set or 0 if the query was not executed speculatively. |
0; 2 |
|
db.cassandra.table |
string | The name of the primary Cassandra table that the operation is acting upon, including the keyspace name (if applicable). [1] | mytable |
[1]: This mirrors the db.sql.table attribute but references cassandra rather than sql. It is not recommended to attempt any client-side parsing of db.statement just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set.
db.cassandra.consistency_level MUST be one of the following:
| Value | Description | Stability |
|---|---|---|
all |
all | |
each_quorum |
each_quorum | |
quorum |
quorum | |
local_quorum |
local_quorum | |
one |
one | |
two |
two | |
three |
three | |
local_one |
local_one | |
any |
any | |
serial |
serial | |
local_serial |
local_serial |
CosmosDB Attributes
db.cosmosdb.connection_mode MUST be one of the following:
| Value | Description | Stability |
|---|---|---|
gateway |
Gateway (HTTP) connections mode | |
direct |
Direct connection. |
db.cosmosdb.operation_type has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
Elasticsearch Attributes
[1]: Many Elasticsearch url paths allow dynamic values. These SHOULD be recorded in span attributes in the format db.elasticsearch.path_parts.<key>, where <key> is the url path part name. The implementation SHOULD reference the elasticsearch schema in order to map the path part values to their names.
MongoDB Attributes
| Attribute | Type | Description | Examples | Stability |
|---|---|---|---|---|
db.mongodb.collection |
string | The MongoDB collection being accessed within the database stated in db.name. |
customers; products |
MSSQL Attributes
| Attribute | Type | Description | Examples | Stability |
|---|---|---|---|---|
db.mssql.instance_name |
string | The Microsoft SQL Server instance name connecting to. This name is used to determine the port of a named instance. [1] | MSSQLSERVER |
[1]: If setting a db.mssql.instance_name, server.port is no longer required (but still recommended if non-standard).
Redis Attributes
| Attribute | Type | Description | Examples | Stability |
|---|---|---|---|---|
db.redis.database_index |
int | The index of the database being accessed as used in the SELECT command, provided as an integer. To be used instead of the generic db.name attribute. |
0; 1; 15 |
SQL Attributes
[1]: It is not recommended to attempt any client-side parsing of db.statement just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set.