tikv / rust-prometheus

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

Remove metrics subset based on partial labels match #438

Open Antiarchitect opened 2 years ago

Antiarchitect commented 2 years ago

Assume I have a IntCounterVec client_tls_cert_error with labels cname and error with which I track client certificate errors. There can be different error messages which I don't know in advance (certificate expiration mostly).

In case cert goes back to normal is there any way like remove method in order to remove all client_tls_cert_error subset with matching cname and any error labels?

It would be nice to have at least remove method (which takes HashMap as input) analog that doesn't throw cardinality error but deletes all variants of the metric with matched subset of labels.