Closed ygueguindecath closed 8 months ago
can you paste the exact error?
This might depend on your database engine, I've tried the config above with sqllite and it works with no error (and metrics are reported correctly in the output of the /metrics
endpoint.
Yes no problem, see error : 2024-01-09 10:49:38,140 - ERROR - query-exporter - query "xxxxxxxx_xxxxxx_xxxxxxx_xxxxx_xxxxxxx_xxxxxxxxx_xxxxxxxxxxxxx_1d" on database "xxx" failed: Wrong column names from query: expected (xxxxxxxx_xxxxxx_xxxxxxx_xxxxx_xxxxxxx_xxxxxxxxx_xxxxxxxxxxxxx_1), got (xxxxxxxx_xxxxxx_xxxxxxx_xxxxx_xxxxxxx_xxxxxxxxx_xxxxxxxxxxxxx_1d)
Our database is a postgresql from Aiven, you think this can occur cause of a database settings ? Thanks for your answers 😃
Oh, that's a different issue, see that the name of the column is different from the metric one (ends in _1
instead of _1d
).
It s what i said, the configuration is ok but the log trunk my metric name, the config file is correct
I'll take a closer look
It seems the metric name is hitting the name length limitation in PostgreSQL.
This is the output running a similar query on standard Postgres:
postgres=# select count(1) as xxxxxxxx_xxxxxx_xxxxxxx_xxxxx_xxxxxxx_xxxxxxxxx_xxxxxxxxxxxxx_1d;
NOTICE: identifier "xxxxxxxx_xxxxxx_xxxxxxx_xxxxx_xxxxxxx_xxxxxxxxx_xxxxxxxxxxxxx_1d" will be truncated to "xxxxxxxx_xxxxxx_xxxxxxx_xxxxx_xxxxxxx_xxxxxxxxx_xxxxxxxxxxxxx_1"
xxxxxxxx_xxxxxx_xxxxxxx_xxxxx_xxxxxxx_xxxxxxxxx_xxxxxxxxxxxxx_1
-----------------------------------------------------------------
1
(1 row)
Thanks for your investigation 🙏
Describe the bug
Hi, we use query exporer for a lot of metrics, but one configuration make us struggler and i do not know why.
We have a definition of metric like this
But at the start we got an error saying it search for metric xxx_1. I suspect a metric name length restriction as, this occur only for this query, and it's the only one that the name is more than 64 characters, but i'm not sure at all
Installation details
To Reproduce
If possible, please provide detailed steps to reproduce the behavior:
query-exporter /config.yaml -H 0.0.0.0