forked from prometheus/prometheus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding README to explain the example
- Loading branch information
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
documentation/examples/contrib/kubernetes/rabbitmq/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# RabbitMQ Scraping | ||
|
||
This is an example on how to setup RabbitMQ so prometheus can scrap data from it. | ||
It uses a third party [RabbitMQ exporter](https://github.com/kbudde/rabbitmq_exporter). | ||
|
||
Since the [RabbitMQ exporter](https://github.com/kbudde/rabbitmq_exporter) needs to | ||
connect on RabbitMQ management API to scrap data, and it defaults to localhost, it is | ||
easier to simply embed the **kbudde/rabbitmq-exporter** on the same pod as RabbitMQ, | ||
this way they share the same network. | ||
|
||
With this pod running you will have the exporter scraping data, but prometheus have not | ||
yet found the exporter and is not scraping data from it. | ||
|
||
For more details on how to use kubernetes service discovery take a look on the | ||
[documentation](http://prometheus.io/docs/operating/configuration/#kubernetes-sd-configurations-kubernetes_sd_config) | ||
and on the [available examples](./documentation/examples). | ||
|
||
After you got Kubernetes service discovery up and running you just need to advertise that RabbitMQ | ||
is exposing metrics. To do that you need to define a service that: | ||
|
||
* Exposes the exporter port | ||
* Add the annotation: prometheus.io/scrape: "true" | ||
* Add the annotation: prometheus.io/port: "9090" | ||
|
||
And you should be able to see your RabbitMQ exporter being scrapped on prometheus status page. | ||
Since the ip that will be scrapped will be the pod endpoint it is important that the node | ||
where prometheus is running have access to the Kubernetes overlay network | ||
(flannel, weave, aws, or any of the other options that Kubernetes gives to you). |