ccfos / nightingale

An all-in-one observability solution which aims to combine the advantages of Prometheus and Grafana. It manages alert rules and visualizes metrics, logs, traces in a beautiful web UI.
https://flashcat.cloud/docs/
Apache License 2.0
9.73k stars 1.41k forks source link

elasticsearch 数据源图表表格 raw data 显示异常 #2047

Closed jiaozi07 closed 1 month ago

jiaozi07 commented 3 months ago

Question and Steps to reproduce

elasticsearch 数据源图表表格 raw data 格式时,显示出索引名称且无法隐藏,数值转换处也没有显示 image

image

Version

v7.0.0-beta.14.1

jsers commented 3 months ago

看截图,这样的配置应该是不合理的 首先 raw data 是请求日志原文,那么就不应该在选择 “每行展示指定聚合维度的值” 了,因为日志原文是没有计算值的。可以看下 “取值计算” 设置后面有个 question 图标鼠标移动到上面会有提示,像日志数据这样的非时序数据是没有 “值” 的。 不知道你想要的最终效果是怎样,如果是想展开显示日志信息,那么应该选择 “每行展示 labels 的值”

jiaozi07 commented 3 months ago

最终想要的效果是展示日志信息

选择“每行展示 labels 的值” 大概率会页面崩溃白页

jsers commented 3 months ago

是每条日志的字段比较多?还是查询的日志条数设置的比较大? 正常情况是不会崩溃的,如果你是想展示日志信息,那么就应该选择 “每行展示 labels 的值”

jiaozi07 commented 3 months ago

这个日志内容就是k8s 的event 日志,所以看怎么能控制只展示部分内容 应该是跟列太多有关,测试数据就7条一点“每行展示 labels 的值” 就崩了

image

grafana 是通过这种方式过滤字段的

image
jsers commented 3 months ago

显示模式选择 “每行展示 labels 的值” 然后右边的显示列选择你希望展示的字段

jiaozi07 commented 3 months ago

可以了 我先搜索一个不存在的,把内容置为空然后选择value,在去把数据搞出来,页面就不会崩溃白页了

jsers commented 3 months ago

我比较好奇 “崩溃白页” 的操作流程,我需要复现这个问题以便修复他

小恒 @.***> 于2024年7月23日周二 11:45写道:

可以了 我先搜索一个不存在的,把内容置为空然后选择value,在去把数据搞出来,页面就不会崩溃白页了

— Reply to this email directly, view it on GitHub https://github.com/ccfos/nightingale/issues/2047#issuecomment-2244192612, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABYUU6SUEV363RCFBEGPDRLZNXGUJAVCNFSM6AAAAABLHVVDX6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENBUGE4TENRRGI . You are receiving this because you were assigned.Message ID: @.***>

jiaozi07 commented 3 months ago

下面是录屏 你看下 https://github.com/user-attachments/assets/9ba86295-8f16-4fa0-86f9-0be1a0c9febf

jsers commented 3 months ago

可能是什么特别的日志结构处理的时候报错了,需要提供下下面这两部分信息才好定位什么问题 可以发我下错误信息截图,chrome 浏览器右键选择 “检查”,然后选择 Console 可以看下 errors 截图 然后可以发我下没有崩溃白页的图表面板排查信息,在面板右上角的更多操作里有点击 “排查” 然后复制下 “查询” 里的 json 信息,这块会记录请求的参数和返回的数据(日志有必要可以脱敏下发出来)

jiaozi07 commented 3 months ago

image

{
  "type": "Logs",
  "request": {
    "url": "/api/n9e/proxy/1/_msearch",
    "method": "POST",
    "data": "{\"search_type\":\"query_then_fetch\",\"ignore_unavailable\":true,\"index\":\"kube-events-*\"}\n{\"size\":100,\"query\":{\"bool\":{\"filter\":[{\"range\":{\"eventTime\":{\"gte\":1719128959466,\"lte\":1721720959466,\"format\":\"epoch_millis\"}}},{\"query_string\":{\"analyze_wildcard\":true,\"query\":\"metadata.name: \\\"nginx*\\\"\"}}]}},\"sort\":[{\"eventTime\":{\"order\":\"desc\",\"unmapped_type\":\"boolean\"}}],\"script_fields\":{},\"aggs\":{}}\n"
  },
  "response": [
    {
      "took": 2,
      "timed_out": false,
      "_shards": {
        "total": 14,
        "successful": 14,
        "skipped": 12,
        "failed": 0
      },
      "hits": {
        "total": {
          "value": 1,
          "relation": "eq"
        },
        "max_score": null,
        "hits": [
          {
            "_index": "kube-events-10100-09-08",
            "_id": "f8146d27-e169-4347-b0da-51491bac436b",
            "_score": null,
            "_ignored": [
              "message.keyword"
            ],
            "_source": {
              "metadata": {
                "name": "nginx-5f77665948-pv68g.17e0f701a441c4a9",
                "namespace": "default",
                "uid": "f8146d27-e169-4347-b0da-51491bac436b",
                "resourceVersion": "6599425",
                "creationTimestamp": "2024-07-10T21:24:04Z"
              },
              "reason": "FailedScheduling",
              "message": "0/3 nodes are available: 1 node(s) didn't match Pod's node affinity/selector, 1 node(s) had untolerated taint {node-role.kubernetes.io/master: }, 1 node(s) had untolerated taint {node.kubernetes.io/unreachable: }. preemption: 0/3 nodes are available: 3 Preemption is not helpful for scheduling..",
              "source": {},
              "firstTimestamp": null,
              "lastTimestamp": null,
              "type": "Warning",
              "eventTime": "2024-07-10T21:24:04.078318Z",
              "action": "Scheduling",
              "reportingComponent": "default-scheduler",
              "reportingInstance": "default-scheduler-test-001",
              "clusterName": "",
              "involvedObject": {
                "kind": "Pod",
                "namespace": "default",
                "name": "nginx-5f77665948-pv68g",
                "uid": "ca0e8a55-458d-4fb6-882a-602be2829c2f",
                "apiVersion": "v1",
                "resourceVersion": "6599411",
                "labels": {
                  "app": "nginx",
                  "pod-template-hash": "5f77665948"
                },
                "ownerReferences": [
                  {
                    "apiVersion": "apps/v1",
                    "kind": "ReplicaSet",
                    "name": "nginx-5f77665948",
                    "uid": "21a5ca89-7edf-4d9f-b315-04dc501dbbd9",
                    "controller": true,
                    "blockOwnerDeletion": true
                  }
                ],
                "deleted": false
              }
            },
            "sort": [
              1720646644078
            ]
          }
        ]
      },
      "status": 200
    }
  ]
}
jsers commented 1 month ago

新版本已经修复