I've been looking at examples in the Java and C++ client libs, and it
doesn't mirror my understanding of label rules:
https://github.com/prometheus/client_java#labels
I thought:
1. each metric could have zero or more named labels
2. each label must have a pre-determined set of allowed values
3. when setting a metric value, all label dimensions *must* be specified
from these allowed values
But the examples don't work that way:
Counter calculationsCounter = Counter.build()
.name("my_library_calculations_total").help("Total calls.")
.labelNames("key").register();
...
void processThatCalculates(String key) {
calculationsCounter.labels(key).inc(); // Run calculations. } }
In this example, I don't see where "key" allowed values are enumerated. I
also don't see how labels(key) knows which label it is referring to. I
might have multiple labels.
I wish I could find a non-trivial example which shows what the output
scrape would look like. Can anyone help?
--
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/f221c413-04cf-495b-9ae5-2d825477bab7n%40googlegroups.com.