Re: [druid-user] List pending queries

Hey Adam,
I believe you are referring to this thread ( w.r.t segment/scan/pending, but in fact, this is a metric Druid emits (either from Historicals or real-time tasks), that shows the number of segments waiting to be scanned (in order to serve queries), see and

There is a way to see the number of queries that were executed/succeeded/failed/interrupted, if you include the QueryCountStatsMonitor (see

TBH, I’m not sure if there’s a way to list the queries that are currently running.


I see.
So there are 2 partial solutions I can think of:

  1. You can set the query ID yourself, on the query context (“sqlQueryId” for SQL queries, and perhaps “queryId” for native queries). That way, you know the query ID to use for the DELETE API.
  2. I saw this (rather old) answer from Gian, saying that you can set a timeout on the query context, to cancel long queries (

Anyway, let’s see if anyone else has a better answer for you.

Good luck, I hope you’ll find what you need :slightly_smiling_face: