Prometheus exporter for various metrics about ElasticSearch.
The exporter is maintained by justwatchcom/elasticsearch_exporter project.
We provides two ways to install the elasticsearch exporter :
- on a standard instance (on-prem, cloud, etc)
- on Kubernetes cluster nodes
For a standard instance, we use an ansible role maintained by Lyr/ansible-elasticsearch-exporter, to deploy the exporter into an instance.
Create a elasticsearch-exporter.yml
file with the following content :
- hosts: <host>
roles:
- role: lyr.elasticsearch_exporter
elasticsearch_exporter_es_uri: "<scheme>://<username>:<password>@<url>:<port>"
elasticsearch_exporter_es_all: true
elasticsearch_exporter_es_indices: true
elasticsearch_exporter_es_shards: true
Of course, the elasticsearch endpoint must be available from the exporter.
Replace <host> with the host (or list of hosts) where to install the exporter. Plus, replace <scheme>, <username>, <password>, <url> and <port> with your elasticsearch cluster information.
ansible-galaxy install lyr.elasticsearch_exporter
ansible-playbook -vv elasticsearch-exporter.yml
To install the exporter in a Kubernetes cluster, do the following.
First, connect to your Kubernetes cluster you want to deploy the exporter in.
Create the ekasticsearch-exporter.yml
file with the following content :
es:
all: true
cluster_settings: true
indices: true
indices_settings: true
shards: true
snapshots: true
uri: <scheme>://<username>:<password>@<url>:<port>
# If you are using prometheus-operator, add the following :
service:
annotations: {}
httpPort: 9108
labels:
job: elasticsearch-exporter
metricsPort:
name: http
type: ClusterIP
serviceMonitor:
enabled: true
interval: 60s
labels:
prometheus-scrape: "true"
metricRelabelings: []
relabelings:
- sourceLabels: [ "job" ]
regex: ^.*$
action: replace
replacement: elasticsearch-exporter
targetLabel: job
sampleLimit: 0
scheme: http
scrapeTimeout: 10s
targetLabels:
- job
Replace <scheme>, <username>, <password>, <url> and <port> with your elasticsearch cluster information. Even if <scheme> is http, it is mandatory to specify it.
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo update
helm upgrade --install --create-namespace -f elasticsearch-exporter.yml -n monitoring elasticsearch-exporter prometheus-community/prometheus-elasticsearch-exporter --version 4.4.0