配备了可变选项的grafana仪表板

时间:2020-05-22 22:25:01

标签: grafana grafana-templating

我将grafana仪表板设置为json,并且为了让我的仪表板跟踪kafka主题,我遇到了问题。

每次我在kafka中添加新主题时,都必须使用主题名称并重新配置来更新仪表板json。我宁愿只使用一个变量。但是,我似乎无法解决。诸如“ allValue”和“ allFormat”之类的字段也无法正常工作。这里是.templating.list下的相关部分:

{
        "allValue": "*",
        "allFormat": "wildcard",
        "current": {
          "tags": [],
          "text": "connector_offsets",
          "value": "connector_offsets"
        },
        "datasource": "$Datasource",
        "definition": "label_values(kafka_topic_partition_current_offset, topic)",
        "hide": 0,
        "includeAll": true,
        "label": null,
        "multi": false,
        "name": "topic",
        "options": [
          {
            "selected": false,
            "text": "topic1",
            "value": "topic1"
          },
          ...
          <each topic is explicitly listed>
          ...
        ],
        "query": "label_values(kafka_topic_partition_current_offset, topic)",
        "refresh": 0,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      }

我在“显式列出每个主题”中添加的部分很快变得很大。我怎么能告诉grafana这是一个在查看面板时应该评估的变量?

0 个答案:

没有答案