Semantic conventions for database client metrics

Status: Mixed

Database operation

Metric: db.client.operation.duration

Status: Stable

This metric is recommended.

When this metric is reported alongside a database operation span, the metric value SHOULD be the same as the database operation span duration.

This metric SHOULD be specified with ExplicitBucketBoundaries advisory parameter of [ 0.001, 0.005, 0.01, 0.05, 0.1, 0.5, 1, 5, 10 ].

NameInstrument TypeUnit (UCUM)DescriptionStabilityEntity Associations
db.client.operation.durationHistogramsDuration of database client operations. [1]Stable

[1]: Batch operations SHOULD be recorded as a single operation.

Attributes:

KeyStabilityRequirement LevelValue TypeDescriptionExample Values
db.system.nameStableRequiredstringThe database management system (DBMS) product as identified by the client instrumentation. [1]other_sql; softwareag.adabas; actian.ingres (see more)
db.collection.nameStableConditionally Required [2]stringThe name of a collection (table, container) within the database. [3]public.users; customers
db.namespaceStableConditionally Required If available.stringThe name of the database, fully qualified within the server address and port. [4]customers; test.users
db.operation.nameStableConditionally Required [5]stringThe name of the operation or command being executed. [6]findAndModify; HMSET; SELECT
db.response.status_codeStableConditionally Required [7]stringDatabase response status code. [8]102; ORA-17002; 08P01; 404
error.typeStableConditionally Required If and only if the operation failed.stringDescribes a class of error the operation ended with. [9]timeout; java.net.UnknownHostException; server_certificate_invalid; 500
server.portStableConditionally Required [10]intServer port number. [11]80; 8080; 443
db.query.summaryStableRecommended [12]stringLow cardinality summary of a database query. [13]SELECT wuser_table; INSERT shipping_details SELECT orders; get user by id
db.stored_procedure.nameStableRecommended [14]stringThe name of a stored procedure within the database. [15]GetCustomer
network.peer.addressStableRecommended If applicable for this database system.stringPeer address of the database node where the operation was performed. [16]10.1.2.80; /tmp/my.sock
network.peer.portStableRecommended If and only if network.peer.address is set.intPeer port number of the network connection.65123
server.addressStableRecommendedstringThe database address specified in the client configuration. [17]example.com; 10.1.2.80; /tmp/my.sock
db.query.textStableOpt-InstringThe database query being executed. [18]SELECT * FROM wuser_table where username = ?; SET mykey ?

[1] db.system.name: 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.name is set to postgresql based on the instrumentation’s best knowledge.

[2] db.collection.name: If readily available and if a database call is performed on a single collection.

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

The collection name SHOULD NOT be extracted from db.query.text, when the database system supports query text with multiple collections in non-batch operations.

For batch operations, if the individual operations would all have the same db.collection.name when executed as non-batch operations, then that collection name SHOULD be used.

[4] db.namespace: If a database system has multiple namespace components, they SHOULD be concatenated from the most general to the most specific namespace component, using | as a separator between the components. Any missing components (and their associated separators) SHOULD be omitted. 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.

[5] db.operation.name: If readily available and if there is a single operation name that describes the database call.

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

The operation name SHOULD NOT be extracted from db.query.text, when the database system supports query text with multiple operations in non-batch operations.

If spaces can occur in the operation name, multiple consecutive spaces SHOULD be normalized to a single space.

For batch operations, if the individual operations would all have the same db.operation.name when executed as non-batch operations, 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.

[7] db.response.status_code: If the operation failed and status code is available.

[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. The value MAY use a standardized string representation of a numeric status code, if one exists, instead of the numeric code. The value MAY be a synthetic status provided by the client library rather than returned by the remote service. Semantic conventions for individual database systems SHOULD document what db.response.status_code means in the context of that system.

[9] error.type: The error.type SHOULD match the db.response.status_code returned by the database or the client library, or the canonical name of exception that occurred. When using canonical exception type name, instrumentation SHOULD do the best effort to report the most relevant type. For example, if the original exception is wrapped into a generic one, the original exception SHOULD be preferred. Instrumentations SHOULD document how error.type is populated.

[10] server.port: If server.address is set and the client is configured with a single database server endpoint that uses a non-default port.

[11] server.port: server.port SHOULD reflect the database port specified in the client configuration. It SHOULD NOT be derived from the server selected for an operation.

[12] db.query.summary: if available through instrumentation hooks or if the instrumentation supports generating a query summary.

[13] db.query.summary: The query summary 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.

For batch operations, if the individual operations would all have the same db.query.summary when executed as non-batch operations, then that query summary SHOULD be used prepended by BATCH . Otherwise, db.query.summary SHOULD be BATCH or some other database system specific term if more applicable.

[14] db.stored_procedure.name: If operation applies to a specific stored procedure.

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

For batch operations, if the individual operations would all have the same db.stored_procedure.name when executed as non-batch operations, then that stored procedure name SHOULD be used.

[16] network.peer.address: Semantic conventions for individual database systems SHOULD document whether network.peer.* attributes are applicable. Network peer address and port are useful when the application interacts with individual database nodes directly. If a database operation involved multiple network calls (for example retries), the address of the last contacted node SHOULD be used.

[17] server.address: Instrumentation SHOULD set server.address to the database address specified in the client configuration. It SHOULD NOT derive the value from the server selected for an operation.

See Database server address for guidance and examples.

[18] db.query.text:

For sanitization see Sanitization of db.query.text. For batch operations, if the individual operations would all have the same db.query.text when executed as non-batch operations, 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. Parameterized query text SHOULD NOT be sanitized. 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.


db.system.name 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.

ValueDescriptionStability
actian.ingresActian IngresDevelopment
aws.dynamodbAmazon DynamoDBDevelopment
aws.redshiftAmazon RedshiftDevelopment
azure.cosmosdbAzure Cosmos DBDevelopment
cassandraApache CassandraDevelopment
clickhouseClickHouseDevelopment
cockroachdbCockroachDBDevelopment
couchbaseCouchbaseDevelopment
couchdbApache CouchDBDevelopment
derbyApache DerbyDevelopment
elasticsearchElasticsearchDevelopment
firebirdsqlFirebirdDevelopment
gcp.spannerGoogle Cloud SpannerDevelopment
geodeApache GeodeDevelopment
h2databaseH2 DatabaseDevelopment
hbaseApache HBaseDevelopment
hiveApache HiveDevelopment
hsqldbHyperSQL DatabaseDevelopment
ibm.db2IBM Db2Development
ibm.informixIBM InformixDevelopment
ibm.netezzaIBM NetezzaDevelopment
influxdbInfluxDBDevelopment
instantdbInstantDevelopment
intersystems.cacheInterSystems CachéDevelopment
mariadbMariaDBStable
memcachedMemcachedDevelopment
microsoft.sql_serverMicrosoft SQL ServerStable
mongodbMongoDBDevelopment
mysqlMySQLStable
neo4jNeo4jDevelopment
opensearchOpenSearchDevelopment
oracle.dbOracle DatabaseDevelopment
other_sqlSome other SQL database. Fallback only.Development
postgresqlPostgreSQLStable
redisRedisDevelopment
sap.hanaSAP HANADevelopment
sap.maxdbSAP MaxDBDevelopment
softwareag.adabasAdabas (Adaptable Database System)Development
sqliteSQLiteDevelopment
teradataTeradataDevelopment
trinoTrinoDevelopment

Development

Status: Development

Database response

The following metric instruments describe database query response.

Metric: db.client.response.returned_rows

This metric is recommended.

This metric SHOULD be specified with ExplicitBucketBoundaries advisory parameter of [1, 2, 5, 10, 20, 50, 100, 200, 500, 1000, 2000, 5000, 10000].

Explaining bucket configuration:

  1. 1, 2, 5, 10, 50, 100: These buckets are useful for capturing scenarios where only a small number of items are returned. Such small queries are common in real-time or interactive applications where performance and quick responses are critical.
  2. 200, 500, 1000: These values represent typical workloads where moderate amounts of data are returned in each query.
  3. 2000, 5000: These boundaries capture scenarios where the query returns large datasets. These larger page sizes can potentially increase memory or CPU usage and may lead to longer query execution times, making it important to track performance in these ranges.
  4. 10000: This boundary is included to capture rare, very large response sizes. Such queries can put significant strain on system resources, including memory, CPU, and network bandwidth, and can often lead to performance issues such as high latency or even network drops.
NameInstrument TypeUnit (UCUM)DescriptionStabilityEntity Associations
db.client.response.returned_rowsHistogram{row}The actual number of records returned by the database operation.Development

Attributes:

KeyStabilityRequirement LevelValue TypeDescriptionExample Values
db.system.nameStableRequiredstringThe database management system (DBMS) product as identified by the client instrumentation. [1]other_sql; softwareag.adabas; actian.ingres (see more)
db.collection.nameStableConditionally Required [2]stringThe name of a collection (table, container) within the database. [3]public.users; customers
db.namespaceStableConditionally Required If available.stringThe name of the database, fully qualified within the server address and port. [4]customers; test.users
db.operation.nameStableConditionally Required [5]stringThe name of the operation or command being executed. [6]findAndModify; HMSET; SELECT
db.response.status_codeStableConditionally Required [7]stringDatabase response status code. [8]102; ORA-17002; 08P01; 404
error.typeStableConditionally Required If and only if the operation failed.stringDescribes a class of error the operation ended with. [9]timeout; java.net.UnknownHostException; server_certificate_invalid; 500
server.portStableConditionally Required [10]intServer port number. [11]80; 8080; 443
db.query.summaryStableRecommended [12]stringLow cardinality summary of a database query. [13]SELECT wuser_table; INSERT shipping_details SELECT orders; get user by id
network.peer.addressStableRecommended If applicable for this database system.stringPeer address of the database node where the operation was performed. [14]10.1.2.80; /tmp/my.sock
network.peer.portStableRecommended If and only if network.peer.address is set.intPeer port number of the network connection.65123
server.addressStableRecommendedstringThe database address specified in the client configuration. [15]example.com; 10.1.2.80; /tmp/my.sock
db.query.textStableOpt-InstringThe database query being executed. [16]SELECT * FROM wuser_table where username = ?; SET mykey ?

[1] db.system.name: 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.name is set to postgresql based on the instrumentation’s best knowledge.

[2] db.collection.name: If readily available and if a database call is performed on a single collection.

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

The collection name SHOULD NOT be extracted from db.query.text, when the database system supports query text with multiple collections in non-batch operations.

For batch operations, if the individual operations would all have the same db.collection.name when executed as non-batch operations, then that collection name SHOULD be used.

[4] db.namespace: If a database system has multiple namespace components, they SHOULD be concatenated from the most general to the most specific namespace component, using | as a separator between the components. Any missing components (and their associated separators) SHOULD be omitted. 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.

[5] db.operation.name: If readily available and if there is a single operation name that describes the database call.

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

The operation name SHOULD NOT be extracted from db.query.text, when the database system supports query text with multiple operations in non-batch operations.

If spaces can occur in the operation name, multiple consecutive spaces SHOULD be normalized to a single space.

For batch operations, if the individual operations would all have the same db.operation.name when executed as non-batch operations, 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.

[7] db.response.status_code: If the operation failed and status code is available.

[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. The value MAY use a standardized string representation of a numeric status code, if one exists, instead of the numeric code. The value MAY be a synthetic status provided by the client library rather than returned by the remote service. Semantic conventions for individual database systems SHOULD document what db.response.status_code means in the context of that system.

[9] error.type: The error.type SHOULD match the db.response.status_code returned by the database or the client library, or the canonical name of exception that occurred. When using canonical exception type name, instrumentation SHOULD do the best effort to report the most relevant type. For example, if the original exception is wrapped into a generic one, the original exception SHOULD be preferred. Instrumentations SHOULD document how error.type is populated.

[10] server.port: If server.address is set and the client is configured with a single database server endpoint that uses a non-default port.

[11] server.port: server.port SHOULD reflect the database port specified in the client configuration. It SHOULD NOT be derived from the server selected for an operation.

[12] db.query.summary: if available through instrumentation hooks or if the instrumentation supports generating a query summary.

[13] db.query.summary: The query summary 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.

For batch operations, if the individual operations would all have the same db.query.summary when executed as non-batch operations, then that query summary SHOULD be used prepended by BATCH . Otherwise, db.query.summary SHOULD be BATCH or some other database system specific term if more applicable.

[14] network.peer.address: Semantic conventions for individual database systems SHOULD document whether network.peer.* attributes are applicable. Network peer address and port are useful when the application interacts with individual database nodes directly. If a database operation involved multiple network calls (for example retries), the address of the last contacted node SHOULD be used.

[15] server.address: Instrumentation SHOULD set server.address to the database address specified in the client configuration. It SHOULD NOT derive the value from the server selected for an operation.

See Database server address for guidance and examples.

[16] db.query.text:

For sanitization see Sanitization of db.query.text. For batch operations, if the individual operations would all have the same db.query.text when executed as non-batch operations, 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. Parameterized query text SHOULD NOT be sanitized. 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.


db.system.name 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.

ValueDescriptionStability
actian.ingresActian IngresDevelopment
aws.dynamodbAmazon DynamoDBDevelopment
aws.redshiftAmazon RedshiftDevelopment
azure.cosmosdbAzure Cosmos DBDevelopment
cassandraApache CassandraDevelopment
clickhouseClickHouseDevelopment
cockroachdbCockroachDBDevelopment
couchbaseCouchbaseDevelopment
couchdbApache CouchDBDevelopment
derbyApache DerbyDevelopment
elasticsearchElasticsearchDevelopment
firebirdsqlFirebirdDevelopment
gcp.spannerGoogle Cloud SpannerDevelopment
geodeApache GeodeDevelopment
h2databaseH2 DatabaseDevelopment
hbaseApache HBaseDevelopment
hiveApache HiveDevelopment
hsqldbHyperSQL DatabaseDevelopment
ibm.db2IBM Db2Development
ibm.informixIBM InformixDevelopment
ibm.netezzaIBM NetezzaDevelopment
influxdbInfluxDBDevelopment
instantdbInstantDevelopment
intersystems.cacheInterSystems CachéDevelopment
mariadbMariaDBStable
memcachedMemcachedDevelopment
microsoft.sql_serverMicrosoft SQL ServerStable
mongodbMongoDBDevelopment
mysqlMySQLStable
neo4jNeo4jDevelopment
opensearchOpenSearchDevelopment
oracle.dbOracle DatabaseDevelopment
other_sqlSome other SQL database. Fallback only.Development
postgresqlPostgreSQLStable
redisRedisDevelopment
sap.hanaSAP HANADevelopment
sap.maxdbSAP MaxDBDevelopment
softwareag.adabasAdabas (Adaptable Database System)Development
sqliteSQLiteDevelopment
teradataTeradataDevelopment
trinoTrinoDevelopment

Connection pools

The following metric instruments describe database client connection pool operations.

Metric: db.client.connection.count

This metric is recommended.

NameInstrument TypeUnit (UCUM)DescriptionStabilityEntity Associations
db.client.connection.countUpDownCounter{connection}The number of connections that are currently in state described by the state attribute.Development

Attributes:

KeyStabilityRequirement LevelValue TypeDescriptionExample Values
db.client.connection.pool.nameDevelopmentRequiredstringThe name of the connection pool. If the connection pool does not have a name, instrumentation SHOULD use db.namespace; otherwise server.address, with server.port appended using : if set. When appending a port to an IPv6 address, instrumentation MUST enclose the address in square brackets. If server.address is not available, instrumentation SHOULD use db.system.name; otherwise the connection pool library name.myDataSource
db.client.connection.stateDevelopmentRequiredstringThe state of a connection in the poolidle (see more)
db.namespaceStableConditionally Required If available.stringThe name of the database, fully qualified within the server address and port. [1]customers; test.users
db.system.nameStableConditionally Required If available.stringThe database management system (DBMS) product as identified by the client instrumentation. [2]other_sql; softwareag.adabas; actian.ingres (see more)
server.portStableConditionally Required [3]intServer port number. [4]80; 8080; 443
server.addressStableRecommendedstringThe database address specified in the client configuration. [5]example.com; 10.1.2.80; /tmp/my.sock

[1] db.namespace: If a database system has multiple namespace components, they SHOULD be concatenated from the most general to the most specific namespace component, using | as a separator between the components. Any missing components (and their associated separators) SHOULD be omitted. 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.

[2] db.system.name: 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.name is set to postgresql based on the instrumentation’s best knowledge.

[3] server.port: If server.address is set and the client is configured with a single database server endpoint that uses a non-default port.

[4] server.port: server.port SHOULD reflect the database port specified in the client configuration. It SHOULD NOT be derived from the server selected for an operation.

[5] server.address: Instrumentation SHOULD set server.address to the database address specified in the client configuration. It SHOULD NOT derive the value from the server selected for an operation.

See Database server address for guidance and examples.


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.

ValueDescriptionStability
idleidleDevelopment
usedusedDevelopment

db.system.name 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.

ValueDescriptionStability
actian.ingresActian IngresDevelopment
aws.dynamodbAmazon DynamoDBDevelopment
aws.redshiftAmazon RedshiftDevelopment
azure.cosmosdbAzure Cosmos DBDevelopment
cassandraApache CassandraDevelopment
clickhouseClickHouseDevelopment
cockroachdbCockroachDBDevelopment
couchbaseCouchbaseDevelopment
couchdbApache CouchDBDevelopment
derbyApache DerbyDevelopment
elasticsearchElasticsearchDevelopment
firebirdsqlFirebirdDevelopment
gcp.spannerGoogle Cloud SpannerDevelopment
geodeApache GeodeDevelopment
h2databaseH2 DatabaseDevelopment
hbaseApache HBaseDevelopment
hiveApache HiveDevelopment
hsqldbHyperSQL DatabaseDevelopment
ibm.db2IBM Db2Development
ibm.informixIBM InformixDevelopment
ibm.netezzaIBM NetezzaDevelopment
influxdbInfluxDBDevelopment
instantdbInstantDevelopment
intersystems.cacheInterSystems CachéDevelopment
mariadbMariaDBStable
memcachedMemcachedDevelopment
microsoft.sql_serverMicrosoft SQL ServerStable
mongodbMongoDBDevelopment
mysqlMySQLStable
neo4jNeo4jDevelopment
opensearchOpenSearchDevelopment
oracle.dbOracle DatabaseDevelopment
other_sqlSome other SQL database. Fallback only.Development
postgresqlPostgreSQLStable
redisRedisDevelopment
sap.hanaSAP HANADevelopment
sap.maxdbSAP MaxDBDevelopment
softwareag.adabasAdabas (Adaptable Database System)Development
sqliteSQLiteDevelopment
teradataTeradataDevelopment
trinoTrinoDevelopment

Metric: db.client.connection.idle.max

This metric is recommended.

NameInstrument TypeUnit (UCUM)DescriptionStabilityEntity Associations
db.client.connection.idle.maxUpDownCounter{connection}The maximum number of idle open connections allowed.Development

Attributes:

KeyStabilityRequirement LevelValue TypeDescriptionExample Values
db.client.connection.pool.nameDevelopmentRequiredstringThe name of the connection pool. If the connection pool does not have a name, instrumentation SHOULD use db.namespace; otherwise server.address, with server.port appended using : if set. When appending a port to an IPv6 address, instrumentation MUST enclose the address in square brackets. If server.address is not available, instrumentation SHOULD use db.system.name; otherwise the connection pool library name.myDataSource
db.namespaceStableConditionally Required If available.stringThe name of the database, fully qualified within the server address and port. [1]customers; test.users
db.system.nameStableConditionally Required If available.stringThe database management system (DBMS) product as identified by the client instrumentation. [2]other_sql; softwareag.adabas; actian.ingres (see more)
server.portStableConditionally Required [3]intServer port number. [4]80; 8080; 443
server.addressStableRecommendedstringThe database address specified in the client configuration. [5]example.com; 10.1.2.80; /tmp/my.sock

[1] db.namespace: If a database system has multiple namespace components, they SHOULD be concatenated from the most general to the most specific namespace component, using | as a separator between the components. Any missing components (and their associated separators) SHOULD be omitted. 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.

[2] db.system.name: 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.name is set to postgresql based on the instrumentation’s best knowledge.

[3] server.port: If server.address is set and the client is configured with a single database server endpoint that uses a non-default port.

[4] server.port: server.port SHOULD reflect the database port specified in the client configuration. It SHOULD NOT be derived from the server selected for an operation.

[5] server.address: Instrumentation SHOULD set server.address to the database address specified in the client configuration. It SHOULD NOT derive the value from the server selected for an operation.

See Database server address for guidance and examples.


db.system.name 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.

ValueDescriptionStability
actian.ingresActian IngresDevelopment
aws.dynamodbAmazon DynamoDBDevelopment
aws.redshiftAmazon RedshiftDevelopment
azure.cosmosdbAzure Cosmos DBDevelopment
cassandraApache CassandraDevelopment
clickhouseClickHouseDevelopment
cockroachdbCockroachDBDevelopment
couchbaseCouchbaseDevelopment
couchdbApache CouchDBDevelopment
derbyApache DerbyDevelopment
elasticsearchElasticsearchDevelopment
firebirdsqlFirebirdDevelopment
gcp.spannerGoogle Cloud SpannerDevelopment
geodeApache GeodeDevelopment
h2databaseH2 DatabaseDevelopment
hbaseApache HBaseDevelopment
hiveApache HiveDevelopment
hsqldbHyperSQL DatabaseDevelopment
ibm.db2IBM Db2Development
ibm.informixIBM InformixDevelopment
ibm.netezzaIBM NetezzaDevelopment
influxdbInfluxDBDevelopment
instantdbInstantDevelopment
intersystems.cacheInterSystems CachéDevelopment
mariadbMariaDBStable
memcachedMemcachedDevelopment
microsoft.sql_serverMicrosoft SQL ServerStable
mongodbMongoDBDevelopment
mysqlMySQLStable
neo4jNeo4jDevelopment
opensearchOpenSearchDevelopment
oracle.dbOracle DatabaseDevelopment
other_sqlSome other SQL database. Fallback only.Development
postgresqlPostgreSQLStable
redisRedisDevelopment
sap.hanaSAP HANADevelopment
sap.maxdbSAP MaxDBDevelopment
softwareag.adabasAdabas (Adaptable Database System)Development
sqliteSQLiteDevelopment
teradataTeradataDevelopment
trinoTrinoDevelopment

Metric: db.client.connection.idle.min

This metric is recommended.

NameInstrument TypeUnit (UCUM)DescriptionStabilityEntity Associations
db.client.connection.idle.minUpDownCounter{connection}The minimum number of idle open connections allowed.Development

Attributes:

KeyStabilityRequirement LevelValue TypeDescriptionExample Values
db.client.connection.pool.nameDevelopmentRequiredstringThe name of the connection pool. If the connection pool does not have a name, instrumentation SHOULD use db.namespace; otherwise server.address, with server.port appended using : if set. When appending a port to an IPv6 address, instrumentation MUST enclose the address in square brackets. If server.address is not available, instrumentation SHOULD use db.system.name; otherwise the connection pool library name.myDataSource
db.namespaceStableConditionally Required If available.stringThe name of the database, fully qualified within the server address and port. [1]customers; test.users
db.system.nameStableConditionally Required If available.stringThe database management system (DBMS) product as identified by the client instrumentation. [2]other_sql; softwareag.adabas; actian.ingres (see more)
server.portStableConditionally Required [3]intServer port number. [4]80; 8080; 443
server.addressStableRecommendedstringThe database address specified in the client configuration. [5]example.com; 10.1.2.80; /tmp/my.sock

[1] db.namespace: If a database system has multiple namespace components, they SHOULD be concatenated from the most general to the most specific namespace component, using | as a separator between the components. Any missing components (and their associated separators) SHOULD be omitted. 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.

[2] db.system.name: 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.name is set to postgresql based on the instrumentation’s best knowledge.

[3] server.port: If server.address is set and the client is configured with a single database server endpoint that uses a non-default port.

[4] server.port: server.port SHOULD reflect the database port specified in the client configuration. It SHOULD NOT be derived from the server selected for an operation.

[5] server.address: Instrumentation SHOULD set server.address to the database address specified in the client configuration. It SHOULD NOT derive the value from the server selected for an operation.

See Database server address for guidance and examples.


db.system.name 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.

ValueDescriptionStability
actian.ingresActian IngresDevelopment
aws.dynamodbAmazon DynamoDBDevelopment
aws.redshiftAmazon RedshiftDevelopment
azure.cosmosdbAzure Cosmos DBDevelopment
cassandraApache CassandraDevelopment
clickhouseClickHouseDevelopment
cockroachdbCockroachDBDevelopment
couchbaseCouchbaseDevelopment
couchdbApache CouchDBDevelopment
derbyApache DerbyDevelopment
elasticsearchElasticsearchDevelopment
firebirdsqlFirebirdDevelopment
gcp.spannerGoogle Cloud SpannerDevelopment
geodeApache GeodeDevelopment
h2databaseH2 DatabaseDevelopment
hbaseApache HBaseDevelopment
hiveApache HiveDevelopment
hsqldbHyperSQL DatabaseDevelopment
ibm.db2IBM Db2Development
ibm.informixIBM InformixDevelopment
ibm.netezzaIBM NetezzaDevelopment
influxdbInfluxDBDevelopment
instantdbInstantDevelopment
intersystems.cacheInterSystems CachéDevelopment
mariadbMariaDBStable
memcachedMemcachedDevelopment
microsoft.sql_serverMicrosoft SQL ServerStable
mongodbMongoDBDevelopment
mysqlMySQLStable
neo4jNeo4jDevelopment
opensearchOpenSearchDevelopment
oracle.dbOracle DatabaseDevelopment
other_sqlSome other SQL database. Fallback only.Development
postgresqlPostgreSQLStable
redisRedisDevelopment
sap.hanaSAP HANADevelopment
sap.maxdbSAP MaxDBDevelopment
softwareag.adabasAdabas (Adaptable Database System)Development
sqliteSQLiteDevelopment
teradataTeradataDevelopment
trinoTrinoDevelopment

Metric: db.client.connection.limit

This metric is recommended.

NameInstrument TypeUnit (UCUM)DescriptionStabilityEntity Associations
db.client.connection.limitUpDownCounter{connection}The maximum number of open connections allowed.Development

Attributes:

KeyStabilityRequirement LevelValue TypeDescriptionExample Values
db.client.connection.pool.nameDevelopmentRequiredstringThe name of the connection pool. If the connection pool does not have a name, instrumentation SHOULD use db.namespace; otherwise server.address, with server.port appended using : if set. When appending a port to an IPv6 address, instrumentation MUST enclose the address in square brackets. If server.address is not available, instrumentation SHOULD use db.system.name; otherwise the connection pool library name.myDataSource
db.namespaceStableConditionally Required If available.stringThe name of the database, fully qualified within the server address and port. [1]customers; test.users
db.system.nameStableConditionally Required If available.stringThe database management system (DBMS) product as identified by the client instrumentation. [2]other_sql; softwareag.adabas; actian.ingres (see more)
server.portStableConditionally Required [3]intServer port number. [4]80; 8080; 443
server.addressStableRecommendedstringThe database address specified in the client configuration. [5]example.com; 10.1.2.80; /tmp/my.sock

[1] db.namespace: If a database system has multiple namespace components, they SHOULD be concatenated from the most general to the most specific namespace component, using | as a separator between the components. Any missing components (and their associated separators) SHOULD be omitted. 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.

[2] db.system.name: 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.name is set to postgresql based on the instrumentation’s best knowledge.

[3] server.port: If server.address is set and the client is configured with a single database server endpoint that uses a non-default port.

[4] server.port: server.port SHOULD reflect the database port specified in the client configuration. It SHOULD NOT be derived from the server selected for an operation.

[5] server.address: Instrumentation SHOULD set server.address to the database address specified in the client configuration. It SHOULD NOT derive the value from the server selected for an operation.

See Database server address for guidance and examples.


db.system.name 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.

ValueDescriptionStability
actian.ingresActian IngresDevelopment
aws.dynamodbAmazon DynamoDBDevelopment
aws.redshiftAmazon RedshiftDevelopment
azure.cosmosdbAzure Cosmos DBDevelopment
cassandraApache CassandraDevelopment
clickhouseClickHouseDevelopment
cockroachdbCockroachDBDevelopment
couchbaseCouchbaseDevelopment
couchdbApache CouchDBDevelopment
derbyApache DerbyDevelopment
elasticsearchElasticsearchDevelopment
firebirdsqlFirebirdDevelopment
gcp.spannerGoogle Cloud SpannerDevelopment
geodeApache GeodeDevelopment
h2databaseH2 DatabaseDevelopment
hbaseApache HBaseDevelopment
hiveApache HiveDevelopment
hsqldbHyperSQL DatabaseDevelopment
ibm.db2IBM Db2Development
ibm.informixIBM InformixDevelopment
ibm.netezzaIBM NetezzaDevelopment
influxdbInfluxDBDevelopment
instantdbInstantDevelopment
intersystems.cacheInterSystems CachéDevelopment
mariadbMariaDBStable
memcachedMemcachedDevelopment
microsoft.sql_serverMicrosoft SQL ServerStable
mongodbMongoDBDevelopment
mysqlMySQLStable
neo4jNeo4jDevelopment
opensearchOpenSearchDevelopment
oracle.dbOracle DatabaseDevelopment
other_sqlSome other SQL database. Fallback only.Development
postgresqlPostgreSQLStable
redisRedisDevelopment
sap.hanaSAP HANADevelopment
sap.maxdbSAP MaxDBDevelopment
softwareag.adabasAdabas (Adaptable Database System)Development
sqliteSQLiteDevelopment
teradataTeradataDevelopment
trinoTrinoDevelopment

Metric: db.client.connection.pending_requests

This metric is recommended.

NameInstrument TypeUnit (UCUM)DescriptionStabilityEntity Associations
db.client.connection.pending_requestsUpDownCounter{request}The number of current pending requests for an open connection.Development

Attributes:

KeyStabilityRequirement LevelValue TypeDescriptionExample Values
db.client.connection.pool.nameDevelopmentRequiredstringThe name of the connection pool. If the connection pool does not have a name, instrumentation SHOULD use db.namespace; otherwise server.address, with server.port appended using : if set. When appending a port to an IPv6 address, instrumentation MUST enclose the address in square brackets. If server.address is not available, instrumentation SHOULD use db.system.name; otherwise the connection pool library name.myDataSource
db.namespaceStableConditionally Required If available.stringThe name of the database, fully qualified within the server address and port. [1]customers; test.users
db.system.nameStableConditionally Required If available.stringThe database management system (DBMS) product as identified by the client instrumentation. [2]other_sql; softwareag.adabas; actian.ingres (see more)
server.portStableConditionally Required [3]intServer port number. [4]80; 8080; 443
server.addressStableRecommendedstringThe database address specified in the client configuration. [5]example.com; 10.1.2.80; /tmp/my.sock

[1] db.namespace: If a database system has multiple namespace components, they SHOULD be concatenated from the most general to the most specific namespace component, using | as a separator between the components. Any missing components (and their associated separators) SHOULD be omitted. 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.

[2] db.system.name: 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.name is set to postgresql based on the instrumentation’s best knowledge.

[3] server.port: If server.address is set and the client is configured with a single database server endpoint that uses a non-default port.

[4] server.port: server.port SHOULD reflect the database port specified in the client configuration. It SHOULD NOT be derived from the server selected for an operation.

[5] server.address: Instrumentation SHOULD set server.address to the database address specified in the client configuration. It SHOULD NOT derive the value from the server selected for an operation.

See Database server address for guidance and examples.


db.system.name 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.

ValueDescriptionStability
actian.ingresActian IngresDevelopment
aws.dynamodbAmazon DynamoDBDevelopment
aws.redshiftAmazon RedshiftDevelopment
azure.cosmosdbAzure Cosmos DBDevelopment
cassandraApache CassandraDevelopment
clickhouseClickHouseDevelopment
cockroachdbCockroachDBDevelopment
couchbaseCouchbaseDevelopment
couchdbApache CouchDBDevelopment
derbyApache DerbyDevelopment
elasticsearchElasticsearchDevelopment
firebirdsqlFirebirdDevelopment
gcp.spannerGoogle Cloud SpannerDevelopment
geodeApache GeodeDevelopment
h2databaseH2 DatabaseDevelopment
hbaseApache HBaseDevelopment
hiveApache HiveDevelopment
hsqldbHyperSQL DatabaseDevelopment
ibm.db2IBM Db2Development
ibm.informixIBM InformixDevelopment
ibm.netezzaIBM NetezzaDevelopment
influxdbInfluxDBDevelopment
instantdbInstantDevelopment
intersystems.cacheInterSystems CachéDevelopment
mariadbMariaDBStable
memcachedMemcachedDevelopment
microsoft.sql_serverMicrosoft SQL ServerStable
mongodbMongoDBDevelopment
mysqlMySQLStable
neo4jNeo4jDevelopment
opensearchOpenSearchDevelopment
oracle.dbOracle DatabaseDevelopment
other_sqlSome other SQL database. Fallback only.Development
postgresqlPostgreSQLStable
redisRedisDevelopment
sap.hanaSAP HANADevelopment
sap.maxdbSAP MaxDBDevelopment
softwareag.adabasAdabas (Adaptable Database System)Development
sqliteSQLiteDevelopment
teradataTeradataDevelopment
trinoTrinoDevelopment

Metric: db.client.connection.timeouts

This metric is recommended.

NameInstrument TypeUnit (UCUM)DescriptionStabilityEntity Associations
db.client.connection.timeoutsCounter{timeout}The number of connection timeouts that have occurred trying to obtain a connection from the pool.Development

Attributes:

KeyStabilityRequirement LevelValue TypeDescriptionExample Values
db.client.connection.pool.nameDevelopmentRequiredstringThe name of the connection pool. If the connection pool does not have a name, instrumentation SHOULD use db.namespace; otherwise server.address, with server.port appended using : if set. When appending a port to an IPv6 address, instrumentation MUST enclose the address in square brackets. If server.address is not available, instrumentation SHOULD use db.system.name; otherwise the connection pool library name.myDataSource
db.namespaceStableConditionally Required If available.stringThe name of the database, fully qualified within the server address and port. [1]customers; test.users
db.system.nameStableConditionally Required If available.stringThe database management system (DBMS) product as identified by the client instrumentation. [2]other_sql; softwareag.adabas; actian.ingres (see more)
server.portStableConditionally Required [3]intServer port number. [4]80; 8080; 443
server.addressStableRecommendedstringThe database address specified in the client configuration. [5]example.com; 10.1.2.80; /tmp/my.sock

[1] db.namespace: If a database system has multiple namespace components, they SHOULD be concatenated from the most general to the most specific namespace component, using | as a separator between the components. Any missing components (and their associated separators) SHOULD be omitted. 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.

[2] db.system.name: 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.name is set to postgresql based on the instrumentation’s best knowledge.

[3] server.port: If server.address is set and the client is configured with a single database server endpoint that uses a non-default port.

[4] server.port: server.port SHOULD reflect the database port specified in the client configuration. It SHOULD NOT be derived from the server selected for an operation.

[5] server.address: Instrumentation SHOULD set server.address to the database address specified in the client configuration. It SHOULD NOT derive the value from the server selected for an operation.

See Database server address for guidance and examples.


db.system.name 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.

ValueDescriptionStability
actian.ingresActian IngresDevelopment
aws.dynamodbAmazon DynamoDBDevelopment
aws.redshiftAmazon RedshiftDevelopment
azure.cosmosdbAzure Cosmos DBDevelopment
cassandraApache CassandraDevelopment
clickhouseClickHouseDevelopment
cockroachdbCockroachDBDevelopment
couchbaseCouchbaseDevelopment
couchdbApache CouchDBDevelopment
derbyApache DerbyDevelopment
elasticsearchElasticsearchDevelopment
firebirdsqlFirebirdDevelopment
gcp.spannerGoogle Cloud SpannerDevelopment
geodeApache GeodeDevelopment
h2databaseH2 DatabaseDevelopment
hbaseApache HBaseDevelopment
hiveApache HiveDevelopment
hsqldbHyperSQL DatabaseDevelopment
ibm.db2IBM Db2Development
ibm.informixIBM InformixDevelopment
ibm.netezzaIBM NetezzaDevelopment
influxdbInfluxDBDevelopment
instantdbInstantDevelopment
intersystems.cacheInterSystems CachéDevelopment
mariadbMariaDBStable
memcachedMemcachedDevelopment
microsoft.sql_serverMicrosoft SQL ServerStable
mongodbMongoDBDevelopment
mysqlMySQLStable
neo4jNeo4jDevelopment
opensearchOpenSearchDevelopment
oracle.dbOracle DatabaseDevelopment
other_sqlSome other SQL database. Fallback only.Development
postgresqlPostgreSQLStable
redisRedisDevelopment
sap.hanaSAP HANADevelopment
sap.maxdbSAP MaxDBDevelopment
softwareag.adabasAdabas (Adaptable Database System)Development
sqliteSQLiteDevelopment
teradataTeradataDevelopment
trinoTrinoDevelopment

Metric: db.client.connection.create_time

This metric is recommended.

NameInstrument TypeUnit (UCUM)DescriptionStabilityEntity Associations
db.client.connection.create_timeHistogramsThe time it took to create a new connection.Development

Attributes:

KeyStabilityRequirement LevelValue TypeDescriptionExample Values
db.client.connection.pool.nameDevelopmentRequiredstringThe name of the connection pool. If the connection pool does not have a name, instrumentation SHOULD use db.namespace; otherwise server.address, with server.port appended using : if set. When appending a port to an IPv6 address, instrumentation MUST enclose the address in square brackets. If server.address is not available, instrumentation SHOULD use db.system.name; otherwise the connection pool library name.myDataSource
db.namespaceStableConditionally Required If available.stringThe name of the database, fully qualified within the server address and port. [1]customers; test.users
db.system.nameStableConditionally Required If available.stringThe database management system (DBMS) product as identified by the client instrumentation. [2]other_sql; softwareag.adabas; actian.ingres (see more)
server.portStableConditionally Required [3]intServer port number. [4]80; 8080; 443
server.addressStableRecommendedstringThe database address specified in the client configuration. [5]example.com; 10.1.2.80; /tmp/my.sock

[1] db.namespace: If a database system has multiple namespace components, they SHOULD be concatenated from the most general to the most specific namespace component, using | as a separator between the components. Any missing components (and their associated separators) SHOULD be omitted. 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.

[2] db.system.name: 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.name is set to postgresql based on the instrumentation’s best knowledge.

[3] server.port: If server.address is set and the client is configured with a single database server endpoint that uses a non-default port.

[4] server.port: server.port SHOULD reflect the database port specified in the client configuration. It SHOULD NOT be derived from the server selected for an operation.

[5] server.address: Instrumentation SHOULD set server.address to the database address specified in the client configuration. It SHOULD NOT derive the value from the server selected for an operation.

See Database server address for guidance and examples.


db.system.name 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.

ValueDescriptionStability
actian.ingresActian IngresDevelopment
aws.dynamodbAmazon DynamoDBDevelopment
aws.redshiftAmazon RedshiftDevelopment
azure.cosmosdbAzure Cosmos DBDevelopment
cassandraApache CassandraDevelopment
clickhouseClickHouseDevelopment
cockroachdbCockroachDBDevelopment
couchbaseCouchbaseDevelopment
couchdbApache CouchDBDevelopment
derbyApache DerbyDevelopment
elasticsearchElasticsearchDevelopment
firebirdsqlFirebirdDevelopment
gcp.spannerGoogle Cloud SpannerDevelopment
geodeApache GeodeDevelopment
h2databaseH2 DatabaseDevelopment
hbaseApache HBaseDevelopment
hiveApache HiveDevelopment
hsqldbHyperSQL DatabaseDevelopment
ibm.db2IBM Db2Development
ibm.informixIBM InformixDevelopment
ibm.netezzaIBM NetezzaDevelopment
influxdbInfluxDBDevelopment
instantdbInstantDevelopment
intersystems.cacheInterSystems CachéDevelopment
mariadbMariaDBStable
memcachedMemcachedDevelopment
microsoft.sql_serverMicrosoft SQL ServerStable
mongodbMongoDBDevelopment
mysqlMySQLStable
neo4jNeo4jDevelopment
opensearchOpenSearchDevelopment
oracle.dbOracle DatabaseDevelopment
other_sqlSome other SQL database. Fallback only.Development
postgresqlPostgreSQLStable
redisRedisDevelopment
sap.hanaSAP HANADevelopment
sap.maxdbSAP MaxDBDevelopment
softwareag.adabasAdabas (Adaptable Database System)Development
sqliteSQLiteDevelopment
teradataTeradataDevelopment
trinoTrinoDevelopment

Metric: db.client.connection.wait_time

This metric is recommended.

NameInstrument TypeUnit (UCUM)DescriptionStabilityEntity Associations
db.client.connection.wait_timeHistogramsThe time it took to obtain an open connection from the pool.Development

Attributes:

KeyStabilityRequirement LevelValue TypeDescriptionExample Values
db.client.connection.pool.nameDevelopmentRequiredstringThe name of the connection pool. If the connection pool does not have a name, instrumentation SHOULD use db.namespace; otherwise server.address, with server.port appended using : if set. When appending a port to an IPv6 address, instrumentation MUST enclose the address in square brackets. If server.address is not available, instrumentation SHOULD use db.system.name; otherwise the connection pool library name.myDataSource
db.namespaceStableConditionally Required If available.stringThe name of the database, fully qualified within the server address and port. [1]customers; test.users
db.system.nameStableConditionally Required If available.stringThe database management system (DBMS) product as identified by the client instrumentation. [2]other_sql; softwareag.adabas; actian.ingres (see more)
server.portStableConditionally Required [3]intServer port number. [4]80; 8080; 443
server.addressStableRecommendedstringThe database address specified in the client configuration. [5]example.com; 10.1.2.80; /tmp/my.sock

[1] db.namespace: If a database system has multiple namespace components, they SHOULD be concatenated from the most general to the most specific namespace component, using | as a separator between the components. Any missing components (and their associated separators) SHOULD be omitted. 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.

[2] db.system.name: 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.name is set to postgresql based on the instrumentation’s best knowledge.

[3] server.port: If server.address is set and the client is configured with a single database server endpoint that uses a non-default port.

[4] server.port: server.port SHOULD reflect the database port specified in the client configuration. It SHOULD NOT be derived from the server selected for an operation.

[5] server.address: Instrumentation SHOULD set server.address to the database address specified in the client configuration. It SHOULD NOT derive the value from the server selected for an operation.

See Database server address for guidance and examples.


db.system.name 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.

ValueDescriptionStability
actian.ingresActian IngresDevelopment
aws.dynamodbAmazon DynamoDBDevelopment
aws.redshiftAmazon RedshiftDevelopment
azure.cosmosdbAzure Cosmos DBDevelopment
cassandraApache CassandraDevelopment
clickhouseClickHouseDevelopment
cockroachdbCockroachDBDevelopment
couchbaseCouchbaseDevelopment
couchdbApache CouchDBDevelopment
derbyApache DerbyDevelopment
elasticsearchElasticsearchDevelopment
firebirdsqlFirebirdDevelopment
gcp.spannerGoogle Cloud SpannerDevelopment
geodeApache GeodeDevelopment
h2databaseH2 DatabaseDevelopment
hbaseApache HBaseDevelopment
hiveApache HiveDevelopment
hsqldbHyperSQL DatabaseDevelopment
ibm.db2IBM Db2Development
ibm.informixIBM InformixDevelopment
ibm.netezzaIBM NetezzaDevelopment
influxdbInfluxDBDevelopment
instantdbInstantDevelopment
intersystems.cacheInterSystems CachéDevelopment
mariadbMariaDBStable
memcachedMemcachedDevelopment
microsoft.sql_serverMicrosoft SQL ServerStable
mongodbMongoDBDevelopment
mysqlMySQLStable
neo4jNeo4jDevelopment
opensearchOpenSearchDevelopment
oracle.dbOracle DatabaseDevelopment
other_sqlSome other SQL database. Fallback only.Development
postgresqlPostgreSQLStable
redisRedisDevelopment
sap.hanaSAP HANADevelopment
sap.maxdbSAP MaxDBDevelopment
softwareag.adabasAdabas (Adaptable Database System)Development
sqliteSQLiteDevelopment
teradataTeradataDevelopment
trinoTrinoDevelopment

Metric: db.client.connection.use_time

This metric is recommended.

NameInstrument TypeUnit (UCUM)DescriptionStabilityEntity Associations
db.client.connection.use_timeHistogramsThe time between borrowing a connection and returning it to the pool.Development

Attributes:

KeyStabilityRequirement LevelValue TypeDescriptionExample Values
db.client.connection.pool.nameDevelopmentRequiredstringThe name of the connection pool. If the connection pool does not have a name, instrumentation SHOULD use db.namespace; otherwise server.address, with server.port appended using : if set. When appending a port to an IPv6 address, instrumentation MUST enclose the address in square brackets. If server.address is not available, instrumentation SHOULD use db.system.name; otherwise the connection pool library name.myDataSource
db.namespaceStableConditionally Required If available.stringThe name of the database, fully qualified within the server address and port. [1]customers; test.users
db.system.nameStableConditionally Required If available.stringThe database management system (DBMS) product as identified by the client instrumentation. [2]other_sql; softwareag.adabas; actian.ingres (see more)
server.portStableConditionally Required [3]intServer port number. [4]80; 8080; 443
server.addressStableRecommendedstringThe database address specified in the client configuration. [5]example.com; 10.1.2.80; /tmp/my.sock

[1] db.namespace: If a database system has multiple namespace components, they SHOULD be concatenated from the most general to the most specific namespace component, using | as a separator between the components. Any missing components (and their associated separators) SHOULD be omitted. 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.

[2] db.system.name: 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.name is set to postgresql based on the instrumentation’s best knowledge.

[3] server.port: If server.address is set and the client is configured with a single database server endpoint that uses a non-default port.

[4] server.port: server.port SHOULD reflect the database port specified in the client configuration. It SHOULD NOT be derived from the server selected for an operation.

[5] server.address: Instrumentation SHOULD set server.address to the database address specified in the client configuration. It SHOULD NOT derive the value from the server selected for an operation.

See Database server address for guidance and examples.


db.system.name 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.

ValueDescriptionStability
actian.ingresActian IngresDevelopment
aws.dynamodbAmazon DynamoDBDevelopment
aws.redshiftAmazon RedshiftDevelopment
azure.cosmosdbAzure Cosmos DBDevelopment
cassandraApache CassandraDevelopment
clickhouseClickHouseDevelopment
cockroachdbCockroachDBDevelopment
couchbaseCouchbaseDevelopment
couchdbApache CouchDBDevelopment
derbyApache DerbyDevelopment
elasticsearchElasticsearchDevelopment
firebirdsqlFirebirdDevelopment
gcp.spannerGoogle Cloud SpannerDevelopment
geodeApache GeodeDevelopment
h2databaseH2 DatabaseDevelopment
hbaseApache HBaseDevelopment
hiveApache HiveDevelopment
hsqldbHyperSQL DatabaseDevelopment
ibm.db2IBM Db2Development
ibm.informixIBM InformixDevelopment
ibm.netezzaIBM NetezzaDevelopment
influxdbInfluxDBDevelopment
instantdbInstantDevelopment
intersystems.cacheInterSystems CachéDevelopment
mariadbMariaDBStable
memcachedMemcachedDevelopment
microsoft.sql_serverMicrosoft SQL ServerStable
mongodbMongoDBDevelopment
mysqlMySQLStable
neo4jNeo4jDevelopment
opensearchOpenSearchDevelopment
oracle.dbOracle DatabaseDevelopment
other_sqlSome other SQL database. Fallback only.Development
postgresqlPostgreSQLStable
redisRedisDevelopment
sap.hanaSAP HANADevelopment
sap.maxdbSAP MaxDBDevelopment
softwareag.adabasAdabas (Adaptable Database System)Development
sqliteSQLiteDevelopment
teradataTeradataDevelopment
trinoTrinoDevelopment