Closed mfuhrmann closed 1 year ago
As far as I know, that is not what this function does. The metric does not get scraped either way. It is to prevent errors being thrown if zero rows are returned.
By default, the exporter expects every metric to return a result. If zero rows are returned (and allow_zero_rows
is set to false
or not specified), an error will be thrown as the query is assumed to be faulty. If it is set to true, zero rows is assumed to be a valid response which it can be, depending on the query.
OK. Thanks for the feedback. Closing
Regarding https://github.com/justwatchcom/sql_exporter/pull/39
allow_zero_rows
true
orfalse
should help if a query does not get a row as result. I was using an old version0.4.0
that didn't include the patch mentioned above. Now I am usinghttps://apt.postgresql.org/pub/repos/apt/pool/main/p/prometheus-sql-exporter/prometheus-sql-exporter_0.4.5-1.pgdg22.04+1_amd64.deb
But I still don't see any difference in the behavior.
The error is still the same:
{"caller":"job.go:205","err":"zero rows returned","job":"lindeconnect_hr","level":"warn","msg":"Failed to run query","query":"corrupt_cus_portal","ts":"2022-11-21T14:36:25.857520723Z"}
Doesn't matter if I settrue
orfalse
. I would have expected that I get the metric scraped with a value ofzero
.An example query what I've used looks like:
How should that work?