V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
chenzw2
V2EX  ›  数据库

grafana 中 dashboard 里的数据显示为空,实际通过 Queries 查询是有数据的?

  •  
  •   chenzw2 · 1 小时 32 分钟前 · 313 次点击

    1763945261171.png

    1763945261365.png

    1763945261516.png

    如上所示,指标单独查询是有数据,但是放在 dashbord 中就是显示为空,这种是什么原因,要怎么排查?

    6 条回复    2025-11-24 10:16:02 +08:00
    sanyue
        1
    sanyue  
       1 小时 29 分钟前
    没用过的小白路过,我的话,会找一个有数据的,对比一下配置、数据差异
    cuiweiqiang
        2
    cuiweiqiang  
       1 小时 17 分钟前
    应该是 instance="$instance" 吧
    bahuite
        3
    bahuite  
       1 小时 0 分钟前
    如果有数据,很明显是你的变量问题
    jimmzhou
        4
    jimmzhou  
       58 分钟前
    图二 显示 结果 明明是 0 rows 啊 你把 B 那个 object 展开看看
    veni2023
        5
    veni2023  
       53 分钟前
    两个查询的时间范围一致吗
    chenzw2
        6
    chenzw2  
    OP
       5 分钟前
    ```
    {
    "request": {
    "url": "api/ds/query?ds_type=prometheus&requestId=SQR408",
    "method": "POST",
    "data": {
    "queries": [
    {
    "editorMode": "code",
    "exemplar": false,
    "expr": "clamp_min((1 - (node_memory_MemAvailable_bytes{instance=\"node-exporter:9100\", job=\"node-exporter\"} / node_memory_MemTotal_bytes{instance=\"node-exporter:9100\", job=\"node-exporter\"})) * 100, 0)",
    "format": "time_series",
    "instant": true,
    "range": false,
    "refId": "B",
    "step": 240,
    "datasource": {
    "type": "prometheus",
    "uid": "PBFA97CFB590B2093"
    },
    "requestId": "16B",
    "utcOffsetSec": 28800,
    "scopes": [],
    "adhocFilters": [],
    "interval": "",
    "legendFormat": "",
    "datasourceId": 1,
    "intervalMs": 15000,
    "maxDataPoints": 1066
    }
    ],
    "from": "1763949579191",
    "to": "1763950479191"
    },
    "hideFromInspector": false
    },
    "response": {
    "results": {
    "B": {
    "status": 200,
    "frames": [
    {
    "schema": {
    "refId": "B",
    "meta": {
    "typeVersion": [
    0,
    0
    ],
    "executedQueryString": "Expr: clamp_min((1 - (node_memory_MemAvailable_bytes{instance=\"node-exporter:9100\", job=\"node-exporter\"} / node_memory_MemTotal_bytes{instance=\"node-exporter:9100\", job=\"node-exporter\"})) * 100, 0)\nStep: 15s"
    },
    "fields": []
    },
    "data": {
    "values": []
    }
    }
    ],
    "refId": "B"
    }
    }
    }
    }

    ```
    @jimmzhou 如上是 object 的完整数据,求大佬指教,小白第一次用这个
    关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   5806 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 02:21 · PVG 10:21 · LAX 18:21 · JFK 21:21
    ♥ Do have faith in what you're doing.