Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .chloggen/db_client_connection_metric.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Use this changelog template to create an entry for release notes.
#
# If your change doesn't affect end users you should instead start
# your pull request title with [chore] or use the "Skip Changelog" label.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: breaking

# The name of the area of concern in the attributes-registry, (e.g. http, cloud, db)
component: db

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Rename `db.client.connections.usage` to `db.client.connections.count`.

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
# The values here must be integers.
issues: [201]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:
10 changes: 5 additions & 5 deletions docs/database/database-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ and attributes but more may be added in the future.
- [Database operation](#database-operation)
- [Metric: `db.client.operation.duration`](#metric-dbclientoperationduration)
- [Connection pools](#connection-pools)
- [Metric: `db.client.connections.usage`](#metric-dbclientconnectionsusage)
- [Metric: `db.client.connections.count`](#metric-dbclientconnectionscount)
- [Metric: `db.client.connections.idle.max`](#metric-dbclientconnectionsidlemax)
- [Metric: `db.client.connections.idle.min`](#metric-dbclientconnectionsidlemin)
- [Metric: `db.client.connections.max`](#metric-dbclientconnectionsmax)
Expand Down Expand Up @@ -150,17 +150,17 @@ If a database operation involved multiple network calls (for example retries), t

The following metric instruments describe database client connection pool operations.

### Metric: `db.client.connections.usage`
### Metric: `db.client.connections.count`

This metric is [required][MetricRequired].

<!-- semconv metric.db.client.connections.usage(metric_table) -->
<!-- semconv metric.db.client.connections.count(metric_table) -->
| Name | Instrument Type | Unit (UCUM) | Description | Stability |
| -------- | --------------- | ----------- | -------------- | --------- |
| `db.client.connections.usage` | UpDownCounter | `{connection}` | The number of connections that are currently in state described by the `state` attribute | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `db.client.connections.count` | UpDownCounter | `{connection}` | The number of connections that are currently in state described by the `state` attribute | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
<!-- endsemconv -->

<!-- semconv metric.db.client.connections.usage(full) -->
<!-- semconv metric.db.client.connections.count(full) -->
| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
|---|---|---|---|---|---|
| [`db.client.connections.pool.name`](../attributes-registry/db.md) | 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 `server.address` and `server.port` attributes formatted as `server.address:server.port`. | `myDataSource` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
Expand Down
4 changes: 2 additions & 2 deletions model/metrics/database-metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ groups:
stability: experimental
extends: attributes.db.client

- id: metric.db.client.connections.usage
- id: metric.db.client.connections.count
type: metric
metric_name: db.client.connections.usage
metric_name: db.client.connections.count
stability: experimental
brief: "The number of connections that are currently in state described by the `state` attribute"
instrument: updowncounter
Expand Down
3 changes: 3 additions & 0 deletions schema-next.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ versions:
next:
metrics:
changes:
#
- rename_metrics:
db.client.connections.usage: db.client.connections.count
# https://github.com/open-telemetry/semantic-conventions/pull/909
- rename_attributes:
attribute_map:
Expand Down