Browse Source

Add RabbitMQ exporter for Prometheus

merge-requests/55/head
Deimos 6 years ago
parent
commit
4ada1a1235
  1. 14
      salt/salt/prometheus/exporters/prometheus_rabbitmq_exporter.service
  2. 28
      salt/salt/prometheus/exporters/rabbitmq_exporter.sls
  3. 4
      salt/salt/prometheus/prometheus.yml
  4. 1
      salt/salt/top.sls

14
salt/salt/prometheus/exporters/prometheus_rabbitmq_exporter.service

@ -0,0 +1,14 @@
[Unit]
Description=Prometheus RabbitMQ Exporter
After=syslog.target network.target
[Service]
Type=simple
RemainAfterExit=no
WorkingDirectory=/opt/prometheus_rabbitmq_exporter
User=prometheus
Group=prometheus
ExecStart=/opt/prometheus_rabbitmq_exporter/rabbitmq_exporter
[Install]
WantedBy=multi-user.target

28
salt/salt/prometheus/exporters/rabbitmq_exporter.sls

@ -0,0 +1,28 @@
# Download/extract and set up the rabbitmq exporter
include:
- prometheus.user
unpack-rabbitmq-exporter:
archive.extracted:
- name: /opt/prometheus_rabbitmq_exporter
- source:
- salt://prometheus/exporters/rabbitmq_exporter-1.0.0-WIP.linux-amd64.tar.gz
- https://github.com/kbudde/rabbitmq_exporter/releases/download/v1.0-wip1/rabbitmq_exporter-1.0.0-WIP.linux-amd64.tar.gz
- source_hash: sha256=d478dcf72d8a5175a4f3ea6b8e0356f64e2fcdb7b65bb5bfc0bd161d896abc4a
- if_missing: /opt/prometheus_rabbitmq_exporter
- user: prometheus
- group: prometheus
- options: --strip-components=1
- enforce_toplevel: False
/etc/systemd/system/prometheus_rabbitmq_exporter.service:
file.managed:
- source: salt://prometheus/exporters/prometheus_rabbitmq_exporter.service
- user: root
- group: root
- mode: 644
prometheus-rabbitmq-exporter-service:
service.running:
- name: prometheus_rabbitmq_exporter
- enable: True

4
salt/salt/prometheus/prometheus.yml

@ -7,6 +7,10 @@ scrape_configs:
static_configs:
- targets: ['localhost:9100']
- job_name: "rabbitmq"
static_configs:
- targets: ['localhost:9419']
- job_name: "redis"
static_configs:
- targets: ['localhost:9121']

1
salt/salt/top.sls

@ -15,6 +15,7 @@ base:
- cmark-gfm
- prometheus.exporters.node_exporter
- prometheus.exporters.postgres_exporter
- prometheus.exporters.rabbitmq_exporter
- prometheus.exporters.redis_exporter
- consumers
- site-icons-spriter

Loading…
Cancel
Save