albertodonato / query-exporter

Export Prometheus metrics from SQL queries
GNU General Public License v3.0
436 stars 101 forks source link

Log column names in the InvalidResultColumnNames error #149

Closed TommyDew42 closed 1 year ago

TommyDew42 commented 1 year ago

Happy to work on this issue if we find this feature desirable.

Is your feature request related to a problem? Please describe. No

Describe the solution you'd like Log column names in the InvalidResultColumnNames error. Now we don't have the wrong column names when we log the error:

query "<query-name>" on database "<db-name>" failed: Wrong column names from query

Describe alternatives you've considered

It would be great if we can have the columns in the log:

query "<query-name>" on database "<db-name>" failed: Wrong column names from query. The result column names: <column names in the result>

Additional context I got this error but i was really confused what was wrong cuz indeed nth was wrong in my sql query. It turned out my column name was too long so postgres cut it into a shorter name in the result.

albertodonato commented 1 year ago

makes sense, I've added details to the error, thanks