tikv / rust-prometheus

Prometheus instrumentation library for Rust applications
Apache License 2.0
1.04k stars 182 forks source link

Refactor `Registry::new_custom()` to accept `AsRef<str>` instead of `String` for improved flexibility #522

Open j3rrywan9 opened 1 month ago

j3rrywan9 commented 1 month ago

Refactor Registry::new_custom() to accept AsRef<str> instead of String for improved flexibility, so that the labels! macro can be used for the 2nd parameter here. For example:

let registry = Registry::new_custom(Some("test"), Some(labels!{"environment" => "test"})).unwrap();