Hi Guys, 
I hope you are having a good weekend, I would like to have an information 
about CounterVec, is there a way to dynamically add Labels inside an 
already registered metric?

For example:

Creating a metric using two labels: status and environment
```go
metricName := "test_purposes"
help := "tests"

counter = promauto.NewCounterVec(prometheus.CounterOpts{
Name: metricName,
Help: help,
}, []string{"status", "environment"})

counter.WithLabelValues("success", "dev")
```

But when the status is error I would like to add one more label: reason, to 
the same metric and it's not possible

```go
counter = promauto.NewCounterVec(prometheus.CounterOpts{
Name: metricName,
Help: help,
}, []string{"status", "environment", "reason"})

counter.WithLabelValues("success", "dev", "npe")
```

Just to explain why I need it, we're migrating an implementation of datadog 
to prometheus and in the implementations based on datadog we have a lot of 
microservices sending metrics using different tags (labels) to the same 
metric, if I could do the same using the prometheus lib it would be great 
because we could only change the client without any modifications on metric 
publishers.

-- 
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/50a326d6-95bb-48d3-9343-fdc936dc2b49n%40googlegroups.com.

Reply via email to