add elasticsearch configuration and systemd
This commit is contained in:
@ -515,3 +515,19 @@ scrape_configs:
|
||||
{% endfor %}
|
||||
|
||||
{% endif %}
|
||||
{% if prometheus_elasticsearch_exporter_targets is defined %}
|
||||
# Elasticsearch #
|
||||
- job_name: elasticsearch
|
||||
scrape_interval: 30s
|
||||
static_configs:
|
||||
- targets:
|
||||
{% for target in prometheus_elasticsearch_exporter_targets %}
|
||||
- {{ target }}:9221
|
||||
{% endfor %}
|
||||
relabel_configs:
|
||||
- source_labels: [ __address__ ]
|
||||
target_label: instance
|
||||
regex: '(.*):9114'
|
||||
replacement: '${1}'
|
||||
|
||||
{% endif %}
|
||||
|
@ -0,0 +1,10 @@
|
||||
[Unit]
|
||||
Description=Prometheus Elasticsearch Exporter
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/usr/local/bin/prometheus-elasticsearch-exporter {% if prometheus_elasticsearch_user is defined %}--es.uri="http://{{ prometheus_elasticsearch_user }}:{{ prometheus_elasticsearch_password }}@localhost:9200"{% endif %}
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
Reference in New Issue
Block a user