deadtrickster / prometheus_rabbitmq_exporter

Prometheus.io exporter as a RabbitMQ Managment Plugin plugin
MIT License
291 stars 72 forks source link

Add metric indicating whether a connection is flow-controlled #34

Closed godefroi closed 6 years ago

godefroi commented 6 years ago

RabbitMQ has the ability to inform administrators when a connection (or channels, or queues) is in "flow control", meaning that the server can't process messages as fast as the connection wants to publish them. This can indicate all kinds of things, things that would be useful to be able to monitor.

It would be great if the exporter made this information available.

deadtrickster commented 6 years ago

Definitely worth having. However, flow is a state of a connection, meaning I should go over all connections and there can be many connections... Also, it doesn't make sense to export all connections probably. Perhaps something like rabbitmq_connections_total{state="ok|blocking|blocked|flow"}.

godefroi commented 6 years ago

Yes, I think that'd be entirely sufficient, without inflating the number of time series.

deadtrickster commented 6 years ago

I added a new metric - rabbitmq_connections_state. New plugin build is attached. Please rename zip to ez! If this works I'll make a new release.

prometheus_rabbitmq_exporter-v3.7.1.1.zip

godefroi commented 6 years ago

I gave this a shot (in RabbitMQ 3.7.2), and when I try to enable the accept plugin, I'm told that it was built with an incompatible erlang. I'm using 19.3, should I be on 20.x instead?

deadtrickster commented 6 years ago

I built in on 20.x, yes. Release versions are built on 19.3. If you can't try on 20.x let me know I'll rebuild on 19.3 and re-upload here

deadtrickster commented 6 years ago

ping

godefroi commented 6 years ago

Sorry, I ended up updating my erlang install and getting distracted with other things. The version you posted seems to work fine, though I do admit I liked the name rabbitmq_connections_total better than rabbitmq_connections_state.

deadtrickster commented 6 years ago

I like connections_total more too, unfortunately it's already assigned to a counter without labels (all existing dashboard will need to get updated + I plan to make this new metric optional). I won't be merging it right now, will try to come up with a better name in next few days. If you have suggestion please share.

godefroi commented 6 years ago

rabbitmq_connections is there, but I don't see a rabbitmq_connections_total. Unless it's not enabled by default?

I would imagine that the new one that breaks out the states would eventually replace rabbitmq_connections, which would become deprecated.

deadtrickster commented 6 years ago

Released with rabbitmq_connections_total. Thanks for the help!