What does "rabbitmq_rejected_total" metric mean?

Viewed 159

I have a Spring Boot application with Spring AMQP. If I call /prometheus I get all metrics including rabbitmq_rejected_total. What does rabbitmq_rejected_total mean?

Output

[...]
# HELP rabbitmq_rejected_total  
# TYPE rabbitmq_rejected_total counter
rabbitmq_rejected_total{application="test-service",name="rabbit",} 0.0
[...]

Question

Does rabbitmq_rejected_total mean rejected and requeued (ImmediateRequeueAmqpException)? Or, does it mean rejected and not requeued (AmqpRejectAndDontRequeueException)?

See also Negative Acknowledgements:

The AMQP 0-9-1 specification defines the basic.reject method that allows clients to reject individual, delivered messages, instructing the broker to either discard them or requeue them.

Research

I read Spring AMQP, but I could not find any documentation about metrics.

I read Spring Boot Reference Documentation, but I could not find any documentation about this metric.

1 Answers

The only metrics maintained by Spring AMQP are listener metrics

https://docs.spring.io/spring-amqp/docs/current/reference/html/#micrometer

i.e. how your listener performs when processing messages.

Metrics maintained by the RabbitMQ amqp-client are described here https://blog.rabbitmq.com/posts/2018/04/rabbitmq-java-client-metrics-with-micrometer-and-datadog/

If you have questions about those metrics, I suggest you ask on the rabbitmq-users Google group.

My guess is this one is a count of how many messages were rejected (in Spring AMQP terms, when the listener throws an exception). Rejected messages may be requeued and redelivered, or discarded (optionally being sent to a DLQ).

Related