Is there a way to get the count of running tasks?

Yes. The task/running/count indexing service metric will do it. Here’s some context.

Hi,

Yes, You can run an API service

  • /druid/indexer/v1/runningTasks

Retrieve list of running tasks. Equivalent to /druid/indexer/v1/tasks?state=running.

Example:

curl -u name_user:password_user -X ‘GET’ -H ‘Content-Type:application/json’ http://IP_SERVER:8081/druid/indexer/v1/runningTasks

You can see the following link API reference · Apache Druid

At the end you use a grep to find the lines that meet the condition and then you count the lines

curl -u name_user:password_user -X ‘GET’ -H ‘Content-Type:application/json’ http://IP_SERVER:8081/druid/indexer/v1/runningTasks > salida.json

grep -o -i RUNNING salida.json | wc -l

2 Likes

@tiactualicese thanks for the detailed explanation! Hopefully you’ll have time to share more knowledge with the community :rocket: