rabbitmq-server icon indicating copy to clipboard operation
rabbitmq-server copied to clipboard

Emit event if configured queue length is reached

Open ansd opened this issue 1 month ago • 0 comments

Is your feature request related to a problem? Please describe.

An operator would like to receive a notification if a queue limit, e.g. a configured max-length or max-length-bytes is reached, and possibly another notification if the queue gets emptied again.

Describe the solution you'd like

The queue emits an event to rabbit_event such that these events can be consumed by the event exchange. Events should not be emitted per message being rejected / dropped / dead-lettered to avoid excessive event creations. Instead the event should only be emitted when the queue limit is reached, and another event if the queue limit falls below some threshold (e.g. 90% of the limit).

Describe alternatives you've considered

An alternative is to dead letter messages with reason maxlen, consume from the dead letter queue and have the client app create an alert. However this solution doesn't work for overflow behaviour reject-publish.

Additional context

It's already possible today to create alerts if a queue depth reaches a specific limit, see for example

  • https://github.com/rabbitmq/cluster-operator/blob/main/observability/prometheus/rules/rabbitmq-per-object/queue-is-growing.yml
  • https://www.rabbitmq.com/blog/2021/05/03/alerting

However, this issue is specifically about alerts for the configured max-length or max-length-bytes being reached.

ansd avatar May 10 '24 08:05 ansd