cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Write a DQL query for getting max number of rabbitmq messages for a specific timeframe for last 30 days

simonwu42195
Visitor

Currently we have a DQL query running in workflow for checking the max value of one of the rabbitmq queues from 22:00 to 23:59 and send us alert if the max value is lower than the threshold. The workflow running in the midnight.

timeseries ready = max(rabbitmq.queue.messages_ready),
by:{queue}, from:now()-2h, to:now()
| fields readyMax = round(arrayMax(ready), decimals: 0), queue
| filter queue == "Dialler.DecisionTrigger2"

 

Now we would like to have some analysis for the rabbitmq result. We would like to make a summary for the max value of rabbitmq messages from 22:00 to 23:59 for last 3 months by each day as a table format as below:

|Date | max value|
|2025-7-1| 115k|
|2025-7-2| 35k|
|2025-7-3| 60k|
|2025-7-4| 95k|
|2025-7-5| 55k|
...  

However, we are not familiar to expand the above DQL query including the time filtering and summary part. any help will be appreciated.

 

2 REPLIES 2

simonwu42195
Visitor

I have slightly modified the dql query for extracting that data that I need, and then extract to csv, add the filtering for the report that I want. Not sure if there is better way to do so.

timeseries value = max(rabbitmq.queue.messages), interval: 1h,
by:{queue}
// *** timeseries interval splitter start ***
| fields queue, timeslot=record(
timeframe.start = timeframe[start] + interval * iIndex(),
value[]
/* add any dimension split (by:) field names here */

)
| filter queue == "Dialler.DecisionTrigger2"
//| filter getHour(timeframe[start]) >= 19
| expand timeslot
| fieldsFlatten timeslot
| fieldsRemove timeslot

simonwu42195
Visitor

Annotation 2025-07-18 183309.jpg

Featured Posts