To be a little more clear about the idea in B) Imagine I have „exportable“, „status“ and „host“ as labels. For the anonymous reporting case I‘d collect all the metrics that have „exportable“=„yes“ (or „purpose“=„export“ or whatever). I can see CounterVec has GetMetricsWith but returns a single Counter, not a filtered CounterVec, so filtering by a partial labels map doesn‘t seem supported?
On Sunday, June 20, 2021 at 10:15:40 AM UTC+2 andig wrote: > I need to collect anonymous HTTP statistics from user installations. For > security reasons, I only want to collect metrics about HTTP requests for > particular purpose, while having the entire set of metrics available > locally. > > I‘m wondering how to best achieve this: > A) have separate metrics per „exportable“ and „local“ and a bunch of if > statement to determine if the metric should be updated or not > B) (preferred) have a mechanism of always updating the metrics and filter > for exporting by label (e.g. I could have a CounterVec with a purpose label > that I would export only if purpose was „public“). > > I‘ve not found any filtering mechanism to implement B) though. > > What is a good approach to achieve the requirements? > -- You received this message because you are subscribed to the Google Groups "Prometheus Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/3ce8c5cf-d542-46b6-bf94-ff1fafcc01aan%40googlegroups.com.

