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
collected metric was collected before with the same name and label values #998
Comments
I am having almost the same issue.
Mine has a value in the label I am running the exporter with Docker Compose; version: '3'
services:
postgres-exporter:
image: quay.io/prometheuscommunity/postgres-exporter
ports:
- "9187:9187"
environment:
DATA_SOURCE_NAME: "postgresql://postgres_exporter:mypass@postgres:5432/mydb?sslmode=disable"
command: --web.listen-address=:9187 --web.telemetry-path=/metrics --collector.database_wraparound --collector.long_running_transactions --collector.postmaster --collector.process_idle --collector.stat_activity_autovacuum --collector.stat_statements --collector.stat_wal_receiver --collector.statio_user_indexes
|
same issue here - curl localhost:26058/metrics
* collected metric "pg_stat_statements_calls_total" { label:{name:"datname" value:"mydb"} label:{name:"queryid" value:"-2355316157827874919"} label:{name:"user" value:"mydb_so"} counter:{value:2}} was collected before with the same name and label values
* collected metric "pg_stat_statements_seconds_total" { label:{name:"datname" value:"mydb"} label:{name:"queryid" value:"-2355316157827874919"} label:{name:"user" value:"mydb_so"} counter:{value:5.981075956000001}} was collected before with the same name and label values
* collected metric "pg_stat_statements_rows_total" { label:{name:"datname" value:"mydb"} label:{name:"queryid" value:"-2355316157827874919"} label:{name:"user" value:"mydb_so"} counter:{value:8}} was collected before with the same name and label values
* collected metric "pg_stat_statements_block_read_seconds_total" { label:{name:"datname" value:"mydb"} label:{name:"queryid" value:"-2355316157827874919"} label:{name:"user" value:"mydb_so"} counter:{value:0}} was collected before with the same name and label values
* collected metric "pg_stat_statements_block_write_seconds_total" { label:{name:"datname" value:"mydb"} label:{name:"queryid" value:"-2355316157827874919"} label:{name:"user" value:"mydb_so"} counter:{value:0}} was collected before with the same name and label values
* collected metric "pg_stat_statements_calls_total" { label:{name:"datname" value:"mydb"} label:{name:"queryid" value:"-3686023444609730445"} label:{name:"user" value:"mydb_so"} counter:{value:2}} was collected before with the same name and label values
* collected metric "pg_stat_statements_seconds_total" { label:{name:"datname" value:"mydb"} label:{name:"queryid" value:"-3686023444609730445"} label:{name:"user" value:"mydb_so"} counter:{value:5.831786688}} was collected before with the same name and label values
* collected metric "pg_stat_statements_rows_total" { label:{name:"datname" value:"mydb"} label:{name:"queryid" value:"-3686023444609730445"} label:{name:"user" value:"mydb_so"} counter:{value:8}} was collected before with the same name and label values
* collected metric "pg_stat_statements_block_read_seconds_total" { label:{name:"datname" value:"mydb"} label:{name:"queryid" value:"-3686023444609730445"} label:{name:"user" value:"mydb_so"} counter:{value:0}} was collected before with the same name and label values
* collected metric "pg_stat_statements_block_write_seconds_total" { label:{name:"datname" value:"mydb"} label:{name:"queryid" value:"-3686023444609730445"} label:{name:"user" value:"mydb_so"} counter:{value:0}} was collected before with the same name and label values
|
Let me explain the potential root cause for this problem.
Hope this explains the situation dealing with the problem. Note: if you are using custom prometheus code with customized labels.. then you need to change the labels accordingly in the PSQL queries. |
What did you do?
I started postgres-exporter using following docker-compose file:
What did you expect to see?
Opening http://127.0.0.1:9187/metrics I expected to see all metrics including statements.
What did you see instead? Under which circumstances?
I see 120 errors instead, but only when using --collector.stat_statements:
Environment
I tried on 2 systems:
postgres_exporter, version 0.15.0 (branch: HEAD, revision: 68c176b)
build user: root@7c5a76bc737a
build date: 20231027-14:38:04
go version: go1.21.3
platform: linux/arm64
tags: unknown
14.10.0
(I changed host and port for issue purpose)
The text was updated successfully, but these errors were encountered: