postgres_exporter icon indicating copy to clipboard operation
postgres_exporter copied to clipboard

Error running query on database \"<database_host:port>\": pg_stat_statements pq: syntax error at or near \"e\"

Open pankdhnd opened this issue 2 years ago • 3 comments

What did you do? We deployed postgres exporter version 0.11.1 using official helm chart, and we are noticing below error in the exporter pod logs:

ts=2023-02-06T14:06:40.385Z caller=namespace.go:236 level=info err="Error running query on database \"<database_host:port>\": pg_stat_statements pq: syntax error at or near \"e\""

ts=2023-02-06T14:06:40.385Z caller=namespace.go:193 level=debug msg="Querying namespace" namespace=pg_stat_database_conflicts

ts=2023-02-06T14:06:40.392Z caller=namespace.go:193 level=debug msg="Querying namespa

What did you expect to see? We expect to see regular metrices for pg_stat_statements

What did you see instead? Under which circumstances? We keep seeing the error listed above in the pod logs

Environment

  • Kubernetes cluster v1.24+
  • postgres_exporter version: 0.11.1
  • postgres_exporter flags: None
  • PostgreSQL version: 13.7
  • Logs:
“ts=2023-02-06T14:06:40.385Z caller=namespace.go:236 level=info err="Error running query on database \"<database_host:port>\": pg_stat_statements pq: syntax error at or near \"e\""
ts=2023-02-06T14:06:40.385Z caller=namespace.go:193 level=debug msg="Querying namespace" namespace=pg_stat_database_conflicts
ts=2023-02-06T14:06:40.392Z caller=namespace.go:193 level=debug msg="Querying namespace" namespace=pg_replication
ts=2023-02-06T14:06:40.393Z caller=namespace.go:193 level=debug msg="Querying namespace" namespace=pg_stat_user_tables
ts=2023-02-06T14:06:40.448Z caller=collector.go:200 level=debug msg="collector succeeded" name=database duration_seconds=0.09150201
ts=2023-02-06T14:06:40.663Z caller=namespace.go:193 level=debug msg="Querying namespace" namespace=pg_statio_user_tables
ts=2023-02-06T14:06:40.664Z caller=namespace.go:236 level=info err="Error running query on database \"<database_host:port>\": pg_statio_user_tables pq: column \"toast_blks_re\" does not exist"
ts=2023-02-06T14:06:40.664Z caller=namespace.go:193 level=debug msg="Querying namespace" namespace=pg_database”

pankdhnd avatar Mar 23 '23 12:03 pankdhnd

This sounds like an error in your queries.yaml file. Is this a customer queries.yaml file?

sysadmind avatar Mar 29 '23 23:03 sysadmind

@sysadmind, I deployed the exporter using official helm chart. The query is from the official chart, I did not make any change to it.

pankdhnd avatar Apr 05 '23 17:04 pankdhnd

There is not an "official" helm chart, but there is one provided from the prometheus-community/helm-charts repo. This is a prometheus-community project, but separate from this project.

toast_blks_re is not a column name in our default queries.yml or the queries.yml from the helm chart. I would check your configmap to see if something went wrong templating that file.

sysadmind avatar Apr 13 '23 01:04 sysadmind