Elasticsearch dashboard datasource


I am trying to setup this dashbord: https://grafana.com/dashboards/878
After importing it how do I configure the datasource (URL and index) to have the elasticsearch cluster metrics show up.

Is it supposed to read the metrics from the Elasticsearch cluster and/or node APIs itself or do I need to create myself an index with all the metrics values and then configure the datasource to read there ?


Yes you need to use a metrics collection tool that generates the index and data, is there any info in the dashboard Readme for how the data was collected?

That’s the problem, no real documentation on which index to use and how to collect the data. It just says it uses an Elasticsearch datasource whithout clear indication on where/how to provide the data !

Did you run the python or powershell script mentioned in the dashboard readme? it collects the data. it also contains the index name. You can also check in ES what indexes exists

Okay I imported the python script, adapted the next lines :

elasticServer = os.environ.get(‘ES_METRICS_CLUSTER_URL’, ‘http://server1:9200’)
interval = os.environ.get(‘ES_METRICS_INTERVAL’, 60)
elasticIndex = os.environ.get(‘ES_METRICS_INDEX_NAME’, ‘elasticsearch_metrics’)
elasticMonitoringCluster = os.environ.get(‘ES_METRICS_MONITORING_CLUSTER_URL’, ‘http://server2:9200

And executed it: it’s created the index and is writing metrics there while outputing on the console:
Total Elapsed Time: 0.253842115402
Total Elapsed Time: 1.13415312767
Total Elapsed Time: 2.93510198593
Total Elapsed Time: 0.247753858566
Total Elapsed Time: 0.710060119629
Total Elapsed Time: 0.292448997498
Total Elapsed Time: 0.620712995529
Total Elapsed Time: 0.4317278862
Total Elapsed Time: 1.69681310654
Total Elapsed Time: 0.417041063309
Total Elapsed Time: 0.458245992661

I still have errors on the dashboard but I’m managing to adapt templates and queries. But my cluster name has an “-” character so things aren’t working. About that he wrote in the doc:

If your cluster_name or node names have “-” you will have to load a custom index to set the “name” field to not_analyzed

“properties” : {
“name” : {
“index”: “not_analyzed”,
“type” : “string”

I don’t understand what he meant, where I am supposed to paste these lines ?

Does he mean I have to previously create the index with this mapping for “cluster-name” field?

Finally created a template with the said mapping for “cluster-name” and for “name” and things are now working.

Hi, I imported the elasticsearch plugin “https://grafana.com/dashboards/878” and also run the script. Indexes created on elasticsearch, but no data showing on grafana. Can you please let me know how to diagnose this issue.

The same issue for me. You can have a check the dashbord env variables and query string.