nytimes / collectd-rabbitmq

A collected plugin, written in python, to collect statistics from RabbitMQ.
https://collectd-rabbitmq.readthedocs.org/
Other
145 stars 79 forks source link

Refactoring metric naming by not changing host or plugin, but specify… #59

Closed anitakrueger closed 2 years ago

anitakrueger commented 7 years ago

This will rename metrics so they will stay at the same host and only plugin-instance and type-instance can be overwritten. From looking at other python plugins and for example the GenericJMX plugin, the metric would always be prefixed with the plugin name, but the host was never changed.

The metrics now look like this:

drwxr-xr-x 2 graphite graphite 4096 Jun 12 16:05 rabbitmq-overview-cluster_rabbit_at_minion3_example_com
drwxr-xr-x 2 graphite graphite 4096 Jun 12 13:54 rabbitmq-vhost-default-exchanges-hexchange
drwxr-xr-x 2 graphite graphite   27 Jun 12 13:54 rabbitmq-vhost-default-exchanges-hexchange-details
drwxr-xr-x 2 graphite graphite 4096 Jun 12 00:30 rabbitmq-vhost-default-queues-hello
drwxr-xr-x 2 graphite graphite   24 Jun 12 00:30 rabbitmq-vhost-default-queues-hello-details
rabbitmq-overview-cluster_rabbit_at_minion3_example_com:
total 15300
-rw-r--r-- 1 graphite graphite 1041184 Jun 12 16:18 ack.wsp
-rw-r--r-- 1 graphite graphite 1041184 Jun 12 16:18 confirm.wsp
-rw-r--r-- 1 graphite graphite 1041184 Jun 12 16:18 deliver_get.wsp
-rw-r--r-- 1 graphite graphite 1041184 Jun 12 16:18 deliver_noack.wsp
-rw-r--r-- 1 graphite graphite 1041184 Jun 12 16:18 deliver.wsp
-rw-r--r-- 1 graphite graphite 1041184 Jun 12 16:18 publish.wsp
-rw-r--r-- 1 graphite graphite 1041184 Jun 12 16:18 rabbitmq_channels.wsp
-rw-r--r-- 1 graphite graphite 1041184 Jun 12 16:18 rabbitmq_connections.wsp
-rw-r--r-- 1 graphite graphite 1041184 Jun 12 16:18 rabbitmq_consumers.wsp
-rw-r--r-- 1 graphite graphite 1041184 Jun 12 16:18 rabbitmq_exchanges.wsp
-rw-r--r-- 1 graphite graphite 1041184 Jun 12 16:18 rabbitmq_messages_ready.wsp
-rw-r--r-- 1 graphite graphite 1041184 Jun 12 16:18 rabbitmq_messages_unacknowledged.wsp
-rw-r--r-- 1 graphite graphite 1041184 Jun 12 16:18 rabbitmq_messages.wsp
-rw-r--r-- 1 graphite graphite 1041184 Jun 12 16:18 rabbitmq_queues.wsp
-rw-r--r-- 1 graphite graphite 1041184 Jun 12 16:18 redeliver.wsp

rabbitmq-vhost-default-exchanges-hexchange:
total 12240
-rw-r--r-- 1 graphite graphite 1041184 Jun 12 16:18 ack.wsp
-rw-r--r-- 1 graphite graphite 1041184 Jun 12 16:18 confirm.wsp
-rw-r--r-- 1 graphite graphite 1041184 Jun 12 16:18 deliver_get.wsp
-rw-r--r-- 1 graphite graphite 1041184 Jun 12 16:18 deliver_noack.wsp
-rw-r--r-- 1 graphite graphite 1041184 Jun 12 16:18 deliver.wsp
-rw-r--r-- 1 graphite graphite 1041184 Jun 12 16:18 get_noack.wsp
-rw-r--r-- 1 graphite graphite 1041184 Jun 12 16:18 get.wsp
-rw-r--r-- 1 graphite graphite 1041184 Jun 12 16:18 publish_in.wsp
-rw-r--r-- 1 graphite graphite 1041184 Jun 12 16:18 publish_out.wsp
-rw-r--r-- 1 graphite graphite 1041184 Jun 12 16:18 publish.wsp
-rw-r--r-- 1 graphite graphite 1041184 Jun 12 16:18 redeliver.wsp
-rw-r--r-- 1 graphite graphite 1041184 Jun 12 16:18 return.wsp

rabbitmq-vhost-default-exchanges-hexchange-details:
total 1020
-rw-r--r-- 1 graphite graphite 1041184 Jun 12 16:18 publish_in.wsp

rabbitmq-vhost-default-queues-hello:
total 16384
-rw-r--r-- 1 graphite graphite 1041184 Jun 12 16:18 ack.wsp
-rw-r--r-- 1 graphite graphite 1041184 Jun 12 16:18 confirm.wsp
-rw-r--r-- 1 graphite graphite 1041184 Jun 12 16:18 consumers.wsp
-rw-r--r-- 1 graphite graphite 1041184 Jun 12 16:18 deliver_get.wsp
-rw-r--r-- 1 graphite graphite 1041184 Jun 12 16:18 deliver_noack.wsp
-rw-r--r-- 1 graphite graphite 1041184 Jun 12 16:18 deliver.wsp
-rw-r--r-- 1 graphite graphite 1041184 Jun 12 16:18 get_noack.wsp
-rw-r--r-- 1 graphite graphite 1041184 Jun 12 16:18 get.wsp
-rw-r--r-- 1 graphite graphite 1041184 Jun 12 16:18 messages_ready.wsp
-rw-r--r-- 1 graphite graphite 1041184 Jun 12 16:18 messages_unacknowledged.wsp
-rw-r--r-- 1 graphite graphite 1041184 Jun 12 16:18 messages.wsp
-rw-r--r-- 1 graphite graphite 1041184 Jun 12 16:18 publish_in.wsp
-rw-r--r-- 1 graphite graphite 1041184 Jun 12 16:18 publish_out.wsp
-rw-r--r-- 1 graphite graphite 1041184 Jun 12 16:18 publish.wsp
-rw-r--r-- 1 graphite graphite 1041184 Jun 12 16:18 redeliver.wsp
-rw-r--r-- 1 graphite graphite 1041184 Jun 12 16:18 return.wsp

rabbitmq-vhost-default-queues-hello-details:
total 1024
-rw-r--r-- 1 graphite graphite 1041184 Jun 12 16:18 publish.wsp

Yes, this is a breaking change unfortunately. May be there is a way to keep backward compatibility?

anitakrueger commented 7 years ago

This is my fault as I haven't updated the tests :( I will get to that tonight!

anitakrueger commented 7 years ago

@jimbydamonk would you be able to take a look at those build errors? I can't figure out why the assertion fails :( been looking at the mock code and updated all the tests, but somehow when it calls dispatch_values, it fails. I don't understand why :( Would appreciate your help.