Closed jpds closed 3 months ago
On a closer inspection - v0.22.3
is main#a143ef60
- no idea why the HTTP endpoint isn't returning any data with the reproducer.
Edit: works with:
[dependencies]
#metrics = "0.22.3"
metrics = { git = "https://github.com/metrics-rs/metrics", branch = "main" }
metrics-exporter-prometheus = { git = "https://github.com/metrics-rs/metrics", branch = "main" }
No idea what's happening there.
Sorry, I'm a little confused.
So it works if you use metrics@v0.22.3
and metrics-exporter-prometheus@v0.14.0
, and it works if you use metrics@main
and metrics-exporter-prometheus@main
... what's the combination of metrics
/metrics-exporter-prometheus
that doesn't work?
It doesn't work with metrics@main
, metrics-exporter-prometheus@v0.14.0
.
OK, that makes sense.
Due to the global static used to hold the global recorder reference, you can't mix and match versions of metrics
. In this case, you're registering metrics via metrics@main
, and metrics-exporter-prometheus@v0.14.0
is installing itself to metrics@v0.22.x
. This means it never has a chance to see the registered metric because it's pointed at an entirely different global static.
I have this minimum reproducer code:
When I use the released version:
The metric is displayed:
However, if I swap out the released version for
main#a143ef60
- nothing is returned.