autometrics-dev / autometrics-py

Easily add metrics to your code that actually help you spot and debug issues in production. Built on Prometheus and OpenTelemetry.
https://autometrics.dev
Apache License 2.0
214 stars 7 forks source link

Modify build_info query to also look for `build_info_total` #73

Closed brettimus closed 5 months ago

brettimus commented 1 year ago

Because of https://github.com/autometrics-dev/autometrics-py/issues/38, the build_info functionality does not work out-of-the-box

What's happening is that opentelemetry-python is converting the gauge to a counter, thus the metric name is build_info_total instead of build_info.

We could modify the queries to accommodate this issue, until it's resolved upstream:

* on (instance, job) group_left(version, commit) (
  last_over_time({
    __name__=~"build_info(_total)?"
  }[${interval}])
  or on (instance, job) up
)