Replies: 2 comments
-
|
I'd be careful about that, especially in large deployments where number of namespaces can be large so the label growth could be unbounded. If you are ok with that you could write a storage middleware (see here for examples of existing middleware) which would add var namespacePushCounter = prometheus.NewCounterVec(
prometheus.CounterOpts{
Name: "distribution_namespace_push_total",
Help: "Counts the number of pushes to namespaces.",
},
[]string{"namespace"},
)Then in the storage middleware you would extract the namespace and increment the counter for it like so: namespacePushCounter.With(prometheus.Labels{"namespace": SOME_NAMESPACE}).Inc()In any case I would recommend to avoid doing this due to what I said above. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks! I will try it out |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I want to collect stats per namespace via prometheus
Beta Was this translation helpful? Give feedback.
All reactions