noxdafox / rabbitmq-cloudwatch-exporter

RabbitMQ Plugin for publishing cluster metrics to AWS CloudWatch
Mozilla Public License 2.0
41 stars 9 forks source link

CloudWatch routingKey Metrics #38

Closed Cimballi closed 2 years ago

Cimballi commented 3 years ago

Hi ! Thanks for that great plugin. I am using RabbitMQ with the Stomp plugin. I don't know if I configured everything correctly, but I can see an "amq.topic" exchange containing my main topics as routing keys, and then I can see the consumers on the queues tab. So, everything is working fine but what I'd like to do is be able to get metrics for the routingKeys. These routingKeys are my main topics and I'd like to be able to track nb of messages and nb of consumers per topic / routingKey. Is that possible ?

noxdafox commented 3 years ago

Hello,

could you provide me an example setup which I could use for testing it?

How am I supposed to configure the exchange/queues in order to see the routingKeys?

Could you provide an example configuration? Either via shell commands or via rabbitmq config?

Cimballi commented 3 years ago

There is no specific setup, I just installed RabbitMQ with 2 plugins (+ this project) : sudo rabbitmq-plugins enable rabbitmq_management sudo rabbitmq-plugins enable rabbitmq_stomp

Then I have Spring Boot app which I configured so that RabbitMQ is used as a broker relay. I open a Stomp connection on "/topic/mytopic" and on the RabbitMQ console you will see an "amq.topic" exchange with a "mytopic" routingKey.

Is that what you are asking for ?

noxdafox commented 2 years ago

This plugin collects the internal metrics of RabbitMQ and forwards them to CloudWatch. It does not collect the metrics itself.

I had a look at the broker metrics and it does not collect metrics per routing key. I guess it's because it would add a bit of overhead considering that the amount of published routing keys can virtually be infinite.

Hence, I am afraid this cannot be solved in the plugin itself. I would suggest to open a ticket to RabbitMQ itself and see if they can add this level of granularity in their metrics.