add exporter for opensearch

This commit is contained in:
Clément Desvaux 2023-03-20 16:33:38 +01:00
parent f655a0fc6e
commit 7094cb13ee
4 changed files with 2672 additions and 0 deletions

View File

@ -15,6 +15,7 @@ The present role :
- mysql
- postgres
- mongodb
- opensearch (via plugin for opensearch https://github.com/aiven/prometheus-exporter-plugin-for-opensearch)
Please note that Docker and Haproxy their own embedded exporters.
- https://docs.docker.com/config/daemon/prometheus/

File diff suppressed because it is too large Load Diff

View File

@ -85,6 +85,16 @@
when: prometheus_cadvisor_exporter_targets is defined
notify: "grafana-prometheus-restart"
- name: "grafana-prometheus | import grafana opensearch dashboard"
copy:
src: dashboards/opensearch.json
dest: /opt/docker-compose/grafana-prometheus/dashboards/opensearch.json
owner: '1000'
group: '1000'
mode: '0750'
when: prometheus_opensearch_exporter_targets is defined
notify: "grafana-prometheus-restart"
- name: "grafana-prometheus | import grafana haproxy dashboard"
copy:
src: dashboards/haproxy.json

View File

@ -404,3 +404,19 @@ scrape_configs:
regex: '(.*):9221'
replacement: '${1}'
{% endif %}
{% if prometheus_opensearch_exporter_targets is defined %}
# opensearch #
- job_name: opensearch
scrape_interval: 30s
metrics_path: "/_prometheus/metrics"
static_configs:
- targets:
{% for target in prometheus_opensearch_exporter_targets %}
- {{ target }}:9200
{% endfor %}
relabel_configs:
- source_labels: [ __address__ ]
target_label: instance
regex: '(.*):9200'
replacement: '${1}'
{% endif %}