From 33d2ef7a7aeede9122c8550a41def9b95c410688 Mon Sep 17 00:00:00 2001 From: Greg Kalapos Date: Wed, 24 Apr 2024 21:48:33 +0200 Subject: [PATCH 01/12] Rename `db.client.connections.usage` to `db.client.connections.count` --- .chloggen/db_client_connection_metric.yaml | 22 ++++++++++++++++++++++ docs/database/database-metrics.md | 6 +++--- model/metrics/database-metrics.yaml | 4 ++-- schema-next.yaml | 3 +++ 4 files changed, 30 insertions(+), 5 deletions(-) create mode 100755 .chloggen/db_client_connection_metric.yaml diff --git a/.chloggen/db_client_connection_metric.yaml b/.chloggen/db_client_connection_metric.yaml new file mode 100755 index 0000000000..f76b0241e3 --- /dev/null +++ b/.chloggen/db_client_connection_metric.yaml @@ -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: diff --git a/docs/database/database-metrics.md b/docs/database/database-metrics.md index e8b648820b..5d26054965 100644 --- a/docs/database/database-metrics.md +++ b/docs/database/database-metrics.md @@ -154,13 +154,13 @@ The following metric instruments describe database client connection pool operat This metric is [required][MetricRequired]. - + | 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) | - + | 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) | diff --git a/model/metrics/database-metrics.yaml b/model/metrics/database-metrics.yaml index ec8f61c55c..8ea3acdd91 100644 --- a/model/metrics/database-metrics.yaml +++ b/model/metrics/database-metrics.yaml @@ -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 diff --git a/schema-next.yaml b/schema-next.yaml index 85bfa85d72..ab86b92dcf 100644 --- a/schema-next.yaml +++ b/schema-next.yaml @@ -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: From f4d76a65cb5cbde9ac4cb6ffe988013d8023f294 Mon Sep 17 00:00:00 2001 From: Greg Kalapos Date: Wed, 24 Apr 2024 21:52:50 +0200 Subject: [PATCH 02/12] Update database-metrics.md --- docs/database/database-metrics.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/database/database-metrics.md b/docs/database/database-metrics.md index 5d26054965..5d779ee295 100644 --- a/docs/database/database-metrics.md +++ b/docs/database/database-metrics.md @@ -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) @@ -150,7 +150,7 @@ 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]. From fea988fa07c125fb3bb6e36d6e8a9991dace0b33 Mon Sep 17 00:00:00 2001 From: Greg Kalapos Date: Wed, 24 Apr 2024 21:59:44 +0200 Subject: [PATCH 03/12] Update schema-next.yaml --- schema-next.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/schema-next.yaml b/schema-next.yaml index ab86b92dcf..e414c7010a 100644 --- a/schema-next.yaml +++ b/schema-next.yaml @@ -4,7 +4,7 @@ versions: next: metrics: changes: - # + # https://github.com/open-telemetry/semantic-conventions/pull/966 - rename_metrics: db.client.connections.usage: db.client.connections.count # https://github.com/open-telemetry/semantic-conventions/pull/909 From 55850b5351cdf6688fca712da90864e31b2094c3 Mon Sep 17 00:00:00 2001 From: Greg Kalapos Date: Wed, 24 Apr 2024 22:05:58 +0200 Subject: [PATCH 04/12] Update database-metrics.yaml --- model/metrics/database-metrics.yaml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/model/metrics/database-metrics.yaml b/model/metrics/database-metrics.yaml index 8ea3acdd91..0aae918ab6 100644 --- a/model/metrics/database-metrics.yaml +++ b/model/metrics/database-metrics.yaml @@ -108,3 +108,16 @@ groups: attributes: - ref: db.client.connections.pool.name requirement_level: required + + - id: metric.db.client.connections.usage + type: metric + metric_name: db.client.connections.usage + stability: experimental + brief: "Deprecated, use `db.client.connections.count` instead." + instrument: updowncounter + unit: "{connection}" + attributes: + - ref: db.client.connections.state + requirement_level: required + - ref: db.client.connections.pool.name + requirement_level: required From 88621185d8beb03612ca67a38f677a9b3e02c36c Mon Sep 17 00:00:00 2001 From: Greg Kalapos Date: Thu, 25 Apr 2024 15:10:39 +0200 Subject: [PATCH 05/12] Rename `db.client.connections.*` to `db.client.connection.*` Solves https://github.com/open-telemetry/semantic-conventions/issues/967 --- .chloggen/db_client_connection_metric.yaml | 4 +- model/metrics/database-metrics.yaml | 13 --- model/metrics/deprecated/database.yaml | 110 +++++++++++++++++++++ schema-next.yaml | 10 +- 4 files changed, 122 insertions(+), 15 deletions(-) create mode 100644 model/metrics/deprecated/database.yaml diff --git a/.chloggen/db_client_connection_metric.yaml b/.chloggen/db_client_connection_metric.yaml index f76b0241e3..d14018401e 100755 --- a/.chloggen/db_client_connection_metric.yaml +++ b/.chloggen/db_client_connection_metric.yaml @@ -10,7 +10,9 @@ change_type: breaking 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`. +note: > + Rename `db.client.connections.*` 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. diff --git a/model/metrics/database-metrics.yaml b/model/metrics/database-metrics.yaml index 0aae918ab6..8ea3acdd91 100644 --- a/model/metrics/database-metrics.yaml +++ b/model/metrics/database-metrics.yaml @@ -108,16 +108,3 @@ groups: attributes: - ref: db.client.connections.pool.name requirement_level: required - - - id: metric.db.client.connections.usage - type: metric - metric_name: db.client.connections.usage - stability: experimental - brief: "Deprecated, use `db.client.connections.count` instead." - instrument: updowncounter - unit: "{connection}" - attributes: - - ref: db.client.connections.state - requirement_level: required - - ref: db.client.connections.pool.name - requirement_level: required diff --git a/model/metrics/deprecated/database.yaml b/model/metrics/deprecated/database.yaml new file mode 100644 index 0000000000..cfe867f504 --- /dev/null +++ b/model/metrics/deprecated/database.yaml @@ -0,0 +1,110 @@ +groups: + - id: db.client.deprecated.client.connections.usage + 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: db.client.deprecated.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: db.client.deprecated.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: db.client.deprecated.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: db.client.deprecated.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: db.client.deprecated.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: db.client.deprecated.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: db.client.deprecated.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: db.client.deprecated.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." + instrument: histogram + unit: "ms" + attributes: + - ref: db.client.connections.pool.name + requirement_level: required diff --git a/schema-next.yaml b/schema-next.yaml index e414c7010a..4b9dfeeb3f 100644 --- a/schema-next.yaml +++ b/schema-next.yaml @@ -6,7 +6,15 @@ versions: changes: # https://github.com/open-telemetry/semantic-conventions/pull/966 - rename_metrics: - db.client.connections.usage: db.client.connections.count + 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 + 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: From 0ebea0fa76ea13f2962a095eef2a16c5497a4e1a Mon Sep 17 00:00:00 2001 From: Greg Kalapos Date: Thu, 25 Apr 2024 15:19:05 +0200 Subject: [PATCH 06/12] Update database.yaml Fix ids --- model/metrics/deprecated/database.yaml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/model/metrics/deprecated/database.yaml b/model/metrics/deprecated/database.yaml index cfe867f504..7b4628872b 100644 --- a/model/metrics/deprecated/database.yaml +++ b/model/metrics/deprecated/database.yaml @@ -1,5 +1,5 @@ groups: - - id: db.client.deprecated.client.connections.usage + - id: metric.deprecated.db.client.connections.count type: metric metric_name: db.client.connections.usage stability: experimental @@ -13,7 +13,7 @@ groups: - ref: db.client.connections.pool.name requirement_level: required - - id: db.client.deprecated.client.connections.idle.max + - id: metric.deprecated.db.client.connections.idle.max type: metric metric_name: db.client.connections.idle.max stability: experimental @@ -25,7 +25,7 @@ groups: - ref: db.client.connections.pool.name requirement_level: required - - id: db.client.deprecated.client.connections.idle.min + - id: metric.deprecated.db.client.connections.idle.min type: metric metric_name: db.client.connections.idle.min stability: experimental @@ -37,7 +37,7 @@ groups: - ref: db.client.connections.pool.name requirement_level: required - - id: db.client.deprecated.client.connections.max + - id: metric.deprecated.db.client.connections.max type: metric metric_name: db.client.connections.max stability: experimental @@ -49,7 +49,7 @@ groups: - ref: db.client.connections.pool.name requirement_level: required - - id: db.client.deprecated.client.connections.pending_requests + - id: metric.deprecated.db.client.connections.pending_requests type: metric metric_name: db.client.connections.pending_requests stability: experimental @@ -61,7 +61,7 @@ groups: - ref: db.client.connections.pool.name requirement_level: required - - id: db.client.deprecated.client.connections.timeouts + - id: metric.deprecated.db.client.connections.timeouts type: metric metric_name: db.client.connections.timeouts stability: experimental @@ -73,7 +73,7 @@ groups: - ref: db.client.connections.pool.name requirement_level: required - - id: db.client.deprecated.client.connections.create_time + - id: metric.deprecated.db.client.connections.create_time type: metric metric_name: db.client.connections.create_time stability: experimental @@ -85,7 +85,7 @@ groups: - ref: db.client.connections.pool.name requirement_level: required - - id: db.client.deprecated.client.connections.wait_time + - id: metric.deprecated.db.client.connections.wait_time type: metric metric_name: db.client.connections.wait_time stability: experimental @@ -97,7 +97,7 @@ groups: - ref: db.client.connections.pool.name requirement_level: required - - id: db.client.deprecated.client.connections.use_time + - id: metric.deprecated.db.client.connections.use_time type: metric metric_name: db.client.connections.use_time stability: experimental From 495bbc4db014178423b3b953e0bd1f062ea37fd2 Mon Sep 17 00:00:00 2001 From: Greg Kalapos Date: Thu, 25 Apr 2024 15:30:46 +0200 Subject: [PATCH 07/12] Update db_client_connection_metric.yaml --- .chloggen/db_client_connection_metric.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.chloggen/db_client_connection_metric.yaml b/.chloggen/db_client_connection_metric.yaml index d14018401e..0c3c9222d8 100755 --- a/.chloggen/db_client_connection_metric.yaml +++ b/.chloggen/db_client_connection_metric.yaml @@ -11,12 +11,12 @@ 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.*` namespace to `db.client.connection.*` and + 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] +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. From 857c693bdfcde38557c4977c9289173fbdc42a23 Mon Sep 17 00:00:00 2001 From: Greg Kalapos Date: Fri, 26 Apr 2024 22:07:59 +0200 Subject: [PATCH 08/12] `connections` -> `connection` --- docs/database/database-metrics.md | 90 ++++++++++++++--------------- model/metrics/database-metrics.yaml | 36 ++++++------ 2 files changed, 63 insertions(+), 63 deletions(-) diff --git a/docs/database/database-metrics.md b/docs/database/database-metrics.md index 5d779ee295..3cc374855d 100644 --- a/docs/database/database-metrics.md +++ b/docs/database/database-metrics.md @@ -18,15 +18,15 @@ 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.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) - - [Metric: `db.client.connections.pending_requests`](#metric-dbclientconnectionspending_requests) - - [Metric: `db.client.connections.timeouts`](#metric-dbclientconnectionstimeouts) - - [Metric: `db.client.connections.create_time`](#metric-dbclientconnectionscreate_time) - - [Metric: `db.client.connections.wait_time`](#metric-dbclientconnectionswait_time) - - [Metric: `db.client.connections.use_time`](#metric-dbclientconnectionsuse_time) + - [Metric: `db.client.connection.count`](#metric-dbclientconnectioncount) + - [Metric: `db.client.connection.idle.max`](#metric-dbclientconnectionidlemax) + - [Metric: `db.client.connection.idle.min`](#metric-dbclientconnectionidlemin) + - [Metric: `db.client.connection.max`](#metric-dbclientconnectionmax) + - [Metric: `db.client.connection.pending_requests`](#metric-dbclientconnectionpending_requests) + - [Metric: `db.client.connection.timeouts`](#metric-dbclientconnectiontimeouts) + - [Metric: `db.client.connection.create_time`](#metric-dbclientconnectioncreate_time) + - [Metric: `db.client.connection.wait_time`](#metric-dbclientconnectionwait_time) + - [Metric: `db.client.connection.use_time`](#metric-dbclientconnectionuse_time) @@ -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.count` +### Metric: `db.client.connection.count` This metric is [required][MetricRequired]. - + | Name | Instrument Type | Unit (UCUM) | Description | Stability | | -------- | --------------- | ----------- | -------------- | --------- | -| `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) | +| `db.client.connection.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) | - + | 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) | @@ -173,129 +173,129 @@ This metric is [required][MetricRequired]. | `idle` | idle | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `used` | used | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -### Metric: `db.client.connections.idle.max` +### Metric: `db.client.connection.idle.max` This metric is [recommended][MetricRecommended]. - + | Name | Instrument Type | Unit (UCUM) | Description | Stability | | -------- | --------------- | ----------- | -------------- | --------- | -| `db.client.connections.idle.max` | UpDownCounter | `{connection}` | The maximum number of idle open connections allowed | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `db.client.connection.idle.max` | UpDownCounter | `{connection}` | The maximum number of idle open connections allowed | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - + | 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) | -### Metric: `db.client.connections.idle.min` +### Metric: `db.client.connection.idle.min` This metric is [recommended][MetricRecommended]. - + | Name | Instrument Type | Unit (UCUM) | Description | Stability | | -------- | --------------- | ----------- | -------------- | --------- | -| `db.client.connections.idle.min` | UpDownCounter | `{connection}` | The minimum number of idle open connections allowed | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `db.client.connection.idle.min` | UpDownCounter | `{connection}` | The minimum number of idle open connections allowed | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - + | 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) | -### Metric: `db.client.connections.max` +### Metric: `db.client.connection.max` This metric is [recommended][MetricRecommended]. - + | Name | Instrument Type | Unit (UCUM) | Description | Stability | | -------- | --------------- | ----------- | -------------- | --------- | -| `db.client.connections.max` | UpDownCounter | `{connection}` | The maximum number of open connections allowed | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `db.client.connection.max` | UpDownCounter | `{connection}` | The maximum number of open connections allowed | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - + | 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) | -### Metric: `db.client.connections.pending_requests` +### Metric: `db.client.connection.pending_requests` This metric is [recommended][MetricRecommended]. - + | Name | Instrument Type | Unit (UCUM) | Description | Stability | | -------- | --------------- | ----------- | -------------- | --------- | -| `db.client.connections.pending_requests` | UpDownCounter | `{request}` | The number of pending requests for an open connection, cumulative for the entire pool | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `db.client.connection.pending_requests` | UpDownCounter | `{request}` | The number of pending requests for an open connection, cumulative for the entire pool | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - + | 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) | -### Metric: `db.client.connections.timeouts` +### Metric: `db.client.connection.timeouts` This metric is [recommended][MetricRecommended]. - + | Name | Instrument Type | Unit (UCUM) | Description | Stability | | -------- | --------------- | ----------- | -------------- | --------- | -| `db.client.connections.timeouts` | Counter | `{timeout}` | The number of connection timeouts that have occurred trying to obtain a connection from the pool | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `db.client.connection.timeouts` | Counter | `{timeout}` | The number of connection timeouts that have occurred trying to obtain a connection from the pool | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - + | 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) | -### Metric: `db.client.connections.create_time` +### Metric: `db.client.connection.create_time` This metric is [recommended][MetricRecommended]. - + | Name | Instrument Type | Unit (UCUM) | Description | Stability | | -------- | --------------- | ----------- | -------------- | --------- | -| `db.client.connections.create_time` | Histogram | `ms` | The time it took to create a new connection | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `db.client.connection.create_time` | Histogram | `ms` | The time it took to create a new connection | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - + | 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) | -### Metric: `db.client.connections.wait_time` +### Metric: `db.client.connection.wait_time` This metric is [recommended][MetricRecommended]. - + | Name | Instrument Type | Unit (UCUM) | Description | Stability | | -------- | --------------- | ----------- | -------------- | --------- | -| `db.client.connections.wait_time` | Histogram | `ms` | The time it took to obtain an open connection from the pool | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `db.client.connection.wait_time` | Histogram | `ms` | The time it took to obtain an open connection from the pool | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - + | 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) | -### Metric: `db.client.connections.use_time` +### Metric: `db.client.connection.use_time` This metric is [recommended][MetricRecommended]. - + | Name | Instrument Type | Unit (UCUM) | Description | Stability | | -------- | --------------- | ----------- | -------------- | --------- | -| `db.client.connections.use_time` | Histogram | `ms` | The time between borrowing a connection and returning it to the pool | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `db.client.connection.use_time` | Histogram | `ms` | The time between borrowing a connection and returning it to the pool | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - + | 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) | diff --git a/model/metrics/database-metrics.yaml b/model/metrics/database-metrics.yaml index 8ea3acdd91..51f3c09b5d 100644 --- a/model/metrics/database-metrics.yaml +++ b/model/metrics/database-metrics.yaml @@ -8,9 +8,9 @@ groups: stability: experimental extends: attributes.db.client - - id: metric.db.client.connections.count + - id: metric.db.client.connection.count type: metric - metric_name: db.client.connections.count + metric_name: db.client.connection.count stability: experimental brief: "The number of connections that are currently in state described by the `state` attribute" instrument: updowncounter @@ -21,9 +21,9 @@ groups: - ref: db.client.connections.pool.name requirement_level: required - - id: metric.db.client.connections.idle.max + - id: metric.db.client.connection.idle.max type: metric - metric_name: db.client.connections.idle.max + metric_name: db.client.connection.idle.max stability: experimental brief: "The maximum number of idle open connections allowed" instrument: updowncounter @@ -32,9 +32,9 @@ groups: - ref: db.client.connections.pool.name requirement_level: required - - id: metric.db.client.connections.idle.min + - id: metric.db.client.connection.idle.min type: metric - metric_name: db.client.connections.idle.min + metric_name: db.client.connection.idle.min stability: experimental brief: "The minimum number of idle open connections allowed" instrument: updowncounter @@ -43,9 +43,9 @@ groups: - ref: db.client.connections.pool.name requirement_level: required - - id: metric.db.client.connections.max + - id: metric.db.client.connection.max type: metric - metric_name: db.client.connections.max + metric_name: db.client.connection.max stability: experimental brief: "The maximum number of open connections allowed" instrument: updowncounter @@ -54,9 +54,9 @@ groups: - ref: db.client.connections.pool.name requirement_level: required - - id: metric.db.client.connections.pending_requests + - id: metric.db.client.connection.pending_requests type: metric - metric_name: db.client.connections.pending_requests + metric_name: db.client.connection.pending_requests stability: experimental brief: "The number of pending requests for an open connection, cumulative for the entire pool" instrument: updowncounter @@ -65,9 +65,9 @@ groups: - ref: db.client.connections.pool.name requirement_level: required - - id: metric.db.client.connections.timeouts + - id: metric.db.client.connection.timeouts type: metric - metric_name: db.client.connections.timeouts + metric_name: db.client.connection.timeouts stability: experimental brief: "The number of connection timeouts that have occurred trying to obtain a connection from the pool" instrument: counter @@ -76,9 +76,9 @@ groups: - ref: db.client.connections.pool.name requirement_level: required - - id: metric.db.client.connections.create_time + - id: metric.db.client.connection.create_time type: metric - metric_name: db.client.connections.create_time + metric_name: db.client.connection.create_time stability: experimental brief: "The time it took to create a new connection" instrument: histogram @@ -87,9 +87,9 @@ groups: - ref: db.client.connections.pool.name requirement_level: required - - id: metric.db.client.connections.wait_time + - id: metric.db.client.connection.wait_time type: metric - metric_name: db.client.connections.wait_time + metric_name: db.client.connection.wait_time stability: experimental brief: "The time it took to obtain an open connection from the pool" instrument: histogram @@ -98,9 +98,9 @@ groups: - ref: db.client.connections.pool.name requirement_level: required - - id: metric.db.client.connections.use_time + - id: metric.db.client.connection.use_time type: metric - metric_name: db.client.connections.use_time + metric_name: db.client.connection.use_time stability: experimental brief: "The time between borrowing a connection and returning it to the pool" instrument: histogram From 4e4a1af5e83f38e23d6053f636ada21ef248c794 Mon Sep 17 00:00:00 2001 From: Greg Kalapos Date: Mon, 29 Apr 2024 18:37:21 +0200 Subject: [PATCH 09/12] Change unit in db.client.connections.* from `ms` to `s` Solves #381 --- docs/database/database-metrics.md | 6 +++--- model/metrics/database-metrics.yaml | 6 +++--- schema-next.yaml | 3 --- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/docs/database/database-metrics.md b/docs/database/database-metrics.md index 3cc374855d..2e60724e10 100644 --- a/docs/database/database-metrics.md +++ b/docs/database/database-metrics.md @@ -260,7 +260,7 @@ This metric is [recommended][MetricRecommended]. | Name | Instrument Type | Unit (UCUM) | Description | Stability | | -------- | --------------- | ----------- | -------------- | --------- | -| `db.client.connection.create_time` | Histogram | `ms` | The time it took to create a new connection | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `db.client.connection.create_time` | Histogram | `s` | The time it took to create a new connection | ![Experimental](https://img.shields.io/badge/-experimental-blue) | @@ -276,7 +276,7 @@ This metric is [recommended][MetricRecommended]. | Name | Instrument Type | Unit (UCUM) | Description | Stability | | -------- | --------------- | ----------- | -------------- | --------- | -| `db.client.connection.wait_time` | Histogram | `ms` | The time it took to obtain an open connection from the pool | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `db.client.connection.wait_time` | Histogram | `s` | The time it took to obtain an open connection from the pool | ![Experimental](https://img.shields.io/badge/-experimental-blue) | @@ -292,7 +292,7 @@ This metric is [recommended][MetricRecommended]. | Name | Instrument Type | Unit (UCUM) | Description | Stability | | -------- | --------------- | ----------- | -------------- | --------- | -| `db.client.connection.use_time` | Histogram | `ms` | The time between borrowing a connection and returning it to the pool | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `db.client.connection.use_time` | Histogram | `s` | The time between borrowing a connection and returning it to the pool | ![Experimental](https://img.shields.io/badge/-experimental-blue) | diff --git a/model/metrics/database-metrics.yaml b/model/metrics/database-metrics.yaml index 51f3c09b5d..95f884f342 100644 --- a/model/metrics/database-metrics.yaml +++ b/model/metrics/database-metrics.yaml @@ -82,7 +82,7 @@ groups: stability: experimental brief: "The time it took to create a new connection" instrument: histogram - unit: "ms" + unit: "s" attributes: - ref: db.client.connections.pool.name requirement_level: required @@ -93,7 +93,7 @@ groups: stability: experimental brief: "The time it took to obtain an open connection from the pool" instrument: histogram - unit: "ms" + unit: "s" attributes: - ref: db.client.connections.pool.name requirement_level: required @@ -104,7 +104,7 @@ groups: stability: experimental brief: "The time between borrowing a connection and returning it to the pool" instrument: histogram - unit: "ms" + unit: "s" attributes: - ref: db.client.connections.pool.name requirement_level: required diff --git a/schema-next.yaml b/schema-next.yaml index 4b9dfeeb3f..e344c34056 100644 --- a/schema-next.yaml +++ b/schema-next.yaml @@ -12,9 +12,6 @@ versions: 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 - 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: From bc018a45c0f798fc9e887d636a2135f40f661de6 Mon Sep 17 00:00:00 2001 From: Greg Kalapos Date: Mon, 29 Apr 2024 19:05:59 +0200 Subject: [PATCH 10/12] Update database.yaml --- model/metrics/deprecated/database.yaml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/model/metrics/deprecated/database.yaml b/model/metrics/deprecated/database.yaml index 7b4628872b..524b5bd433 100644 --- a/model/metrics/deprecated/database.yaml +++ b/model/metrics/deprecated/database.yaml @@ -1,5 +1,5 @@ groups: - - id: metric.deprecated.db.client.connections.count + - id: metric.db.client.connections.count.deprecated type: metric metric_name: db.client.connections.usage stability: experimental @@ -13,7 +13,7 @@ groups: - ref: db.client.connections.pool.name requirement_level: required - - id: metric.deprecated.db.client.connections.idle.max + - id: metric.db.client.connections.idle.max.deprecated type: metric metric_name: db.client.connections.idle.max stability: experimental @@ -25,7 +25,7 @@ groups: - ref: db.client.connections.pool.name requirement_level: required - - id: metric.deprecated.db.client.connections.idle.min + - id: metric.db.client.connections.idle.min.deprecated type: metric metric_name: db.client.connections.idle.min stability: experimental @@ -37,7 +37,7 @@ groups: - ref: db.client.connections.pool.name requirement_level: required - - id: metric.deprecated.db.client.connections.max + - id: metric.db.client.connections.max.deprecated type: metric metric_name: db.client.connections.max stability: experimental @@ -49,7 +49,7 @@ groups: - ref: db.client.connections.pool.name requirement_level: required - - id: metric.deprecated.db.client.connections.pending_requests + - id: metric.db.client.connections.pending_requests.deprecated type: metric metric_name: db.client.connections.pending_requests stability: experimental @@ -61,7 +61,7 @@ groups: - ref: db.client.connections.pool.name requirement_level: required - - id: metric.deprecated.db.client.connections.timeouts + - id: metric.db.client.connections.timeouts.deprecated type: metric metric_name: db.client.connections.timeouts stability: experimental @@ -73,7 +73,7 @@ groups: - ref: db.client.connections.pool.name requirement_level: required - - id: metric.deprecated.db.client.connections.create_time + - id: metric.db.client.connections.create_time.deprecated type: metric metric_name: db.client.connections.create_time stability: experimental @@ -85,7 +85,7 @@ groups: - ref: db.client.connections.pool.name requirement_level: required - - id: metric.deprecated.db.client.connections.wait_time + - id: metric.db.client.connections.wait_time.deprecated type: metric metric_name: db.client.connections.wait_time stability: experimental @@ -97,7 +97,7 @@ groups: - ref: db.client.connections.pool.name requirement_level: required - - id: metric.deprecated.db.client.connections.use_time + - id: metric.db.client.connections.use_time.deprecated type: metric metric_name: db.client.connections.use_time stability: experimental From c14d22f36e83415ac36d5cc72c617f7ef895f8d7 Mon Sep 17 00:00:00 2001 From: Greg Kalapos Date: Tue, 30 Apr 2024 10:56:46 +0200 Subject: [PATCH 11/12] Update database.yaml --- model/metrics/deprecated/database.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/model/metrics/deprecated/database.yaml b/model/metrics/deprecated/database.yaml index 524b5bd433..3a6eac0f85 100644 --- a/model/metrics/deprecated/database.yaml +++ b/model/metrics/deprecated/database.yaml @@ -77,8 +77,8 @@ groups: 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." + deprecated: "Replaced by `db.client.connection.create_time`. The unit changed from `ms` to `s`." + brief: "Deprecated, use `db.client.connection.create_time` instead. The unit changed from `ms` to `s`." instrument: histogram unit: "ms" attributes: @@ -89,8 +89,8 @@ groups: 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." + deprecated: "Replaced by `db.client.connection.wait_time`. The unit changed from `ms` to `s`." + brief: "Deprecated, use `db.client.connection.wait_time` instead. The unit changed from `ms` to `s`." instrument: histogram unit: "ms" attributes: @@ -101,8 +101,8 @@ groups: 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." + deprecated: "Replaced by `db.client.connection.use_time`. The unit changed from `ms` to `s`." + brief: "Deprecated, use `db.client.connection.use_time` instead. The unit changed from `ms` to `s`." instrument: histogram unit: "ms" attributes: From c9595aaee6bea974be858e6d8f02be05cc9f370c Mon Sep 17 00:00:00 2001 From: Greg Kalapos Date: Wed, 1 May 2024 18:13:48 +0200 Subject: [PATCH 12/12] Update database.yaml --- model/metrics/deprecated/database.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/model/metrics/deprecated/database.yaml b/model/metrics/deprecated/database.yaml index 3a6eac0f85..5e6332294f 100644 --- a/model/metrics/deprecated/database.yaml +++ b/model/metrics/deprecated/database.yaml @@ -77,8 +77,8 @@ groups: type: metric metric_name: db.client.connections.create_time stability: experimental - deprecated: "Replaced by `db.client.connection.create_time`. The unit changed from `ms` to `s`." - brief: "Deprecated, use `db.client.connection.create_time` instead. The unit changed from `ms` to `s`." + deprecated: "Replaced by `db.client.connection.create_time`. Note: the unit also changed from `ms` to `s`." + brief: "Deprecated, use `db.client.connection.create_time` instead. Note: the unit also changed from `ms` to `s`." instrument: histogram unit: "ms" attributes: @@ -89,8 +89,8 @@ groups: type: metric metric_name: db.client.connections.wait_time stability: experimental - deprecated: "Replaced by `db.client.connection.wait_time`. The unit changed from `ms` to `s`." - brief: "Deprecated, use `db.client.connection.wait_time` instead. The unit changed from `ms` to `s`." + deprecated: "Replaced by `db.client.connection.wait_time`. Note: the unit also changed from `ms` to `s`." + brief: "Deprecated, use `db.client.connection.wait_time` instead. Note: the unit also changed from `ms` to `s`." instrument: histogram unit: "ms" attributes: @@ -101,8 +101,8 @@ groups: type: metric metric_name: db.client.connections.use_time stability: experimental - deprecated: "Replaced by `db.client.connection.use_time`. The unit changed from `ms` to `s`." - brief: "Deprecated, use `db.client.connection.use_time` instead. The unit changed from `ms` to `s`." + deprecated: "Replaced by `db.client.connection.use_time`. Note: the unit also changed from `ms` to `s`." + brief: "Deprecated, use `db.client.connection.use_time` instead. Note: the unit also changed from `ms` to `s`." instrument: histogram unit: "ms" attributes: