justwatchcom / sql_exporter

Flexible SQL Exporter for Prometheus.
MIT License
402 stars 109 forks source link

Skip metric update if no values are defined in configuration #126

Closed Arnoways closed 4 months ago

Arnoways commented 5 months ago

With the recent addition of histograms to measure query times, we might have no interest in defining values for our queries. Even with allow_zero_rows set to true, we still end up with errors within the logs. This PR corrects minor typos and adds a condition that will skip the updateMetrics if q.values is empty

dewey commented 4 months ago

Thank you, this looks good!