简体   繁体   中英

No metrics available in Grafana with Elasticsearch data source

I created an elasticsearch datasource in Grafana connected to an index of my elasticsearch instance.

When playing with it in Grafana Explore:

I correctly see the events on the graph if I plot the Count. But if I add an aggregation metric like min, avg, max etc, then in the text box where I'm supposed to select the event field to aggregate on, I have an empty dropdown list:

在此处输入图像描述

I tried to manually write the dotted path to the fields but it didn't work. If I select the "Raw Data" metric type, I can see my events fields in the displayed columns:

在此处输入图像描述

Any idea how to make my events fields appear in the dropdown list? Is it related to how index mappings are defined in elasticsearch?

The documents in elasticsearch have a the following structure:

{
    "_index": "events-20201020",
    "_type": "_doc",
    "_id": "yT1tRnUBgIoehyP27AZU",
    "_score": null,
    "_source": {
        "summary": "A summary",
        "category": "a category",
        "client_id": "a-client-id",
        "client_key": "a-client-key",
        "hostname": "example-hostname",
        "source": "xxxxxxx",
        "details": {

          // lot of nested fields related to the event
          
        },
        "utctimestamp": "2020-10-20T14:33:21.216573+00:00",
        "type": "event",
        "processname": "process name",
        "severity": "severity",
        // ... and some other fields
    },
    "sort": [
        1603204401216
    ]
}

Ok that was simply related to the index mapping defined in elasticsearch for the related index. The fields that will appear in the dropdown list are the fields that are defined in the index mapping with a compatible numeric type (like "integer").

I created the grafana dashboard with elasticsearch as data source which takes data from metricbeat but, the data is not coming up in grafana. I used digital ocean droplets(ubuntu 22.04) as the OS. Did you face this issue?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM