Are individual connection metrics exposed via Prometheus? #12167
-
I was wondering if anybody knows of a way to replicate the old connections metric page vis prometheus? What I am looking for is the username, connected at, and the peer certificate subject. I have been looking at the RMQ Prom page https://www.rabbitmq.com/docs/prometheus#connectionchannel-metrics and attempting to pull the prometheus output and searhcing through it, but cannot ffind anything. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
This is not a metric that's exposed by the Prometheus scraping endpoint, including In part this is because Prometheus focusses on aggregated metrics as they are easy to visualize, in part because this is not a commonly asked for set of metrics. I'm not sure what you mean by the "old" connections page. There haven't been almost any changes to |
Beta Was this translation helpful? Give feedback.
-
I'd rather avoid adding every possible detail to the Prometheus metrics. However, something we did discuss and I still believe could be a good idea is to get rid of the
Channel PID is ephemeral and while it could be correlated with other connection details by parsing the logs and/or through the Management API (while the connection is open), this is a high cardinality value that is not useful on its own and changes whenever the client reconnects. I believe having the client-provided connection name as a label instead, would make it clear what connection this is (if your connection names are not descriptive, you can make them so) and would allow monitoring a given client even when it reconnects. The main drawback I see is that there could be multiple connections with the same name and that correlating with logs and/or Management UI based on an unstructured name could be harder than by an Erlang pid. |
Beta Was this translation helpful? Give feedback.
-
Exposing the username in Prometheus is an anti pattern described in every Prometheus 101. |
Beta Was this translation helpful? Give feedback.
Exposing the username in Prometheus is an anti pattern described in every Prometheus 101.
If you need the username, you should use a logs based monitoring tool.