Skip to content

Commit 70baddd

Browse files
Rename db.client.connections.* metrics to db.client.connection.* and rename db.client.connection.usage to db.client.connection.count and adapting units (open-telemetry#966)
Co-authored-by: Liudmila Molkova <limolkova@microsoft.com>
1 parent 651d779 commit 70baddd

File tree

5 files changed

+208
-66
lines changed

5 files changed

+208
-66
lines changed
+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Use this changelog template to create an entry for release notes.
2+
#
3+
# If your change doesn't affect end users you should instead start
4+
# your pull request title with [chore] or use the "Skip Changelog" label.
5+
6+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
7+
change_type: breaking
8+
9+
# The name of the area of concern in the attributes-registry, (e.g. http, cloud, db)
10+
component: db
11+
12+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
13+
note: >
14+
Rename `db.client.connections.*` metric namespace to `db.client.connection.*` and
15+
rename `db.client.connection.usage` to `db.client.connection.count`.
16+
17+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
18+
# The values here must be integers.
19+
issues: [201, 967]
20+
21+
# (Optional) One or more lines of additional information to render under the primary note.
22+
# These lines will be padded with 2 spaces and then inserted directly into the document.
23+
# Use pipe (|) for multiline entries.
24+
subtext:

docs/database/database-metrics.md

+45-45
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ and attributes but more may be added in the future.
1818
- [Database operation](#database-operation)
1919
- [Metric: `db.client.operation.duration`](#metric-dbclientoperationduration)
2020
- [Connection pools](#connection-pools)
21-
- [Metric: `db.client.connections.usage`](#metric-dbclientconnectionsusage)
22-
- [Metric: `db.client.connections.idle.max`](#metric-dbclientconnectionsidlemax)
23-
- [Metric: `db.client.connections.idle.min`](#metric-dbclientconnectionsidlemin)
24-
- [Metric: `db.client.connections.max`](#metric-dbclientconnectionsmax)
25-
- [Metric: `db.client.connections.pending_requests`](#metric-dbclientconnectionspending_requests)
26-
- [Metric: `db.client.connections.timeouts`](#metric-dbclientconnectionstimeouts)
27-
- [Metric: `db.client.connections.create_time`](#metric-dbclientconnectionscreate_time)
28-
- [Metric: `db.client.connections.wait_time`](#metric-dbclientconnectionswait_time)
29-
- [Metric: `db.client.connections.use_time`](#metric-dbclientconnectionsuse_time)
21+
- [Metric: `db.client.connection.count`](#metric-dbclientconnectioncount)
22+
- [Metric: `db.client.connection.idle.max`](#metric-dbclientconnectionidlemax)
23+
- [Metric: `db.client.connection.idle.min`](#metric-dbclientconnectionidlemin)
24+
- [Metric: `db.client.connection.max`](#metric-dbclientconnectionmax)
25+
- [Metric: `db.client.connection.pending_requests`](#metric-dbclientconnectionpending_requests)
26+
- [Metric: `db.client.connection.timeouts`](#metric-dbclientconnectiontimeouts)
27+
- [Metric: `db.client.connection.create_time`](#metric-dbclientconnectioncreate_time)
28+
- [Metric: `db.client.connection.wait_time`](#metric-dbclientconnectionwait_time)
29+
- [Metric: `db.client.connection.use_time`](#metric-dbclientconnectionuse_time)
3030

3131
<!-- tocstop -->
3232

@@ -158,17 +158,17 @@ If a database operation involved multiple network calls (for example retries), t
158158

159159
The following metric instruments describe database client connection pool operations.
160160

161-
### Metric: `db.client.connections.usage`
161+
### Metric: `db.client.connection.count`
162162

163163
This metric is [required][MetricRequired].
164164

165-
<!-- semconv metric.db.client.connections.usage(metric_table) -->
165+
<!-- semconv metric.db.client.connection.count(metric_table) -->
166166
| Name | Instrument Type | Unit (UCUM) | Description | Stability |
167167
| -------- | --------------- | ----------- | -------------- | --------- |
168-
| `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) |
168+
| `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) |
169169
<!-- endsemconv -->
170170

171-
<!-- semconv metric.db.client.connections.usage(full) -->
171+
<!-- semconv metric.db.client.connection.count(full) -->
172172
| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
173173
|---|---|---|---|---|---|
174174
| [`db.client.connections.pool.name`](/docs/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) |
@@ -181,129 +181,129 @@ This metric is [required][MetricRequired].
181181
| `idle` | idle | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
182182
| `used` | used | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
183183
<!-- endsemconv -->
184-
### Metric: `db.client.connections.idle.max`
184+
### Metric: `db.client.connection.idle.max`
185185

186186
This metric is [recommended][MetricRecommended].
187187

188-
<!-- semconv metric.db.client.connections.idle.max(metric_table) -->
188+
<!-- semconv metric.db.client.connection.idle.max(metric_table) -->
189189
| Name | Instrument Type | Unit (UCUM) | Description | Stability |
190190
| -------- | --------------- | ----------- | -------------- | --------- |
191-
| `db.client.connections.idle.max` | UpDownCounter | `{connection}` | The maximum number of idle open connections allowed | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
191+
| `db.client.connection.idle.max` | UpDownCounter | `{connection}` | The maximum number of idle open connections allowed | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
192192
<!-- endsemconv -->
193193

194-
<!-- semconv metric.db.client.connections.idle.max(full) -->
194+
<!-- semconv metric.db.client.connection.idle.max(full) -->
195195
| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
196196
|---|---|---|---|---|---|
197197
| [`db.client.connections.pool.name`](/docs/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) |
198198
<!-- endsemconv -->
199199

200-
### Metric: `db.client.connections.idle.min`
200+
### Metric: `db.client.connection.idle.min`
201201

202202
This metric is [recommended][MetricRecommended].
203203

204-
<!-- semconv metric.db.client.connections.idle.min(metric_table) -->
204+
<!-- semconv metric.db.client.connection.idle.min(metric_table) -->
205205
| Name | Instrument Type | Unit (UCUM) | Description | Stability |
206206
| -------- | --------------- | ----------- | -------------- | --------- |
207-
| `db.client.connections.idle.min` | UpDownCounter | `{connection}` | The minimum number of idle open connections allowed | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
207+
| `db.client.connection.idle.min` | UpDownCounter | `{connection}` | The minimum number of idle open connections allowed | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
208208
<!-- endsemconv -->
209209

210-
<!-- semconv metric.db.client.connections.idle.min(full) -->
210+
<!-- semconv metric.db.client.connection.idle.min(full) -->
211211
| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
212212
|---|---|---|---|---|---|
213213
| [`db.client.connections.pool.name`](/docs/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) |
214214
<!-- endsemconv -->
215215

216-
### Metric: `db.client.connections.max`
216+
### Metric: `db.client.connection.max`
217217

218218
This metric is [recommended][MetricRecommended].
219219

220-
<!-- semconv metric.db.client.connections.max(metric_table) -->
220+
<!-- semconv metric.db.client.connection.max(metric_table) -->
221221
| Name | Instrument Type | Unit (UCUM) | Description | Stability |
222222
| -------- | --------------- | ----------- | -------------- | --------- |
223-
| `db.client.connections.max` | UpDownCounter | `{connection}` | The maximum number of open connections allowed | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
223+
| `db.client.connection.max` | UpDownCounter | `{connection}` | The maximum number of open connections allowed | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
224224
<!-- endsemconv -->
225225

226-
<!-- semconv metric.db.client.connections.max(full) -->
226+
<!-- semconv metric.db.client.connection.max(full) -->
227227
| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
228228
|---|---|---|---|---|---|
229229
| [`db.client.connections.pool.name`](/docs/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) |
230230
<!-- endsemconv -->
231231

232-
### Metric: `db.client.connections.pending_requests`
232+
### Metric: `db.client.connection.pending_requests`
233233

234234
This metric is [recommended][MetricRecommended].
235235

236-
<!-- semconv metric.db.client.connections.pending_requests(metric_table) -->
236+
<!-- semconv metric.db.client.connection.pending_requests(metric_table) -->
237237
| Name | Instrument Type | Unit (UCUM) | Description | Stability |
238238
| -------- | --------------- | ----------- | -------------- | --------- |
239-
| `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) |
239+
| `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) |
240240
<!-- endsemconv -->
241241

242-
<!-- semconv metric.db.client.connections.pending_requests(full) -->
242+
<!-- semconv metric.db.client.connection.pending_requests(full) -->
243243
| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
244244
|---|---|---|---|---|---|
245245
| [`db.client.connections.pool.name`](/docs/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) |
246246
<!-- endsemconv -->
247247

248-
### Metric: `db.client.connections.timeouts`
248+
### Metric: `db.client.connection.timeouts`
249249

250250
This metric is [recommended][MetricRecommended].
251251

252-
<!-- semconv metric.db.client.connections.timeouts(metric_table) -->
252+
<!-- semconv metric.db.client.connection.timeouts(metric_table) -->
253253
| Name | Instrument Type | Unit (UCUM) | Description | Stability |
254254
| -------- | --------------- | ----------- | -------------- | --------- |
255-
| `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) |
255+
| `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) |
256256
<!-- endsemconv -->
257257

258-
<!-- semconv metric.db.client.connections.timeouts(full) -->
258+
<!-- semconv metric.db.client.connection.timeouts(full) -->
259259
| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
260260
|---|---|---|---|---|---|
261261
| [`db.client.connections.pool.name`](/docs/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) |
262262
<!-- endsemconv -->
263263

264-
### Metric: `db.client.connections.create_time`
264+
### Metric: `db.client.connection.create_time`
265265

266266
This metric is [recommended][MetricRecommended].
267267

268-
<!-- semconv metric.db.client.connections.create_time(metric_table) -->
268+
<!-- semconv metric.db.client.connection.create_time(metric_table) -->
269269
| Name | Instrument Type | Unit (UCUM) | Description | Stability |
270270
| -------- | --------------- | ----------- | -------------- | --------- |
271-
| `db.client.connections.create_time` | Histogram | `ms` | The time it took to create a new connection | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
271+
| `db.client.connection.create_time` | Histogram | `s` | The time it took to create a new connection | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
272272
<!-- endsemconv -->
273273

274-
<!-- semconv metric.db.client.connections.create_time(full) -->
274+
<!-- semconv metric.db.client.connection.create_time(full) -->
275275
| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
276276
|---|---|---|---|---|---|
277277
| [`db.client.connections.pool.name`](/docs/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) |
278278
<!-- endsemconv -->
279279

280-
### Metric: `db.client.connections.wait_time`
280+
### Metric: `db.client.connection.wait_time`
281281

282282
This metric is [recommended][MetricRecommended].
283283

284-
<!-- semconv metric.db.client.connections.wait_time(metric_table) -->
284+
<!-- semconv metric.db.client.connection.wait_time(metric_table) -->
285285
| Name | Instrument Type | Unit (UCUM) | Description | Stability |
286286
| -------- | --------------- | ----------- | -------------- | --------- |
287-
| `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) |
287+
| `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) |
288288
<!-- endsemconv -->
289289

290-
<!-- semconv metric.db.client.connections.wait_time(full) -->
290+
<!-- semconv metric.db.client.connection.wait_time(full) -->
291291
| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
292292
|---|---|---|---|---|---|
293293
| [`db.client.connections.pool.name`](/docs/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) |
294294
<!-- endsemconv -->
295295

296-
### Metric: `db.client.connections.use_time`
296+
### Metric: `db.client.connection.use_time`
297297

298298
This metric is [recommended][MetricRecommended].
299299

300-
<!-- semconv metric.db.client.connections.use_time(metric_table) -->
300+
<!-- semconv metric.db.client.connection.use_time(metric_table) -->
301301
| Name | Instrument Type | Unit (UCUM) | Description | Stability |
302302
| -------- | --------------- | ----------- | -------------- | --------- |
303-
| `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) |
303+
| `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) |
304304
<!-- endsemconv -->
305305

306-
<!-- semconv metric.db.client.connections.use_time(full) -->
306+
<!-- semconv metric.db.client.connection.use_time(full) -->
307307
| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
308308
|---|---|---|---|---|---|
309309
| [`db.client.connections.pool.name`](/docs/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) |

0 commit comments

Comments
 (0)