Skip to content

Latest commit

 

History

History
284 lines (231 loc) · 28.7 KB

File metadata and controls

284 lines (231 loc) · 28.7 KB

Db

General Database Attributes

This group defines the attributes used to describe telemetry in the context of databases.

Attribute Type Description Examples Stability
db.client.connection.pool.name 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 Experimental
db.client.connection.state string The state of a connection in the pool idle Experimental
db.collection.name string The name of a collection (table, container) within the database. [1] public.users; customers Experimental
db.namespace string The name of the database, fully qualified within the server address and port. [2] customers; test.users Experimental
db.operation.batch.size int The number of queries included in a batch operation. [3] 2; 3; 4 Experimental
db.operation.name string The name of the operation or command being executed. [4] findAndModify; HMSET; SELECT Experimental
db.query.parameter.<key> string A query parameter used in db.query.text, with <key> being the parameter name, and the attribute value being a string representation of the parameter value. [5] someval; 55 Experimental
db.query.summary string Low cardinality representation of a database query text. [6] SELECT wuser_table; INSERT shipping_details SELECT orders; get user by id Experimental
db.query.text string The database query being executed. [7] SELECT * FROM wuser_table where username = ?; SET mykey ? Experimental
db.response.status_code string Database response status code. [8] 102; ORA-17002; 08P01; 404 Experimental
db.system string The database management system (DBMS) product as identified by the client instrumentation. [9] other_sql; adabas; cache Experimental

[1]: It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization.

A single database query may involve multiple collections.

If the collection name is parsed from the query text, it SHOULD only be captured for queries that contain a single collection and it SHOULD match the value provided in the query text including any schema and database name prefix.

For batch operations, if the individual operations are known to have the same collection name then that collection name SHOULD be used.

If the operation or query involves multiple collections, db.collection.name SHOULD NOT be captured.

This attribute has stability level RELEASE CANDIDATE.

[2]: 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. Semantic conventions for individual database systems SHOULD document what db.namespace means in the context of that system. It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization. This attribute has stability level RELEASE CANDIDATE.

[3]: Operations are only considered batches when they contain two or more operations, and so db.operation.batch.size SHOULD never be 1. This attribute has stability level RELEASE CANDIDATE.

[4]: It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization.

A single database query may involve multiple operations. If the operation name is parsed from the query text, it SHOULD only be captured for queries that contain a single operation or when the operation name describing the whole query is available by other means.

For batch operations, if the individual operations are known to have the same operation name then that operation name SHOULD be used prepended by BATCH , otherwise db.operation.name SHOULD be BATCH or some other database system specific term if more applicable.

This attribute has stability level RELEASE CANDIDATE.

[5]: Query parameters should only be captured when db.query.text is parameterized with placeholders. If a parameter has no name and instead is referenced only by index, then <key> SHOULD be the 0-based index. This attribute has stability level RELEASE CANDIDATE.

[6]: 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. 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 section. This attribute has stability level RELEASE CANDIDATE.

[7]: For sanitization see Sanitization of db.query.text. 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. 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. This attribute has stability level RELEASE CANDIDATE.

[8]: 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. Semantic conventions for individual database systems SHOULD document what db.response.status_code means in the context of that system. This attribute has stability level RELEASE CANDIDATE.

[9]: 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. This attribute has stability level RELEASE CANDIDATE.

db.client.connection.state 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.

Value Description Stability
idle idle Experimental
used used Experimental

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.

Value Description Stability
adabas Adabas (Adaptable Database System) Experimental
cache Deprecated, use intersystems_cache instead. Deprecated
Replaced by intersystems_cache.
cassandra Apache Cassandra Experimental
clickhouse ClickHouse Experimental
cloudscape Deprecated, use other_sql instead. Deprecated
Replaced by other_sql.
cockroachdb CockroachDB Experimental
coldfusion Deprecated, no replacement at this time. Deprecated
Removed.
cosmosdb Microsoft Azure Cosmos DB Experimental
couchbase Couchbase Experimental
couchdb CouchDB Experimental
db2 IBM Db2 Experimental
derby Apache Derby Experimental
dynamodb Amazon DynamoDB Experimental
edb EnterpriseDB Experimental
elasticsearch Elasticsearch Experimental
filemaker FileMaker Experimental
firebird Firebird Experimental
firstsql Deprecated, use other_sql instead. Deprecated
Replaced by other_sql.
geode Apache Geode Experimental
h2 H2 Experimental
hanadb SAP HANA Experimental
hbase Apache HBase Experimental
hive Apache Hive Experimental
hsqldb HyperSQL DataBase Experimental
influxdb InfluxDB Experimental
informix Informix Experimental
ingres Ingres Experimental
instantdb InstantDB Experimental
interbase InterBase Experimental
intersystems_cache InterSystems Caché Experimental
mariadb MariaDB (This value has stability level RELEASE CANDIDATE) Experimental
maxdb SAP MaxDB Experimental
memcached Memcached Experimental
mongodb MongoDB Experimental
mssql Microsoft SQL Server (This value has stability level RELEASE CANDIDATE) Experimental
mssqlcompact Deprecated, Microsoft SQL Server Compact is discontinued. Deprecated
Removed, use other_sql instead.
mysql MySQL (This value has stability level RELEASE CANDIDATE) Experimental
neo4j Neo4j Experimental
netezza Netezza Experimental
opensearch OpenSearch Experimental
oracle Oracle Database Experimental
other_sql Some other SQL database. Fallback only. See notes. Experimental
pervasive Pervasive PSQL Experimental
pointbase PointBase Experimental
postgresql PostgreSQL (This value has stability level RELEASE CANDIDATE) Experimental
progress Progress Database Experimental
redis Redis Experimental
redshift Amazon Redshift Experimental
spanner Cloud Spanner Experimental
sqlite SQLite Experimental
sybase Sybase Experimental
teradata Teradata Experimental
trino Trino Experimental
vertica Vertica Experimental

Cassandra Attributes

This group defines attributes for Cassandra.

Attribute Type Description Examples Stability
db.cassandra.consistency_level string The consistency level of the query. Based on consistency values from CQL. all; each_quorum; quorum Experimental
db.cassandra.coordinator.dc string The data center of the coordinating node for a query. us-west-2 Experimental
db.cassandra.coordinator.id string The ID of the coordinating node for a query. be13faa2-8574-4d71-926d-27f16cf8a7af Experimental
db.cassandra.idempotence boolean Whether or not the query is idempotent. Experimental
db.cassandra.page_size int The fetch size used for paging, i.e. how many rows will be returned at once. 5000 Experimental
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 Experimental

db.cassandra.consistency_level 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.

Value Description Stability
all all Experimental
any any Experimental
each_quorum each_quorum Experimental
local_one local_one Experimental
local_quorum local_quorum Experimental
local_serial local_serial Experimental
one one Experimental
quorum quorum Experimental
serial serial Experimental
three three Experimental
two two Experimental

Azure Cosmos DB Attributes

This group defines attributes for Azure Cosmos DB.

Attribute Type Description Examples Stability
db.cosmosdb.client_id string Unique Cosmos client instance id. 3ba4827d-4422-483f-b59f-85b74211c11d Experimental
db.cosmosdb.connection_mode string Cosmos client connection mode. gateway; direct Experimental
db.cosmosdb.operation_type string Cosmos DB Operation Type. batch; create; delete Experimental
db.cosmosdb.request_charge double RU consumed for that operation 46.18; 1.0 Experimental
db.cosmosdb.request_content_length int Request payload size in bytes Experimental
db.cosmosdb.sub_status_code int Cosmos DB sub status code. 1000; 1002 Experimental

db.cosmosdb.connection_mode 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.

Value Description Stability
direct Direct connection. Experimental
gateway Gateway (HTTP) connections mode Experimental

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.

