Refactored querying RabbitMQ query status from RabbitMQ admin api - #137
Conversation
This changes the way the scheduled RabbitMQ admin api is queried to get the latest stats on queries. It used to query per worker queue, but this change queries the data for all queues at once. This will make it easier to also get status on all client queues. This change is in preparation to create telemetry metrics on client queues. To keep things simple the changes for client queue metrics is not included in this pr. Most of the changes in the pr are due to using a record to pass the states instead of the individual values to methods. It also changes the frequency the api is queried to each 20 seconds. It was 60 seconds, but it did that for each worker queue. With this change it only needs 1 call and we'll get slightly more detailed data by querying a bit more often.
|
is the difference between If that's the case I would be open to simplify taskmanager a bit and simply fetch all queues every 10 seconds and use that and get rid of the events_exchange.. Or did we use it for other purposes as well? |
|
@SerhatG Yes that is how it works. The event_exchange is also only used here. |
…vents, and reduced generic update frequency to 10 seconds 10 seconds update frequency is enough to handle worker changes. Removing the additional event based trigger reduces complexity of the code.
BertScholten
left a comment
There was a problem hiding this comment.
LGTM, just 1 check question about test data
This changes the way the scheduled RabbitMQ admin api is queried to get the latest stats on queries. It used to query per worker queue, but this change queries the data for all queues at once.
This will make it easier to also get status on all client queues. This change is in preparation to create telemetry metrics on client queues.
To keep things simple the changes for client queue metrics is not included in this pr.
Most of the changes in the pr are due to using a record to pass the states instead of the individual values to methods. It also changes the frequency the api is queried to 10 seconds. It was 60 seconds, but it did that for each worker queue. With this change it only needs 1 call and we'll get slightly more detailed data by querying a bit more often.
With this change the event based update of channels state triggered by RabbitMQ events has been removed, as the new 10 seconds update fast enough to handle changes.