Monitoring Thread pool metrics through promethues

20 Views Asked by At

I want to monitor all executors and figure out if there is any bad code leading to bottlenecks in specific thread pools for eg. doing join calls without future completed causes theads to be in waiting state and the pool is occupied, which leads to the pool not having threads to process new requests. It will be interesting to have dashboard to show such issues. Has anyone captured Executor metrics and created dashboard for this?

1

There are 1 best solutions below

0
echatman On

I assume you're using Java, so for collecting the metrics you could take a look at the micrometer library, which has support for executor metrics: https://docs.micrometer.io/micrometer/reference/reference/jvm.html You don't mention what tool you're using for creating dashboards, but you can query the metrics with things like:

  • sum(rate(executor_completed[5m])) by (name)
  • sum(rate(executor_completed{name="NameOfSpecificExecutor"}[5m]))
  • sum(executor_active) by (name)