Skip to content

Commit

Permalink
[receiver/postgresql] Fix blocks read metric (open-telemetry#23657)
Browse files Browse the repository at this point in the history
**Description:** <Describe what has changed.>
fixed an issue where postgresql receiver was emitting the same attribute
value "toast_hit" twice under postgresql.blocks_read metric.

**Link to tracking Issue:** <Issue number if applicable>

**Testing:** <Describe what testing was performed and which tests were
added.>

**Documentation:** <Describe the documentation added.>
  • Loading branch information
BominRahmani authored Jun 23, 2023
1 parent 0c625d0 commit 8ba48f6
Show file tree
Hide file tree
Showing 9 changed files with 847 additions and 823 deletions.
20 changes: 20 additions & 0 deletions .chloggen/fix-postgresql-incorrect-attribute-emit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# 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: bug_fix

# 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: fixed an issue where postgresql receiver was emitting the same attribute value "toast_hit" twice under postgresql.blocks_read metric.

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

# (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:
2 changes: 1 addition & 1 deletion receiver/postgresqlreceiver/scraper.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ func (p *postgreSQLScraper) collectTables(ctx context.Context, now pcommon.Times
p.mb.RecordPostgresqlBlocksReadDataPointWithoutDatabaseAndTable(now, br.idxRead, metadata.AttributeSourceIdxRead)
p.mb.RecordPostgresqlBlocksReadDataPointWithoutDatabaseAndTable(now, br.idxHit, metadata.AttributeSourceIdxHit)
p.mb.RecordPostgresqlBlocksReadDataPointWithoutDatabaseAndTable(now, br.toastHit, metadata.AttributeSourceToastHit)
p.mb.RecordPostgresqlBlocksReadDataPointWithoutDatabaseAndTable(now, br.toastRead, metadata.AttributeSourceToastHit)
p.mb.RecordPostgresqlBlocksReadDataPointWithoutDatabaseAndTable(now, br.toastRead, metadata.AttributeSourceToastRead)
p.mb.RecordPostgresqlBlocksReadDataPointWithoutDatabaseAndTable(now, br.tidxRead, metadata.AttributeSourceTidxRead)
p.mb.RecordPostgresqlBlocksReadDataPointWithoutDatabaseAndTable(now, br.tidxHit, metadata.AttributeSourceTidxHit)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ resourceMetrics:
attributes:
- key: source
value:
stringValue: toast_hit
stringValue: toast_read
startTimeUnixNano: "1662565933924183000"
timeUnixNano: "1662565943934293000"
- asInt: "0"
Expand Down Expand Up @@ -259,7 +259,7 @@ resourceMetrics:
attributes:
- key: source
value:
stringValue: toast_hit
stringValue: toast_read
startTimeUnixNano: "1662565933924183000"
timeUnixNano: "1662565943934293000"
- asInt: "0"
Expand Down Expand Up @@ -524,7 +524,7 @@ resourceMetrics:
attributes:
- key: source
value:
stringValue: toast_hit
stringValue: toast_read
startTimeUnixNano: "1662565933924183000"
timeUnixNano: "1662565943934293000"
- asInt: "0"
Expand Down Expand Up @@ -674,7 +674,7 @@ resourceMetrics:
attributes:
- key: source
value:
stringValue: toast_hit
stringValue: toast_read
startTimeUnixNano: "1662565933924183000"
timeUnixNano: "1662565943934293000"
- asInt: "0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ resourceMetrics:
attributes:
- key: source
value:
stringValue: toast_hit
stringValue: toast_read
startTimeUnixNano: "1662565922919465000"
timeUnixNano: "1662565932919535000"
- asInt: "0"
Expand Down Expand Up @@ -203,7 +203,7 @@ resourceMetrics:
attributes:
- key: source
value:
stringValue: toast_hit
stringValue: toast_read
startTimeUnixNano: "1662565922919465000"
timeUnixNano: "1662565932919535000"
- asInt: "0"
Expand Down Expand Up @@ -468,7 +468,7 @@ resourceMetrics:
attributes:
- key: source
value:
stringValue: toast_hit
stringValue: toast_read
startTimeUnixNano: "1662565922919465000"
timeUnixNano: "1662565932919535000"
- asInt: "0"
Expand Down Expand Up @@ -618,7 +618,7 @@ resourceMetrics:
attributes:
- key: source
value:
stringValue: toast_hit
stringValue: toast_read
startTimeUnixNano: "1662565922919465000"
timeUnixNano: "1662565932919535000"
- asInt: "0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ resourceMetrics:
attributes:
- key: source
value:
stringValue: toast_hit
stringValue: toast_read
startTimeUnixNano: "1662565911916254000"
timeUnixNano: "1662565921917209000"
- asInt: "0"
Expand Down Expand Up @@ -203,7 +203,7 @@ resourceMetrics:
attributes:
- key: source
value:
stringValue: toast_hit
stringValue: toast_read
startTimeUnixNano: "1662565911916254000"
timeUnixNano: "1662565921917209000"
- asInt: "0"
Expand Down
Loading

0 comments on commit 8ba48f6

Please sign in to comment.