I have an application that spawns many worker threads. In the main
application I create a PrometheusMetrics() helper class that registers the
metrics the threads will report on with the appropriate label names. I
pass the PrometheusMetrics class into each thread, and then create local
variables in each thread with the labels filled out differently per thread.
I start the server and I see the #HELP and #TYPE text per metric I've
registered, but I don't see any of the metrics outputs.
class PrometheusMetrics() {
lateinit var iterations = Counter.build()
.name("a_metric")
.labelNames("a","b","c")
.help("some help")
}
class main(){
prometheusMetrics =PrometheusMetrics()
forEach (iterator){
spawnWorker(prometheusMetrics)
}
}
Worker(prometheusMetrics: PrometheusMetrics){
val localMetric =
prometheusMetrics.iterations.labels('different","per","worker")
localMetric.inc()
}
Is there something fundamentally wrong with this approach?
Thanks,
Derek
--
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/ab6afea2-8656-43f1-9679-4ba90eae22f7n%40googlegroups.com.