Semantic Conventions for Database Metrics
The conventions described in this section are specific to SQL and NoSQL clients.
Disclaimer: These are initial database client metric instruments and attributes but more may be added in the future.
The following metric instruments MUST be used to describe database client operations. They MUST be of the specified type and units.
Below is a table of database client connection pool metric instruments that MUST be used by connection pool instrumentations:
|UpDownCounter||connections||The number of connections that are currently in state described by the |
db.client.connections.usage measurements MUST include the following attribute:
|string||The state of a connection in the pool. Valid values include: ||Required|
Instrumentation libraries for database client connection pools that collect data for the following data MUST use the following metric instruments. Otherwise, if the instrumentation library does not collect this data, these instruments MUST NOT be used.
|Name||Instrument (*)||Unit||Unit (UCUM)||Description|
|UpDownCounter||connections||The maximum number of idle open connections allowed.|
|UpDownCounter||connections||The minimum number of idle open connections allowed.|
|UpDownCounter||connections||The maximum number of open connections allowed.|
|UpDownCounter||requests||The number of pending requests for an open connection, cumulative for the entire pool.|
|Counter||timeouts||The number of connection timeouts that have occurred trying to obtain a connection from the pool.|
|Histogram||milliseconds||The time it took to create a new connection.|
|Histogram||milliseconds||The time it took to obtain an open connection from the pool.|
|Histogram||milliseconds||The time between borrowing a connection and returning it to the pool.|
Below is a table of the attributes that MUST be included on all connection pool measurements:
|string||The name of the connection pool; unique within the instrumented application.||Required|