rabbitmq / rabbitmq-prometheus

A minimalistic Prometheus exporter of core RabbitMQ metrics
Other
147 stars 110 forks source link

Expose a metric that reports federated exchanges and if they are in sync #21

Closed Cellebyte closed 4 years ago

Cellebyte commented 4 years ago

Motivation

With more complex setups the federation plugin is used in many setups. As the external exporter from https://github.com/kbudde/rabbitmq_exporter I would like the possibility to expose metrics for federations.

michaelklishin commented 4 years ago

We have discussed similar metrics in the past unrelated to federation. The idea of two entities being "in sync" is something that is easier said than done. Consider a leader replica and one follower that is three messages behind. Is this a reason to be alarmed? Well, if the rate is 1 message/hour, then possibly. If the rate is 30K/second then it would be a natural course of events at almost any given point. The same fundamental problem applies to federated exchanges. In fact, since federated exchanges are not stateful entities (exchanges are just names for routing tables), it's not even clear what to measure on the upstream end.

Sorry but this idea isn't specific enough for us to implement, both because of the complications listed above and because of the general briefness of the problem statement.

michaelklishin commented 4 years ago

What can be done for federation links is the same thing we already do for inter-node communication links: connectivity/state charts.

Cellebyte commented 4 years ago

Yes i only mean state charts. And not the sync status at all. It should only report what the admin panel for federation shows as a state. Currently their is no option to see if federation is working at all. Sorry that I messed that up.

So the other exporter only reports the state which should be fine for most usecases.

https://github.com/kbudde/rabbitmq_exporter/blob/master/exporter_federation.go