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

Update prometheus exporter package (fixes issues with build info gauge when using OTEL) #92

Closed brettimus closed 10 months ago

brettimus commented 11 months ago

Finally, our build info metric should work as expected with the open-telemetry prometheus exporter!

There is some funkiness with the versioning (also mentioned in a comment below).

It looks like we downgraded the opentelemetry-exporter-prometheus pacakge from a 1.x to a 0.41... however! This is because the packaged changed how they were doing versioning about a year ago.

So, the "latest" on pypi is a 1.12 release candidate (what we've been using up until now), but that's not actually the latest release. All of the latest releases are 0.x....... it's confusing.

So, the 0.41b0 release from 4 September, 2023 is actually the latest

image
brettimus commented 11 months ago

ah this might be useless -- these packages were updated in #89

okay nevermind — the most recent releases of the prometheus exporter are being released under 0.x minor-beta branches, even though a year ago there was a major release (a 1.12 release candidate)

so, we need to fix the version to 0.41b0 to get the fix to prometheus gauges

see: https://pypi.org/project/opentelemetry-exporter-prometheus/0.41b0/#history

brettimus commented 10 months ago

alright there was an API change in the updated PrometheusMetricReader that breaks things 😭

brettimus commented 10 months ago

okay fix was easy — the old prometheus exporter from otel had a "prefix" option, which is no longer supported. we didn't seem to be using it anyhow.