如何在 Grafana 中添加下拉菜单?

问题描述

我需要一种方法添加一个下拉菜单(或类似的解决方案)来仅显示一个 cpucpu 1 或 cpu 0)的指标。这可能吗? 指标是 node_cpu_seconds_total

enter image description here

解决方法

  1. 仪表板设置 > 变量 > 中创建一个名为“cpu”的自定义变量,值为 0 和 1

enter image description here

  1. 使用 cpu 变量创建图形面板(使用“:pipe”后缀可以同时使用 0 和 1 选项)

enter image description here

  1. 可以在下拉菜单中选择 CPU

enter image description here