Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance the MetricsCollector to distinguish metrics for NACK (requeue = true) vs NACK (requeue = false) #1442

Open
matsev opened this issue Oct 9, 2024 · 1 comment

Comments

@matsev
Copy link

matsev commented Oct 9, 2024

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

To my understanding there are currently no metrics emitted that distinguish whether or not a message was requeued when it was NACK:ed by the consumer

Describe the solution you'd like

One suggestion is to enhance the MetricsCollector with a new methods:

    default public void basicNack(Channel channel, long deliveryTag, boolean requeue) {
    }

    default public void basicReject(Channel channel, long deliveryTag, boolean requeue) {
    }

These methods would then be called with the requeue parameter provided whenever a messages is NACK:ed. Moreover, existing implementation such as the MicrometerMetricsCollector should implement the methods so that the metrics emitted also has knowledge about the requeue state

Describe alternatives you've considered

Application developers can implement their own custom metrics

Additional context

Related question at Stack Overflow: https://stackoverflow.com/questions/79069702/reactive-rabbitmq-metrics-for-ack-nack-requeue-false-and-nack-requeue-t

@acogoluegnes
Copy link
Contributor

This makes sense. The tricky part would be to maintain compatibility by keeping the nacked and rejected existing metrics without the requeue information, and new metrics with the requeue information.

PR welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants