繁体   English   中英

使用 Elasticsearch 数据源的 Grafana 中没有可用的指标

[英]No metrics available in Grafana with Elasticsearch data source

我在 Grafana 中创建了一个 elasticsearch 数据源,连接到我的 elasticsearch 实例的索引。

在 Grafana 探索中使用它时:

如果我 plot 计数,我正确地看到了图表上的事件。 但是,如果我添加一个聚合指标,如 min、avg、max 等,那么在我应该 select 的文本框中,要聚合的事件字段,我有一个空的下拉列表:

在此处输入图像描述

我尝试手动将虚线路径写入字段,但它不起作用。 如果我 select “原始数据”度量类型,我可以在显示的列中看到我的事件字段:

在此处输入图像描述

知道如何让我的事件字段出现在下拉列表中吗? 是否与 elasticsearch 中如何定义索引映射有关?

elasticsearch 中的文档结构如下:

{
    "_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
    ]
}

好的,这只是与在相关索引的 elasticsearch 中定义的索引映射有关。 将出现在下拉列表中的字段是在索引映射中定义的具有兼容数字类型(如“整数”)的字段。

我使用 elasticsearch 作为从 metricbeat 获取数据的数据源创建了 grafana 仪表板,但是数据没有出现在 grafana 中。 我使用数字海洋水滴(ubuntu 22.04)作为操作系统。 你遇到过这个问题吗?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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