【问题标题】:Can alerts be added to a Grafana Panel on a dashboard using API?可以使用 API 将警报添加到仪表板上的 Grafana 面板吗?
【发布时间】:2018-11-09 20:43:49
【问题描述】:

有一个 Grafana 仪表板,里面有一个面板。是否可以添加(或定义)API?

【问题讨论】:

    标签: grafana grafana-api


    【解决方案1】:

    要创建新警报或修改它们,您需要更新包含警报的仪表板 json。使用dashboard API 并编辑特定的面板警报部分。您需要在那里定义一个警报。例如:

      "alert": {
        "conditions": [
          {
            "type": "query",
            "query": {
              "params": [
                "A",
                "5m",
                "now"
              ]
            },
            "reducer": {
              "type": "avg",
              "params": []
            },
            "evaluator": {
              "type": "gt",
              "params": [
                null
              ]
            },
            "operator": {
              "type": "and"
            }
          }
        ],
    

    【讨论】:

      猜你喜欢
      • 2019-02-25
      • 2019-09-26
      • 2015-09-18
      • 2018-03-14
      • 2020-06-01
      • 2019-09-26
      • 2022-12-14
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多