client_rust icon indicating copy to clipboard operation
client_rust copied to clipboard

Allow multiple labels in sub_registry_with_label method

Open popadi opened this issue 1 year ago • 2 comments

Hey

I have a bunch of counters coming from from processes running on different hosts and I'd like to have them labeled with about 2-3 labels to be able to query them in my dashboards.

Is there a reason sub_registry_with_label accepts a single label? What if I want to add 2-3 labels to a bunch of metrics (globally)?

popadi avatar May 26 '23 14:05 popadi

Thanks for writing this out. Never thought there would be the need for more than one label. Happy to accept a contribution @popadi. Off the top of my head, what do you think of adding Registry::sub_registry_with_labels taking an I: Iterator<Item = (Cow<'static, str>, Cow<'static, str>)>?

mxinden avatar May 28 '23 06:05 mxinden

Thanks for the quick response. I will implement this & add tests in the coming days.

popadi avatar May 28 '23 07:05 popadi