Value Description Stability
batch batch Experimental
create create Experimental
delete delete Experimental
execute execute Experimental
execute_javascript execute_javascript Experimental
head head Experimental
head_feed head_feed Experimental
invalid invalid Experimental
patch patch Experimental
query query Experimental
query_plan query_plan Experimental
read read Experimental
read_feed read_feed Experimental
replace replace Experimental
upsert upsert Experimental

Elasticsearch Attributes

This group defines attributes for Elasticsearch.

Attribute Type Description Examples Stability
db.elasticsearch.node.name string Represents the human-readable identifier of the node/instance to which a request was routed. instance-0000000001 Experimental
db.elasticsearch.path_parts.<key> string A dynamic value in the url path. [10] db.elasticsearch.path_parts.index=test-index; db.elasticsearch.path_parts.doc_id=123 Experimental

[10]: 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.

Deprecated Database Attributes

"Describes deprecated db attributes."

Attribute Type Description Examples Stability
db.cassandra.table string Deprecated, use db.collection.name instead. mytable Deprecated
Replaced by db.collection.name.
db.connection_string string Deprecated, use server.address, server.port attributes instead. Server=(localdb)\v11.0;Integrated Security=true; Deprecated
Replaced by server.address and server.port.
db.cosmosdb.container string Deprecated, use db.collection.name instead. mytable Deprecated
Replaced by db.collection.name.
db.cosmosdb.status_code int Deprecated, use db.response.status_code instead. 200; 201 Deprecated
Replaced by db.response.status_code.
db.elasticsearch.cluster.name string Deprecated, use db.namespace instead. e9106fc68e3044f0b1475b04bf4ffd5f Deprecated
Replaced by db.namespace.
db.instance.id string Deprecated, no general replacement at this time. For Elasticsearch, use db.elasticsearch.node.name instead. mysql-e26b99z.example.com Deprecated
Deprecated, no general replacement at this time. For Elasticsearch, use db.elasticsearch.node.name instead.
db.jdbc.driver_classname string Removed, no replacement at this time. org.postgresql.Driver; com.microsoft.sqlserver.jdbc.SQLServerDriver Deprecated
Removed as not used.
db.mongodb.collection string Deprecated, use db.collection.name instead. mytable Deprecated
Replaced by db.collection.name.
db.mssql.instance_name string Deprecated, SQL Server instance is now populated as a part of db.namespace attribute. MSSQLSERVER Deprecated
Deprecated, no replacement at this time.
db.name string Deprecated, use db.namespace instead. customers; main Deprecated
Replaced by db.namespace.
db.operation string Deprecated, use db.operation.name instead. findAndModify; HMSET; SELECT Deprecated
Replaced by db.operation.name.
db.redis.database_index int Deprecated, use db.namespace instead. 0; 1; 15 Deprecated
Replaced by db.namespace.
db.sql.table string Deprecated, use db.collection.name instead. mytable Deprecated
Replaced by db.collection.name.
db.statement string The database statement being executed. SELECT * FROM wuser_table; SET mykey "WuValue" Deprecated
Replaced by db.query.text.
db.user string Deprecated, no replacement at this time. readonly_user; reporting_user Deprecated
No replacement at this time.

Deprecated Database Metrics

"Describes deprecated db metrics attributes."

Attribute Type Description Examples Stability
db.client.connections.pool.name string Deprecated, use db.client.connection.pool.name instead. myDataSource Deprecated
Replaced by db.client.connection.pool.name.
db.client.connections.state string Deprecated, use db.client.connection.state instead. idle Deprecated
Replaced by db.client.connection.state.
pool.name string Deprecated, use db.client.connection.pool.name instead. myDataSource Deprecated
Replaced by db.client.connection.pool.name.
state string Deprecated, use db.client.connection.state instead. idle Deprecated
Replaced by db.client.connection.state.

db.client.connections.state 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.

Value Description Stability
idle idle Experimental
used used Experimental

state 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.

Value Description Stability
idle idle Experimental
used used Experimental