To enable the Prometheus plugin, from the CloudAMQP Console go to Plugins and
enable rabbitmq_prometheus. When enabled, metrics will be exposed on the /metrics
endpoint - for example
Connections, channels and queue metrics are aggregated by default. If you don't want aggregated metrics, send us an email at email@example.com and we can tweak the configuration.
Metrics are exposed in the following format:
# TYPE rabbitmq_connections_opened_total counter # HELP rabbitmq_connections_opened_total Total number of connections opened rabbitmq_connections_opened_total 2 # TYPE rabbitmq_connections_closed_total counter # HELP rabbitmq_connections_closed_total Total number of connections closed or terminated rabbitmq_connections_closed_total 11
Before you get started, we recommend reviewing the Prometheus documentation here.
We also recommend that you install Prometheus on a separate server to your CloudAMQP instance. After the installation of Prometheus, you need to change a couple of values in the prometheus.yml file. The following is an example configuration file with recommendations:
# global config global: scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 60 seconds scrape_timeout: 15s # How long until a scrape request times out. Default is 10 seconds # A list of scrape configurations. scrape_configs: # The job name assigned to scraped metrics by default. - job_name: 'cloudamqp' basic_auth: username: 'USERNAME' password: 'PASSWORD' scheme: https #necessary for cloudamqp instances # metrics_path defaults to '/metrics', which is the one used by cloudamqp instances so no need to define. # static_configs allows specifying a list of targets and a common label set for them. static_configs: - targets: ['your-host-01.rmq.cloudamqp.com', 'your-host-02.rmq.cloudamqp.com']
Those of you running multi-node clusters should make sure you are targeting each node in the cluster, as the example shows. For more ways to configure Prometheus, read the documentation here.
After starting Prometheus, review the targets to make sure they are running without errors.
If you are having issues, Prometheus can be started with the option
For metrics visualization, install Grafana on a separate server to your CloudAMQP instance. Either download or get a hosted version of Grafana here.
More information from RabbitMQ can be found here.
Feel free to contact us at firstname.lastname@example.org if you have any suggestions or feedback.