Skip to content

Commit

Permalink
postgresqlreceiver: Add missing units in metadata.yaml (#23571)
Browse files Browse the repository at this point in the history
Metric unit is required, see:
https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/cmd/mdatagen/metadata-schema.yaml#L72-L73.

This PR adds the unit to metrics where this is missing:
- postgresql.bgwriter.maxwritten
- postgresql.table.count
  • Loading branch information
mackjmr authored Jun 26, 2023
1 parent 9fe4230 commit c2401db
Show file tree
Hide file tree
Showing 12 changed files with 2,079 additions and 2,029 deletions.
24 changes: 24 additions & 0 deletions .chloggen/add-units-postgresqlreceiver.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, such as a test fix or a tooling change,
# 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: enhancement

# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
component: postgresqlreceiver

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Adds unit to metrics where this was missing.

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
issues: [23571]

# (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: |
Affected metrics can be found below.
- postgresql.bgwriter.maxwritten
- postgresql.table.count
4 changes: 2 additions & 2 deletions receiver/postgresqlreceiver/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Number of times the background writer stopped a cleaning scan because it had wri
| Unit | Metric Type | Value Type | Aggregation Temporality | Monotonic |
| ---- | ----------- | ---------- | ----------------------- | --------- |
| | Sum | Int | Cumulative | true |
| 1 | Sum | Int | Cumulative | true |
### postgresql.blocks_read
Expand Down Expand Up @@ -226,7 +226,7 @@ Number of user tables in a database.
| Unit | Metric Type | Value Type | Aggregation Temporality | Monotonic |
| ---- | ----------- | ---------- | ----------------------- | --------- |
| | Sum | Int | Cumulative | false |
| {table} | Sum | Int | Cumulative | false |
### postgresql.table.size
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions receiver/postgresqlreceiver/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ metrics:
aggregation: cumulative
monotonic: true
value_type: int
unit: 1
postgresql.blocks_read:
enabled: true
description: The number of blocks read.
Expand Down Expand Up @@ -235,6 +236,7 @@ metrics:
aggregation: cumulative
monotonic: false
value_type: int
unit: "{table}"
postgresql.table.size:
attributes: []
description: Disk space used by a table.
Expand Down
Loading

0 comments on commit c2401db

Please sign in to comment.