Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pg_stat_statements generates non-unique metrics #86

Open
TLINDEN opened this issue Apr 18, 2024 · 1 comment
Open

pg_stat_statements generates non-unique metrics #86

TLINDEN opened this issue Apr 18, 2024 · 1 comment

Comments

@TLINDEN
Copy link
Collaborator

TLINDEN commented Apr 18, 2024

The last update on the query results in some rare cases in this error when trying to get metrics from postgres_exporter:

An error has occurred while serving metrics:

3 error(s) occurred:
* collected metric "pg_stat_statements_calls" { label:<name:"datname" value:"foo_bar" > label:<name:"postgres_partition" value:"foo-s1-q01-k40" > label:<name:"query" value:"select k1_0.blah_id,k1_0.account_id,k1_0.account_status,k1_0.account_zusatztext,k1_0.accountnummer from foo_bar.account_blah_view k1_0 where k1_0.blah_id=$1" > label:<name:"server" value:"pgfoo-scsablageapp9c2598d7-0" > label:<name:"user" value:"foo_bar_java" > counter:<value:2370 > } was collected before with the same name and label values
* collected metric "pg_stat_statements_time_milliseconds" { label:<name:"datname" value:"foo_bar" > label:<name:"postgres_partition" value:"foo-s1-q01-k40" > label:<name:"query" value:"select k1_0.blah_id,k1_0.account_id,k1_0.account_status,k1_0.account_zusatztext,k1_0.accountnummer from foo_bar.account_blah_view k1_0 where k1_0.blah_id=$1" > label:<name:"server" value:"pgfoo-scsablageapp9c2598d7-0" > label:<name:"user" value:"foo_bar_java" > counter:<value:30.109292000000032 > } was collected before with the same name and label values
* collected metric "pg_stat_statements_rows" { label:<name:"datname" value:"foo_bar" > label:<name:"postgres_partition" value:"foo-s1-q01-k40" > label:<name:"query" value:"select k1_0.blah_id,k1_0.account_id,k1_0.account_status,k1_0.account_zusatztext,k1_0.accountnummer from foo_bar.account_blah_view k1_0 where k1_0.blah_id=$1" > label:<name:"server" value:"pgfoo-scsablageapp9c2598d7-0" > label:<name:"user" value:"foo_bary_java" > counter:<value:23 > } was collected before with the same name and label values
@TLINDEN
Copy link
Collaborator Author

TLINDEN commented Apr 18, 2024

The problem is, that we have removed the queryid, so the rows are not uniq anymore, which causes this error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant