Simplest way to export executor queue size to Prometheus

844 views Asked by At

I'm migrating existing service metrics to Prometheus, I'm trying to find the cleanest way to export existing executor metrics:

For example if I want to expose:

executorService.getQueue().size()

I could have a gauge that increments on submitting a new task to the executor and decrements when it finishes. However that changes the current metric behavior (and requires quite a bit of refactoring).

If instead I convert it to a collector, then I run into the fact that Prometheus complains about there are duplicate #HELP blocks for the same metric. (This happens because I have multiple executors and am using labels to break them apart).

0

There are 0 answers