-
Notifications
You must be signed in to change notification settings - Fork 188
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generate database metrics semconv from YAML (#90)
- Loading branch information
1 parent
ea17e33
commit 6deba95
Showing
2 changed files
with
265 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
groups: | ||
- id: attributes.db | ||
type: attribute_group | ||
brief: Describes Database attributes | ||
attributes: | ||
- id: state | ||
type: | ||
allow_custom_values: false | ||
members: | ||
- id: idle | ||
value: 'idle' | ||
- id: used | ||
value: 'used' | ||
requirement_level: required | ||
brief: "The state of a connection in the pool" | ||
examples: ["idle"] | ||
- id: pool.name | ||
type: string | ||
requirement_level: required | ||
brief: > | ||
The name of the connection pool; unique within the instrumented application. | ||
In case the connection pool implementation does not provide a name, | ||
then the [db.connection_string](/docs/database/database-spans.md#connection-level-attributes) | ||
should be used | ||
examples: ["myDataSource"] | ||
|
||
- id: metric.db.client.connections.usage | ||
type: metric | ||
metric_name: db.client.connections.usage | ||
brief: "The number of connections that are currently in state described by the `state` attribute" | ||
instrument: updowncounter | ||
unit: "{connection}" | ||
attributes: | ||
- ref: state | ||
- ref: pool.name | ||
|
||
- id: metric.db.client.connections.idle.max | ||
type: metric | ||
metric_name: db.client.connections.idle.max | ||
brief: "The maximum number of idle open connections allowed" | ||
instrument: updowncounter | ||
unit: "{connection}" | ||
attributes: | ||
- ref: pool.name | ||
|
||
- id: metric.db.client.connections.idle.min | ||
type: metric | ||
metric_name: db.client.connections.idle.min | ||
brief: "The minimum number of idle open connections allowed" | ||
instrument: updowncounter | ||
unit: "{connection}" | ||
attributes: | ||
- ref: pool.name | ||
|
||
- id: metric.db.client.connections.max | ||
type: metric | ||
metric_name: db.client.connections.max | ||
brief: "The maximum number of open connections allowed" | ||
instrument: updowncounter | ||
unit: "{connection}" | ||
attributes: | ||
- ref: pool.name | ||
|
||
- id: metric.db.client.connections.pending_requests | ||
type: metric | ||
metric_name: db.client.connections.pending_requests | ||
brief: "The number of pending requests for an open connection, cumulative for the entire pool" | ||
instrument: updowncounter | ||
unit: "{request}" | ||
attributes: | ||
- ref: pool.name | ||
|
||
- id: metric.db.client.connections.timeouts | ||
type: metric | ||
metric_name: db.client.connections.timeouts | ||
brief: "The number of connection timeouts that have occurred trying to obtain a connection from the pool" | ||
instrument: counter | ||
unit: "{timeout}" | ||
attributes: | ||
- ref: pool.name | ||
|
||
- id: metric.db.client.connections.create_time | ||
type: metric | ||
metric_name: db.client.connections.create_time | ||
brief: "The time it took to create a new connection" | ||
instrument: histogram | ||
unit: "ms" | ||
attributes: | ||
- ref: pool.name | ||
|
||
- id: metric.db.client.connections.wait_time | ||
type: metric | ||
metric_name: db.client.connections.wait_time | ||
brief: "The time it took to obtain an open connection from the pool" | ||
instrument: histogram | ||
unit: "ms" | ||
attributes: | ||
- ref: pool.name | ||
|
||
- id: metric.db.client.connections.use_time | ||
type: metric | ||
metric_name: db.client.connections.use_time | ||
brief: "The time between borrowing a connection and returning it to the pool" | ||
instrument: histogram | ||
unit: "ms" | ||
attributes: | ||
- ref: pool.name |