Skip to content

Commit

Permalink
code review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Mateusz Rzeszutek committed Mar 28, 2022
1 parent 524f0d0 commit 64e84a9
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions specification/metrics/semantic_conventions/database-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,34 +25,34 @@ and units.
Below is a table of database client connection pool metric instruments that MUST be used by connection pool
instrumentations:

| Name | Instrument | Unit | Unit ([UCUM](README.md#instrument-units)) | Description |
|------------------------|----------------------------|-------------|-------------------------------------------|-------------|
| `db.connections.usage` | Asynchronous UpDownCounter | connections | `{connections}` | The number of connections that are currently in state described by the `state` attribute.
| Name | Instrument | Unit | Unit ([UCUM](README.md#instrument-units)) | Description |
|-------------------------------|----------------------------|-------------|-------------------------------------------|-------------------------------------------------------------------------------------------|
| `db.client.connections.usage` | Asynchronous UpDownCounter | connections | `{connections}` | The number of connections that are currently in state described by the `state` attribute. |

All `db.connections.usage` measurements MUST include the following attribute:
All `db.client.connections.usage` measurements MUST include the following attribute:

| Name | Type | Description | Examples | Required |
|---------|--------|------------------------------------------------------------------------------|----------|----------|
| `state` | string | The state of a connection in the pool. Valid values include: `idle`, `used`. | `idle` | Yes |

Instrumentation libraries for database server connection pools that collect data for the following data MUST use the
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](README.md#instrument-units)) | Description |
|-----------------------------------|----------------------------|--------------|-------------------------------------------|-------------|
| `db.connections.idle.max` | Asynchronous UpDownCounter | connections | `{connections}` | The maximum number of idle open connections allowed.
| `db.connections.idle.min` | Asynchronous UpDownCounter | connections | `{connections}` | The minimum number of idle open connections allowed.
| `db.connections.max` | Asynchronous UpDownCounter | connections | `{connections}` | The maximum number of open connections allowed.
| `db.connections.waiting_requests` | Asynchronous UpDownCounter | requests | `{requests}` | The number of pending requests for an open connection.
| `db.connections.timeouts` | Counter | timeouts | `{timeouts}` | The number of connection timeouts that have happened since the application start.
| `db.connections.time` | Histogram | milliseconds | `ms` | The time it took to apply an operation described by the `operation` attribute.
| Name | Instrument | Unit | Unit ([UCUM](README.md#instrument-units)) | Description |
|------------------------------------------|----------------------------|--------------|-------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------|
| `db.client.connections.idle.max` | Asynchronous UpDownCounter | connections | `{connections}` | The maximum number of idle open connections allowed. |
| `db.client.connections.idle.min` | Asynchronous UpDownCounter | connections | `{connections}` | The minimum number of idle open connections allowed. |
| `db.client.connections.max` | Asynchronous UpDownCounter | connections | `{connections}` | The maximum number of open connections allowed. |
| `db.client.connections.waiting_requests` | Asynchronous UpDownCounter | requests | `{requests}` | The number of pending requests for an open connection, cumulative for the entire pool. |
| `db.client.connections.timeouts` | Counter | timeouts | `{timeouts}` | The number of connection timeouts happened when trying to obtaing a connection from the pool that have happened since the application start. |
| `db.client.connections.time` | Histogram | milliseconds | `ms` | The time it took to apply an operation described by the `operation` attribute. |

All `db.connections.time` measurements MUST include the following attribute:
All `db.client.connections.time` measurements MUST include the following attribute:

| Name | Type | Description | Examples | Required |
|-------------|--------|-----------------------------------------------------------------------------------------------|----------|----------|
| `operation` | string | The type of operation applied to a connection. Valid values include: `create`, `use`, `wait`. | `create` | Yes |
| Name | Type | Description | Examples | Required |
|-------------|--------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|----------|
| `operation` | string | The type of operation applied to a connection. Valid values include: `create` (time it took to create a new connection), `use` (time spent using a connection obtained from the pool), `wait` (time spent waiting for an open connection). | `create` | Yes |

Below is a table of the attributes that MUST be included on all connection pool measurements:

Expand Down

0 comments on commit 64e84a9

Please sign in to comment.