Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename db.client.connections.* metrics to db.client.connection.* and rename db.client.connection.usage to db.client.connection.count and adapting units #966

Merged
Merged
Show file tree
Hide file tree
Changes from 9 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
24 changes: 24 additions & 0 deletions .chloggen/db_client_connection_metric.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# 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.*` metric namespace to `db.client.connection.*` and
rename `db.client.connection.usage` to `db.client.connection.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, 967]

# (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)
trask marked this conversation as resolved.
Show resolved Hide resolved
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
lmolkova marked this conversation as resolved.
Show resolved Hide resolved
- id: metric.db.client.connections.count
type: metric
metric_name: db.client.connections.usage
metric_name: db.client.connections.count
trask marked this conversation as resolved.
Show resolved Hide resolved
stability: experimental
brief: "The number of connections that are currently in state described by the `state` attribute"
instrument: updowncounter
Expand Down
110 changes: 110 additions & 0 deletions model/metrics/deprecated/database.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
groups:
- id: metric.deprecated.db.client.connections.count
gregkalapos marked this conversation as resolved.
Show resolved Hide resolved
type: metric
metric_name: db.client.connections.usage
stability: experimental
deprecated: "Replaced by `db.client.connection.count`."
brief: "Deprecated, use `db.client.connection.count` instead."
instrument: updowncounter
unit: "{connection}"
attributes:
- ref: db.client.connections.state
requirement_level: required
- ref: db.client.connections.pool.name
requirement_level: required

- id: metric.deprecated.db.client.connections.idle.max
type: metric
metric_name: db.client.connections.idle.max
stability: experimental
deprecated: "Replaced by `db.client.connection.idle.max`."
brief: "Deprecated, use `db.client.connection.idle.max` instead."
instrument: updowncounter
unit: "{connection}"
attributes:
- ref: db.client.connections.pool.name
requirement_level: required

- id: metric.deprecated.db.client.connections.idle.min
type: metric
metric_name: db.client.connections.idle.min
stability: experimental
deprecated: "Replaced by `db.client.connection.idle.min`."
brief: "Deprecated, use `db.client.connection.idle.min` instead."
instrument: updowncounter
unit: "{connection}"
attributes:
- ref: db.client.connections.pool.name
requirement_level: required

- id: metric.deprecated.db.client.connections.max
type: metric
metric_name: db.client.connections.max
stability: experimental
deprecated: "Replaced by `db.client.connection.max`."
brief: "Deprecated, use `db.client.connection.max` instead."
instrument: updowncounter
unit: "{connection}"
attributes:
- ref: db.client.connections.pool.name
requirement_level: required

- id: metric.deprecated.db.client.connections.pending_requests
type: metric
metric_name: db.client.connections.pending_requests
stability: experimental
deprecated: "Replaced by `db.client.connection.pending_requests`."
brief: "Deprecated, use `db.client.connection.pending_requests` instead."
instrument: updowncounter
unit: "{request}"
attributes:
- ref: db.client.connections.pool.name
requirement_level: required

- id: metric.deprecated.db.client.connections.timeouts
type: metric
metric_name: db.client.connections.timeouts
stability: experimental
deprecated: "Replaced by `db.client.connection.timeouts`."
brief: "Deprecated, use `db.client.connection.timeouts` instead."
instrument: counter
unit: "{timeout}"
attributes:
- ref: db.client.connections.pool.name
requirement_level: required

- id: metric.deprecated.db.client.connections.create_time
type: metric
metric_name: db.client.connections.create_time
stability: experimental
deprecated: "Replaced by `db.client.connection.create_time`."
brief: "Deprecated, use `db.client.connection.create_time` instead."
instrument: histogram
unit: "ms"
attributes:
- ref: db.client.connections.pool.name
requirement_level: required

- id: metric.deprecated.db.client.connections.wait_time
type: metric
metric_name: db.client.connections.wait_time
stability: experimental
deprecated: "Replaced by `db.client.connection.wait_time`."
brief: "Deprecated, use `db.client.connection.wait_time` instead."
instrument: histogram
unit: "ms"
attributes:
- ref: db.client.connections.pool.name
requirement_level: required

- id: metric.deprecated.db.client.connections.use_time
type: metric
metric_name: db.client.connections.use_time
stability: experimental
deprecated: "Replaced by `db.client.connection.use_time`."
brief: "Deprecated, use `db.client.connection.use_time` instead."
lmolkova marked this conversation as resolved.
Show resolved Hide resolved
instrument: histogram
unit: "ms"
attributes:
- ref: db.client.connections.pool.name
requirement_level: required
11 changes: 11 additions & 0 deletions schema-next.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ versions:
next:
metrics:
changes:
# https://github.com/open-telemetry/semantic-conventions/pull/966
- rename_metrics:
db.client.connections.usage: db.client.connection.count
db.client.connections.idle.max: db.client.connection.idle.max
db.client.connections.idle.min: db.client.connection.idle.min
db.client.connections.max: db.client.connection.max
db.client.connections.pending_requests: db.client.connection.pending_requests
db.client.connections.timeouts: db.client.connection.timeouts
trask marked this conversation as resolved.
Show resolved Hide resolved
db.client.connections.create_time: db.client.connection.create_time
db.client.connections.wait_time: db.client.connection.wait_time
db.client.connections.use_time: db.client.connection.use_time
# https://github.com/open-telemetry/semantic-conventions/pull/909
- rename_attributes:
attribute_map:
Expand Down
Loading