Skip to content

pg_stat_statements generates non-unique metrics #86

@TLINDEN

Description

@TLINDEN

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions