简体   繁体   中英

Can alerts be added to a Grafana Panel on a dashboard using API?

There is a Grafana dashboard with a panel inside it. Is it possible to add (or define) an API?

To create new alerts or modify them you need to update the dashboard json that contains the alerts. Use dashboard API and edit particular panel alert section. You need to define an alert there. For example:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM