foyer-rs / foyer

Hybrid in-memory and disk cache in Rust
https://github.com/foyer-rs/foyer
Apache License 2.0
244 stars 19 forks source link

Can't get the metrics info by metrics_prometheus crate #688

Closed Ma1oneZhang closed 1 week ago

Ma1oneZhang commented 1 week ago

I used to register the foyer crate metrics into my own prometheus registry like belowing code

metrics_prometheus::install();
// do something

But after the version update(0.10.1 => 0.11.1), i can't use it to access th metrics in foyer crate anymore.

How can i solve the problem?

MrCroxx commented 1 week ago

Hi @Ma1oneZhang . Thank you for reporting.

Would you mind provide more information about the environment? Like metrics-prometheus version you are using, are you using non-default metrics registry, etc.

If you are using non-default registry, you can refer to the docs of metrics-prometheus, or sample usage in RisingWave.

https://github.com/risingwavelabs/risingwave/blob/71753f11223cd0b4d67ba6baf7ac636fa246e7fc/src/storage/src/store_impl.rs#L632-L634

Ma1oneZhang commented 1 week ago

I'm using default registry, i just repair some update changes and the metrics not working anymore.

BTW, the version of metrics-prometheus is 0.7.0, the foyer is the lastest version 0.11.1 with mtrace feature.

MrCroxx commented 1 week ago

And the version of metrics and metrics-prometheus?

FYI: https://github.com/instrumentisto/metrics-prometheus-rs/issues/10

MrCroxx commented 1 week ago

Verified with @Ma1oneZhang offline. This is caused by they are using wrong registry. Close.