Closed danielllek closed 3 years ago
You haven't provided any evidence. This plugin aggregates object stats by default so individual exchange metrics won't be available. Why this is the case and what are the downsides of disabling aggregation are documented in the Prometheus guide.
I was hoping for metrics that are graphed on UI under URL/#/exchanges/VHOST/EXCHANGE
For example rabbitmq telegraf plugin returns these stats.
Exchange metrics are computed from channel metrics, exchanges do not emit stats.
rabbitmq_channel_messages_published_total - rabbitmq_channel_messages_unroutable_returned_total - rabbitmq_channel_messages_unroutable_dropped_total
To calculate Publish (In) for exchange direct
I would use the following
sum(rate(rabbitmq_channel_messages_published_total{exchange="direct"}[60s]))
To calculate Publish (Out) for the same exchange I would use:
sum(rate(rabbitmq_channel_messages_published_total{exchange="direct"}[60s])) -
sum(rate(rabbitmq_channel_messages_unroutable_returned_total{exchange="direct"}[60s])) -
sum(rate(rabbitmq_channel_messages_unroutable_dropped_total{exchange="direct"}[60s]))
Per object metrics will need to be enabled, otherwise there will be no exchange label.
Filtering by cluster name will be necessary to distinguish metrics between multiple RabbitMQ deployments.
FWIW, all available channel metrics related to exchanges: https://github.com/rabbitmq/rabbitmq-prometheus/blob/d4aeb428e9d3c869e5640137f0540e2f35344a32/src/collectors/prometheus_rabbitmq_core_metrics_collector.erl#L65-L70
Thx, I'll try that :+1:
Thanks for clarification (it wasn't clear for me that exchange stats come from channel stats).
@gerhard suggestion works perfectly :+1:
rabbitmq-prometheus plugin currently doesn't return exchange stats (published in/published out).
Is it possible to add this feature?