首页 > 其他分享 >prometheus告警记录——grafana模板

prometheus告警记录——grafana模板

时间:2023-12-22 11:34:32浏览次数:40  
标签:__ grafana groupBy prometheus startsAt ID type id 模板

grafana面板

{
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": {
          "type": "datasource",
          "uid": "grafana"
        },
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "target": {
          "limit": 100,
          "matchAny": false,
          "tags": [],
          "type": "dashboard"
        },
        "type": "dashboard"
      }
    ]
  },
  "description": "Dashboard for alertsnitch。https://gitlab.com/yakshaving.art/alertsnitch",
  "editable": true,
  "fiscalYearStartMonth": 0,
  "gnetId": 15833,
  "graphTooltip": 0,
  "id": 2,
  "links": [],
  "liveNow": false,
  "panels": [
    {
      "datasource": {
        "type": "mysql",
        "uid": "d51d42e2-9ecf-465b-a78e-724aa75cefa4"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "red",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 6,
        "w": 6,
        "x": 0,
        "y": 0
      },
      "id": 16,
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "textMode": "auto"
      },
      "pluginVersion": "10.0.10",
      "targets": [
        {
          "datasource": {
            "type": "mysql",
            "uid": "d51d42e2-9ecf-465b-a78e-724aa75cefa4"
          },
          "editorMode": "code",
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT\n  COUNT(1)\nFROM Alert\nWHERE\n  startsAt BETWEEN  FROM_UNIXTIME(${__from:date:seconds})  AND  FROM_UNIXTIME(${__to:date:seconds})\n  AND status=\"firing\"",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "ID"
                ],
                "type": "column"
              }
            ]
          ],
          "sql": {
            "columns": [
              {
                "parameters": [],
                "type": "function"
              }
            ],
            "groupBy": [
              {
                "property": {
                  "type": "string"
                },
                "type": "groupBy"
              }
            ],
            "limit": 50
          },
          "table": "alert",
          "timeColumn": "startsAt",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "total number of alert sended",
      "transformations": [],
      "type": "stat"
    },
    {
      "datasource": {
        "type": "mysql",
        "uid": "d51d42e2-9ecf-465b-a78e-724aa75cefa4"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {
            "align": "center",
            "cellOptions": {
              "type": "auto"
            },
            "filterable": true,
            "inspect": false
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "description"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 436
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "severity"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 104
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "env"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 94
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "startsAt"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 156
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "严重性"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 98
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 6,
        "w": 6,
        "x": 6,
        "y": 0
      },
      "id": 22,
      "options": {
        "cellHeight": "sm",
        "footer": {
          "countRows": false,
          "fields": "",
          "reducer": [
            "sum"
          ],
          "show": false
        },
        "frameIndex": 1,
        "showHeader": true,
        "sortBy": []
      },
      "pluginVersion": "10.0.10",
      "targets": [
        {
          "datasource": {
            "type": "mysql",
            "uid": "d51d42e2-9ecf-465b-a78e-724aa75cefa4"
          },
          "editorMode": "code",
          "format": "table",
          "group": [],
          "hide": false,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT\n  startsAt AS time,\n  status,\n  ID\nFROM Alert\nWHERE\n  startsAt BETWEEN  FROM_UNIXTIME(${__from:date:seconds})  AND  FROM_UNIXTIME(${__to:date:seconds}) \n  AND status=\"firing\"\nORDER BY startsAt",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "ID"
                ],
                "type": "column"
              }
            ]
          ],
          "sql": {
            "columns": [
              {
                "parameters": [],
                "type": "function"
              }
            ],
            "groupBy": [
              {
                "property": {
                  "type": "string"
                },
                "type": "groupBy"
              }
            ],
            "limit": 50
          },
          "table": "alert",
          "timeColumn": "startsAt",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        },
        {
          "datasource": {
            "type": "mysql",
            "uid": "d51d42e2-9ecf-465b-a78e-724aa75cefa4"
          },
          "editorMode": "code",
          "format": "table",
          "group": [],
          "hide": false,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT\n\tAlertID AS \"ID\",\n\tValue AS \"severity\"\nFROM\n\tAlertLabel\nWHERE\n\tAlertID IN (\n\tSELECT\n\t\tID \n\tFROM\n\t\tAlert \n\tWHERE\n\t  startsAt BETWEEN  FROM_UNIXTIME(${__from:date:seconds})  AND  FROM_UNIXTIME(${__to:date:seconds}) \n\t  AND status=\"firing\"\n\t)\n\tAND Label=\"severity\"",
          "refId": "D",
          "select": [
            [
              {
                "params": [
                  "ID"
                ],
                "type": "column"
              }
            ]
          ],
          "sql": {
            "columns": [
              {
                "parameters": [],
                "type": "function"
              }
            ],
            "groupBy": [
              {
                "property": {
                  "type": "string"
                },
                "type": "groupBy"
              }
            ],
            "limit": 50
          },
          "table": "alert",
          "timeColumn": "startsAt",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "alert statistics",
      "transformations": [
        {
          "id": "merge",
          "options": {}
        },
        {
          "id": "groupBy",
          "options": {
            "fields": {
              "ID": {
                "aggregations": [
                  "count"
                ],
                "operation": "aggregate"
              },
              "severity": {
                "aggregations": [],
                "operation": "groupby"
              }
            }
          }
        },
        {
          "id": "organize",
          "options": {
            "excludeByName": {},
            "indexByName": {},
            "renameByName": {
              "ID (count)": "次数",
              "severity": "严重性"
            }
          }
        }
      ],
      "type": "table"
    },
    {
      "datasource": {
        "type": "mysql",
        "uid": "d51d42e2-9ecf-465b-a78e-724aa75cefa4"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "green",
                "value": 80
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 6,
        "w": 6,
        "x": 12,
        "y": 0
      },
      "id": 18,
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "textMode": "auto"
      },
      "pluginVersion": "10.0.10",
      "targets": [
        {
          "datasource": {
            "type": "mysql",
            "uid": "d51d42e2-9ecf-465b-a78e-724aa75cefa4"
          },
          "editorMode": "code",
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT\n  COUNT(1)\nFROM Alert\nWHERE\n  startsAt BETWEEN  FROM_UNIXTIME(${__from:date:seconds})  AND  FROM_UNIXTIME(${__to:date:seconds}) \n  AND status=\"resolved\"",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "ID"
                ],
                "type": "column"
              }
            ]
          ],
          "sql": {
            "columns": [
              {
                "parameters": [],
                "type": "function"
              }
            ],
            "groupBy": [
              {
                "property": {
                  "type": "string"
                },
                "type": "groupBy"
              }
            ],
            "limit": 50
          },
          "table": "alert",
          "timeColumn": "startsAt",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "total number of alert resolved",
      "transformations": [],
      "type": "stat"
    },
    {
      "datasource": {
        "type": "mysql",
        "uid": "d51d42e2-9ecf-465b-a78e-724aa75cefa4"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {
            "align": "center",
            "cellOptions": {
              "type": "auto"
            },
            "filterable": true,
            "inspect": false
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "description"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 436
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "severity"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 104
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "env"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 94
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "startsAt"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 156
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 6,
        "w": 6,
        "x": 18,
        "y": 0
      },
      "id": 24,
      "options": {
        "cellHeight": "sm",
        "footer": {
          "countRows": false,
          "fields": "",
          "reducer": [
            "sum"
          ],
          "show": false
        },
        "frameIndex": 1,
        "showHeader": true,
        "sortBy": [
          {
            "desc": false,
            "displayName": "startsAt"
          }
        ]
      },
      "pluginVersion": "10.0.10",
      "targets": [
        {
          "datasource": {
            "type": "mysql",
            "uid": "d51d42e2-9ecf-465b-a78e-724aa75cefa4"
          },
          "editorMode": "code",
          "format": "table",
          "group": [],
          "hide": false,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT\n  startsAt AS time,\n  status,\n  ID\nFROM Alert\nWHERE\n  startsAt BETWEEN  FROM_UNIXTIME(${__from:date:seconds})  AND  FROM_UNIXTIME(${__to:date:seconds}) \n  AND status=\"resolved\"\nORDER BY startsAt",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "ID"
                ],
                "type": "column"
              }
            ]
          ],
          "sql": {
            "columns": [
              {
                "parameters": [],
                "type": "function"
              }
            ],
            "groupBy": [
              {
                "property": {
                  "type": "string"
                },
                "type": "groupBy"
              }
            ],
            "limit": 50
          },
          "table": "alert",
          "timeColumn": "startsAt",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        },
        {
          "datasource": {
            "type": "mysql",
            "uid": "d51d42e2-9ecf-465b-a78e-724aa75cefa4"
          },
          "editorMode": "code",
          "format": "table",
          "group": [],
          "hide": false,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT\n\tAlertID AS \"ID\",\n\tValue AS \"severity\"\nFROM\n\tAlertLabel\nWHERE\n\tAlertID IN (\n\tSELECT\n\t\tID \n\tFROM\n\t\tAlert \n\tWHERE\n\t  startsAt BETWEEN  FROM_UNIXTIME(${__from:date:seconds})  AND  FROM_UNIXTIME(${__to:date:seconds}) \n\t  AND status=\"resolved\"\n\t)\n\tAND Label=\"severity\"",
          "refId": "D",
          "select": [
            [
              {
                "params": [
                  "ID"
                ],
                "type": "column"
              }
            ]
          ],
          "sql": {
            "columns": [
              {
                "parameters": [],
                "type": "function"
              }
            ],
            "groupBy": [
              {
                "property": {
                  "type": "string"
                },
                "type": "groupBy"
              }
            ],
            "limit": 50
          },
          "table": "alert",
          "timeColumn": "startsAt",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "resolved statistics",
      "transformations": [
        {
          "id": "merge",
          "options": {}
        },
        {
          "id": "groupBy",
          "options": {
            "fields": {
              "ID": {
                "aggregations": [
                  "count"
                ],
                "operation": "aggregate"
              },
              "severity": {
                "aggregations": [],
                "operation": "groupby"
              }
            }
          }
        },
        {
          "id": "organize",
          "options": {
            "excludeByName": {},
            "indexByName": {},
            "renameByName": {
              "ID (count)": "次数",
              "severity": "严重性"
            }
          }
        }
      ],
      "type": "table"
    },
    {
      "datasource": {
        "type": "mysql",
        "uid": "d51d42e2-9ecf-465b-a78e-724aa75cefa4"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 1,
            "drawStyle": "line",
            "fillOpacity": 0,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "lineInterpolation": "linear",
            "lineWidth": 1,
            "pointSize": 10,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "auto",
            "spanNulls": false,
            "stacking": {
              "group": "A",
              "mode": "none"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 0,
        "y": 6
      },
      "id": 12,
      "options": {
        "legend": {
          "calcs": [],
          "displayMode": "list",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "single",
          "sort": "none"
        }
      },
      "pluginVersion": "8.3.3",
      "targets": [
        {
          "datasource": {
            "type": "mysql",
            "uid": "d51d42e2-9ecf-465b-a78e-724aa75cefa4"
          },
          "editorMode": "code",
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT\n  startsAt AS time,\n  ID\nFROM Alert\nWHERE\n  startsAt BETWEEN  FROM_UNIXTIME(${__from:date:seconds})  AND  FROM_UNIXTIME(${__to:date:seconds}) \n  AND status=\"firing\"\nORDER BY startsAt",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "ID"
                ],
                "type": "column"
              }
            ]
          ],
          "sql": {
            "columns": [
              {
                "parameters": [],
                "type": "function"
              }
            ],
            "groupBy": [
              {
                "property": {
                  "type": "string"
                },
                "type": "groupBy"
              }
            ],
            "limit": 50
          },
          "table": "alert",
          "timeColumn": "startsAt",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "alert triggered",
      "transformations": [
        {
          "id": "groupBy",
          "options": {
            "fields": {
              "ID": {
                "aggregations": [
                  "count"
                ],
                "operation": "aggregate"
              },
              "time": {
                "aggregations": [],
                "operation": "groupby"
              }
            }
          }
        },
        {
          "id": "organize",
          "options": {
            "excludeByName": {},
            "indexByName": {},
            "renameByName": {
              "ID (count)": "告警触发次数"
            }
          }
        }
      ],
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "mysql",
        "uid": "d51d42e2-9ecf-465b-a78e-724aa75cefa4"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 0,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "lineInterpolation": "linear",
            "lineWidth": 1,
            "pointSize": 10,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "auto",
            "spanNulls": false,
            "stacking": {
              "group": "A",
              "mode": "none"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 12,
        "y": 6
      },
      "id": 20,
      "options": {
        "legend": {
          "calcs": [],
          "displayMode": "list",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "single",
          "sort": "none"
        }
      },
      "pluginVersion": "8.3.3",
      "targets": [
        {
          "datasource": {
            "type": "mysql",
            "uid": "d51d42e2-9ecf-465b-a78e-724aa75cefa4"
          },
          "editorMode": "code",
          "format": "table",
          "group": [],
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT\n  startsAt AS time,\n  ID\nFROM Alert\nWHERE\n  startsAt BETWEEN  FROM_UNIXTIME(${__from:date:seconds})  AND  FROM_UNIXTIME(${__to:date:seconds}) \n  AND status=\"resolved\"\nORDER BY startsAt",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "ID"
                ],
                "type": "column"
              }
            ]
          ],
          "sql": {
            "columns": [
              {
                "parameters": [],
                "type": "function"
              }
            ],
            "groupBy": [
              {
                "property": {
                  "type": "string"
                },
                "type": "groupBy"
              }
            ],
            "limit": 50
          },
          "table": "alert",
          "timeColumn": "startsAt",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "resolved triggered",
      "transformations": [
        {
          "id": "groupBy",
          "options": {
            "fields": {
              "ID": {
                "aggregations": [
                  "count"
                ],
                "operation": "aggregate"
              },
              "time": {
                "aggregations": [],
                "operation": "groupby"
              }
            }
          }
        },
        {
          "id": "organize",
          "options": {
            "excludeByName": {},
            "indexByName": {},
            "renameByName": {
              "ID (count)": "恢复触发次数"
            }
          }
        }
      ],
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "mysql",
        "uid": "d51d42e2-9ecf-465b-a78e-724aa75cefa4"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {
            "align": "left",
            "cellOptions": {
              "type": "auto"
            },
            "filterable": true,
            "inspect": false
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "description"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 436
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "severity"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 104
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "env"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 94
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "持续时间"
            },
            "properties": [
              {
                "id": "unit",
                "value": "s"
              },
              {
                "id": "custom.width",
                "value": 86
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "ID"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 68
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "名称"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 185
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "结束时间"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 124
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "开始时间"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 145
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 15,
        "w": 12,
        "x": 0,
        "y": 14
      },
      "id": 10,
      "options": {
        "cellHeight": "sm",
        "footer": {
          "countRows": false,
          "fields": "",
          "reducer": [
            "sum"
          ],
          "show": false
        },
        "frameIndex": 2,
        "showHeader": true,
        "sortBy": [
          {
            "desc": false,
            "displayName": "ID"
          }
        ]
      },
      "pluginVersion": "10.0.10",
      "targets": [
        {
          "datasource": {
            "type": "mysql",
            "uid": "d51d42e2-9ecf-465b-a78e-724aa75cefa4"
          },
          "editorMode": "code",
          "format": "table",
          "group": [],
          "hide": false,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT\n  ID,\n  status,\n  startsAt,\n  endsAt,\n  TIMESTAMPDIFF(SECOND, startsAt, endsAt) AS duration,\n  fingerprint\nFROM Alert\nWHERE\n  startsAt BETWEEN  FROM_UNIXTIME(${__from:date:seconds})  AND  FROM_UNIXTIME(${__to:date:seconds}) \n  AND status=\"resolved\"\nORDER BY startsAt",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "ID"
                ],
                "type": "column"
              }
            ]
          ],
          "sql": {
            "columns": [
              {
                "parameters": [],
                "type": "function"
              }
            ],
            "groupBy": [
              {
                "property": {
                  "type": "string"
                },
                "type": "groupBy"
              }
            ],
            "limit": 50
          },
          "table": "alert",
          "timeColumn": "startsAt",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        },
        {
          "datasource": {
            "type": "mysql",
            "uid": "d51d42e2-9ecf-465b-a78e-724aa75cefa4"
          },
          "editorMode": "code",
          "format": "table",
          "group": [],
          "hide": false,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT\n\tAlertID AS \"ID\",\n\tValue AS \"alertname\"\nFROM\n\tAlertLabel\nWHERE\n\tAlertID IN (\n\tSELECT\n\t\tID \n\tFROM\n\t\tAlert \n\tWHERE\n\t  startsAt BETWEEN  FROM_UNIXTIME(${__from:date:seconds})  AND  FROM_UNIXTIME(${__to:date:seconds}) \n\t  AND status=\"resolved\"\n\t)\n\tAND Label=\"alertname\"",
          "refId": "B",
          "select": [
            [
              {
                "params": [
                  "ID"
                ],
                "type": "column"
              }
            ]
          ],
          "sql": {
            "columns": [
              {
                "parameters": [],
                "type": "function"
              }
            ],
            "groupBy": [
              {
                "property": {
                  "type": "string"
                },
                "type": "groupBy"
              }
            ],
            "limit": 50
          },
          "table": "alert",
          "timeColumn": "startsAt",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        },
        {
          "datasource": {
            "type": "mysql",
            "uid": "d51d42e2-9ecf-465b-a78e-724aa75cefa4"
          },
          "editorMode": "code",
          "format": "table",
          "group": [],
          "hide": false,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT\n\tAlertID AS \"ID\",\n\tValue AS \"env\"\nFROM\n\tAlertLabel\nWHERE\n\tAlertID IN (\n\tSELECT\n\t\tID \n\tFROM\n\t\tAlert \n\tWHERE\n\t  startsAt BETWEEN  FROM_UNIXTIME(${__from:date:seconds})  AND  FROM_UNIXTIME(${__to:date:seconds}) \n\t  AND status=\"resolved\"\n\t)\n\tAND Label=\"idc\"",
          "refId": "C",
          "select": [
            [
              {
                "params": [
                  "ID"
                ],
                "type": "column"
              }
            ]
          ],
          "sql": {
            "columns": [
              {
                "parameters": [],
                "type": "function"
              }
            ],
            "groupBy": [
              {
                "property": {
                  "type": "string"
                },
                "type": "groupBy"
              }
            ],
            "limit": 50
          },
          "table": "alert",
          "timeColumn": "startsAt",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        },
        {
          "datasource": {
            "type": "mysql",
            "uid": "d51d42e2-9ecf-465b-a78e-724aa75cefa4"
          },
          "editorMode": "code",
          "format": "table",
          "group": [],
          "hide": false,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT\n\tAlertID AS \"ID\",\n\tValue AS \"severity\"\nFROM\n\tAlertLabel\nWHERE\n\tAlertID IN (\n\tSELECT\n\t\tID \n\tFROM\n\t\tAlert \n\tWHERE\n\t  startsAt BETWEEN  FROM_UNIXTIME(${__from:date:seconds})  AND  FROM_UNIXTIME(${__to:date:seconds}) \n\t  AND status=\"resolved\"\n\t)\n\tAND Label=\"severity\"",
          "refId": "D",
          "select": [
            [
              {
                "params": [
                  "ID"
                ],
                "type": "column"
              }
            ]
          ],
          "sql": {
            "columns": [
              {
                "parameters": [],
                "type": "function"
              }
            ],
            "groupBy": [
              {
                "property": {
                  "type": "string"
                },
                "type": "groupBy"
              }
            ],
            "limit": 50
          },
          "table": "alert",
          "timeColumn": "startsAt",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        },
        {
          "datasource": {
            "type": "mysql",
            "uid": "d51d42e2-9ecf-465b-a78e-724aa75cefa4"
          },
          "editorMode": "code",
          "format": "table",
          "group": [],
          "hide": false,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT\n\tAlertID AS \"ID\",\n\tValue AS \"az\"\nFROM\n\tAlertLabel\nWHERE\n\tAlertID IN (\n\tSELECT\n\t\tID \n\tFROM\n\t\tAlert \n\tWHERE\n\t  startsAt BETWEEN  FROM_UNIXTIME(${__from:date:seconds})  AND  FROM_UNIXTIME(${__to:date:seconds}) \n\t  AND status=\"resolved\"\n\t)\n\tAND Label=\"az\"",
          "refId": "E",
          "select": [
            [
              {
                "params": [
                  "ID"
                ],
                "type": "column"
              }
            ]
          ],
          "sql": {
            "columns": [
              {
                "parameters": [],
                "type": "function"
              }
            ],
            "groupBy": [
              {
                "property": {
                  "type": "string"
                },
                "type": "groupBy"
              }
            ],
            "limit": 50
          },
          "table": "alert",
          "timeColumn": "startsAt",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        },
        {
          "datasource": {
            "type": "mysql",
            "uid": "d51d42e2-9ecf-465b-a78e-724aa75cefa4"
          },
          "editorMode": "code",
          "format": "table",
          "group": [],
          "hide": false,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT\n\tAlertID AS \"ID\",\n\tValue AS \"hostname\"\nFROM\n\tAlertLabel\nWHERE\n\tAlertID IN (\n\tSELECT\n\t\tID \n\tFROM\n\t\tAlert \n\tWHERE\n\t  startsAt BETWEEN  FROM_UNIXTIME(${__from:date:seconds})  AND  FROM_UNIXTIME(${__to:date:seconds}) \n\t  AND status=\"resolved\"\n\t)\n\tAND Label=\"namehost\"",
          "refId": "F",
          "select": [
            [
              {
                "params": [
                  "ID"
                ],
                "type": "column"
              }
            ]
          ],
          "sql": {
            "columns": [
              {
                "parameters": [],
                "type": "function"
              }
            ],
            "groupBy": [
              {
                "property": {
                  "type": "string"
                },
                "type": "groupBy"
              }
            ],
            "limit": 50
          },
          "table": "alert",
          "timeColumn": "startsAt",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        },
        {
          "datasource": {
            "type": "mysql",
            "uid": "d51d42e2-9ecf-465b-a78e-724aa75cefa4"
          },
          "editorMode": "code",
          "format": "table",
          "group": [],
          "hide": false,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT\n\tAlertID AS \"ID\",\n\tValue AS \"project\"\nFROM\n\tAlertLabel\nWHERE\n\tAlertID IN (\n\tSELECT\n\t\tID \n\tFROM\n\t\tAlert \n\tWHERE\n\t  startsAt BETWEEN  FROM_UNIXTIME(${__from:date:seconds})  AND  FROM_UNIXTIME(${__to:date:seconds}) \n\t  AND status=\"resolved\"\n\t)\n\tAND Label=\"group\"",
          "refId": "G",
          "select": [
            [
              {
                "params": [
                  "ID"
                ],
                "type": "column"
              }
            ]
          ],
          "sql": {
            "columns": [
              {
                "parameters": [],
                "type": "function"
              }
            ],
            "groupBy": [
              {
                "property": {
                  "type": "string"
                },
                "type": "groupBy"
              }
            ],
            "limit": 50
          },
          "table": "alert",
          "timeColumn": "startsAt",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        },
        {
          "datasource": {
            "type": "mysql",
            "uid": "d51d42e2-9ecf-465b-a78e-724aa75cefa4"
          },
          "editorMode": "code",
          "format": "table",
          "group": [],
          "hide": false,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT\n\tAlertID AS \"ID\",\n\tValue AS \"description\"\nFROM\n\tAlertAnnotation\nWHERE\n\tAlertID IN (\n\tSELECT\n\t\tID \n\tFROM\n\t\tAlert \n\tWHERE\n\t  startsAt BETWEEN  FROM_UNIXTIME(${__from:date:seconds})  AND  FROM_UNIXTIME(${__to:date:seconds}) \n\t  AND status=\"resolved\"\n\t)\n\tAND Annotation=\"short\"",
          "refId": "H",
          "select": [
            [
              {
                "params": [
                  "ID"
                ],
                "type": "column"
              }
            ]
          ],
          "sql": {
            "columns": [
              {
                "parameters": [],
                "type": "function"
              }
            ],
            "groupBy": [
              {
                "property": {
                  "type": "string"
                },
                "type": "groupBy"
              }
            ],
            "limit": 50
          },
          "table": "alert",
          "timeColumn": "startsAt",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "alert resolved",
      "transformations": [
        {
          "id": "merge",
          "options": {}
        },
        {
          "id": "filterFieldsByName",
          "options": {
            "include": {
              "names": [
                "ID",
                "alertname",
                "hostname",
                "description",
                "startsAt",
                "endsAt",
                "duration"
              ]
            }
          }
        },
        {
          "id": "organize",
          "options": {
            "excludeByName": {},
            "indexByName": {
              "ID": 0,
              "alertname": 1,
              "description": 6,
              "duration": 4,
              "endsAt": 3,
              "hostname": 5,
              "startsAt": 2
            },
            "renameByName": {
              "ID": "ID",
              "alertname": "名称",
              "description": "描述",
              "duration": "持续时间",
              "endsAt": "结束时间",
              "hostname": "主机名",
              "startsAt": "开始时间"
            }
          }
        }
      ],
      "type": "table"
    },
    {
      "datasource": {
        "type": "mysql",
        "uid": "d51d42e2-9ecf-465b-a78e-724aa75cefa4"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {
            "align": "left",
            "cellOptions": {
              "type": "auto"
            },
            "filterable": true,
            "inspect": false
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "description"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 436
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "severity"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 104
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "env"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 94
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "startsAt"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 156
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "ID (last)"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 106
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "持续时间"
            },
            "properties": [
              {
                "id": "unit",
                "value": "s"
              },
              {
                "id": "custom.width",
                "value": 185
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "ID"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 64
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 15,
        "w": 12,
        "x": 12,
        "y": 14
      },
      "id": 26,
      "options": {
        "cellHeight": "sm",
        "footer": {
          "countRows": false,
          "fields": "",
          "reducer": [
            "sum"
          ],
          "show": false
        },
        "frameIndex": 2,
        "showHeader": true,
        "sortBy": []
      },
      "pluginVersion": "10.0.10",
      "targets": [
        {
          "datasource": {
            "type": "mysql",
            "uid": "d51d42e2-9ecf-465b-a78e-724aa75cefa4"
          },
          "editorMode": "code",
          "format": "table",
          "group": [],
          "hide": false,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT\n  ID,\n  status,\n  startsAt,\n  endsAt,\n  TIMESTAMPDIFF(SECOND, startsAt, NOW()) AS duration,\n  fingerprint\nFROM Alert\nWHERE\n  startsAt BETWEEN FROM_UNIXTIME(${__from:date:seconds}) AND FROM_UNIXTIME(${__to:date:seconds})\n\nORDER BY ID",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "ID"
                ],
                "type": "column"
              }
            ]
          ],
          "sql": {
            "columns": [
              {
                "parameters": [],
                "type": "function"
              }
            ],
            "groupBy": [
              {
                "property": {
                  "type": "string"
                },
                "type": "groupBy"
              }
            ],
            "limit": 50
          },
          "table": "alert",
          "timeColumn": "startsAt",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        },
        {
          "datasource": {
            "type": "mysql",
            "uid": "d51d42e2-9ecf-465b-a78e-724aa75cefa4"
          },
          "editorMode": "code",
          "format": "table",
          "group": [],
          "hide": false,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT\n\tAlertID AS \"ID\",\n\tValue AS \"alertname\"\nFROM\n\tAlertLabel\nWHERE\n\tAlertID IN (\n\tSELECT\n\t\tID \n\tFROM\n\t\tAlert \n\tWHERE\n\t  startsAt BETWEEN FROM_UNIXTIME(${__from:date:seconds}) AND FROM_UNIXTIME(${__to:date:seconds})\n\t)\n\tAND Label=\"alertname\"",
          "refId": "B",
          "select": [
            [
              {
                "params": [
                  "ID"
                ],
                "type": "column"
              }
            ]
          ],
          "sql": {
            "columns": [
              {
                "parameters": [],
                "type": "function"
              }
            ],
            "groupBy": [
              {
                "property": {
                  "type": "string"
                },
                "type": "groupBy"
              }
            ],
            "limit": 50
          },
          "table": "alert",
          "timeColumn": "startsAt",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        },
        {
          "datasource": {
            "type": "mysql",
            "uid": "d51d42e2-9ecf-465b-a78e-724aa75cefa4"
          },
          "editorMode": "code",
          "format": "table",
          "group": [],
          "hide": false,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT\n\tAlertID AS \"ID\",\n\tValue AS \"env\"\nFROM\n\tAlertLabel\nWHERE\n\tAlertID IN (\n\tSELECT\n\t\tID \n\tFROM\n\t\tAlert \n\tWHERE\n\t  startsAt BETWEEN FROM_UNIXTIME(${__from:date:seconds}) AND FROM_UNIXTIME(${__to:date:seconds})\n\t)\n\tAND Label=\"idc\"",
          "refId": "C",
          "select": [
            [
              {
                "params": [
                  "ID"
                ],
                "type": "column"
              }
            ]
          ],
          "sql": {
            "columns": [
              {
                "parameters": [],
                "type": "function"
              }
            ],
            "groupBy": [
              {
                "property": {
                  "type": "string"
                },
                "type": "groupBy"
              }
            ],
            "limit": 50
          },
          "table": "alert",
          "timeColumn": "startsAt",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        },
        {
          "datasource": {
            "type": "mysql",
            "uid": "d51d42e2-9ecf-465b-a78e-724aa75cefa4"
          },
          "editorMode": "code",
          "format": "table",
          "group": [],
          "hide": false,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT\n\tAlertID AS \"ID\",\n\tValue AS \"severity\"\nFROM\n\tAlertLabel\nWHERE\n\tAlertID IN (\n\tSELECT\n\t\tID \n\tFROM\n\t\tAlert \n\tWHERE\n\t  startsAt BETWEEN FROM_UNIXTIME(${__from:date:seconds}) AND FROM_UNIXTIME(${__to:date:seconds})\n\t)\n\tAND Label=\"severity\"",
          "refId": "D",
          "select": [
            [
              {
                "params": [
                  "ID"
                ],
                "type": "column"
              }
            ]
          ],
          "sql": {
            "columns": [
              {
                "parameters": [],
                "type": "function"
              }
            ],
            "groupBy": [
              {
                "property": {
                  "type": "string"
                },
                "type": "groupBy"
              }
            ],
            "limit": 50
          },
          "table": "alert",
          "timeColumn": "startsAt",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        },
        {
          "datasource": {
            "type": "mysql",
            "uid": "d51d42e2-9ecf-465b-a78e-724aa75cefa4"
          },
          "editorMode": "code",
          "format": "table",
          "group": [],
          "hide": false,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT\n\tAlertID AS \"ID\",\n\tValue AS \"az\"\nFROM\n\tAlertLabel\nWHERE\n\tAlertID IN (\n\tSELECT\n\t\tID \n\tFROM\n\t\tAlert \n\tWHERE\n\t  startsAt BETWEEN FROM_UNIXTIME(${__from:date:seconds}) AND \tFROM_UNIXTIME(${__to:date:seconds})\n\t)\n\tAND Label=\"az\"",
          "refId": "E",
          "select": [
            [
              {
                "params": [
                  "ID"
                ],
                "type": "column"
              }
            ]
          ],
          "sql": {
            "columns": [
              {
                "parameters": [],
                "type": "function"
              }
            ],
            "groupBy": [
              {
                "property": {
                  "type": "string"
                },
                "type": "groupBy"
              }
            ],
            "limit": 50
          },
          "table": "alert",
          "timeColumn": "startsAt",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        },
        {
          "datasource": {
            "type": "mysql",
            "uid": "d51d42e2-9ecf-465b-a78e-724aa75cefa4"
          },
          "editorMode": "code",
          "format": "table",
          "group": [],
          "hide": false,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT\n\tAlertID AS \"ID\",\n\tValue AS \"hostname\"\nFROM\n\tAlertLabel\nWHERE\n\tAlertID IN (\n\tSELECT\n\t\tID \n\tFROM\n\t\tAlert \n\tWHERE\nstartsAt BETWEEN  FROM_UNIXTIME(${__from:date:seconds})  AND  FROM_UNIXTIME(${__to:date:seconds}) \n\t)\n\tAND Label=\"namehost\"",
          "refId": "F",
          "select": [
            [
              {
                "params": [
                  "ID"
                ],
                "type": "column"
              }
            ]
          ],
          "sql": {
            "columns": [
              {
                "parameters": [],
                "type": "function"
              }
            ],
            "groupBy": [
              {
                "property": {
                  "type": "string"
                },
                "type": "groupBy"
              }
            ],
            "limit": 50
          },
          "table": "alert",
          "timeColumn": "startsAt",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        },
        {
          "datasource": {
            "type": "mysql",
            "uid": "d51d42e2-9ecf-465b-a78e-724aa75cefa4"
          },
          "editorMode": "code",
          "format": "table",
          "group": [],
          "hide": false,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT\n\tAlertID AS \"ID\",\n\tValue AS \"project\"\nFROM\n\tAlertLabel\nWHERE\n\tAlertID IN (\n\tSELECT\n\t\tID \n\tFROM\n\t\tAlert \n\tWHERE\n\t  startsAt BETWEEN  FROM_UNIXTIME(${__from:date:seconds})  AND  FROM_UNIXTIME(${__to:date:seconds}) \n\t)\n\tAND Label=\"idc\"",
          "refId": "G",
          "select": [
            [
              {
                "params": [
                  "ID"
                ],
                "type": "column"
              }
            ]
          ],
          "sql": {
            "columns": [
              {
                "parameters": [],
                "type": "function"
              }
            ],
            "groupBy": [
              {
                "property": {
                  "type": "string"
                },
                "type": "groupBy"
              }
            ],
            "limit": 50
          },
          "table": "alert",
          "timeColumn": "startsAt",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        },
        {
          "datasource": {
            "type": "mysql",
            "uid": "d51d42e2-9ecf-465b-a78e-724aa75cefa4"
          },
          "editorMode": "code",
          "format": "table",
          "group": [],
          "hide": false,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT\n\tAlertID AS \"ID\",\n\tValue AS \"description\"\nFROM\n\tAlertAnnotation\nWHERE\n\tAlertID IN (\n\tSELECT\n\t\tID \n\tFROM\n\t\tAlert \n\tWHERE\n\t  startsAt BETWEEN  FROM_UNIXTIME(${__from:date:seconds})  AND  FROM_UNIXTIME(${__to:date:seconds}) \n\t)\n\tAND Annotation=\"detail\"",
          "refId": "H",
          "select": [
            [
              {
                "params": [
                  "ID"
                ],
                "type": "column"
              }
            ]
          ],
          "sql": {
            "columns": [
              {
                "parameters": [],
                "type": "function"
              }
            ],
            "groupBy": [
              {
                "property": {
                  "type": "string"
                },
                "type": "groupBy"
              }
            ],
            "limit": 50
          },
          "table": "alert",
          "timeColumn": "startsAt",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "alert not resolved",
      "transformations": [
        {
          "id": "merge",
          "options": {}
        },
        {
          "id": "groupBy",
          "options": {
            "fields": {
              "ID": {
                "aggregations": [
                  "last"
                ],
                "operation": "aggregate"
              },
              "alertname": {
                "aggregations": [
                  "last"
                ],
                "operation": "aggregate"
              },
              "az": {
                "aggregations": [
                  "last"
                ],
                "operation": "aggregate"
              },
              "description": {
                "aggregations": [
                  "last"
                ],
                "operation": "aggregate"
              },
              "duration": {
                "aggregations": [
                  "last"
                ],
                "operation": "aggregate"
              },
              "endsAt": {
                "aggregations": [
                  "last"
                ],
                "operation": "aggregate"
              },
              "env": {
                "aggregations": [
                  "last"
                ],
                "operation": "aggregate"
              },
              "fingerprint": {
                "aggregations": [],
                "operation": "groupby"
              },
              "hostname": {
                "aggregations": [
                  "last"
                ],
                "operation": "aggregate"
              },
              "project": {
                "aggregations": [
                  "last"
                ],
                "operation": "aggregate"
              },
              "severity": {
                "aggregations": [
                  "last"
                ],
                "operation": "aggregate"
              },
              "startsAt": {
                "aggregations": [
                  "last"
                ],
                "operation": "aggregate"
              },
              "status": {
                "aggregations": [
                  "last"
                ],
                "operation": "aggregate"
              }
            }
          }
        },
        {
          "id": "filterByValue",
          "options": {
            "filters": [
              {
                "config": {
                  "id": "equal",
                  "options": {
                    "value": "firing"
                  }
                },
                "fieldName": "status (last)"
              }
            ],
            "match": "all",
            "type": "include"
          }
        },
        {
          "id": "filterFieldsByName",
          "options": {
            "include": {
              "names": [
                "ID (last)",
                "startsAt (last)",
                "duration (last)",
                "alertname (last)",
                "hostname (last)",
                "description (last)"
              ]
            }
          }
        },
        {
          "id": "organize",
          "options": {
            "excludeByName": {},
            "indexByName": {},
            "renameByName": {
              "ID (last)": "ID",
              "alertname (last)": "名称",
              "description (last)": "描述",
              "duration (last)": "持续时间",
              "hostname (last)": "主机名",
              "startsAt (last)": "开始时间"
            }
          }
        }
      ],
      "type": "table"
    },
    {
      "collapsed": false,
      "datasource": {
        "type": "mysql",
        "uid": "d51d42e2-9ecf-465b-a78e-724aa75cefa4"
      },
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 29
      },
      "id": 28,
      "panels": [],
      "targets": [
        {
          "datasource": {
            "type": "mysql",
            "uid": "d51d42e2-9ecf-465b-a78e-724aa75cefa4"
          },
          "refId": "A"
        }
      ],
      "title": "alert details query",
      "type": "row"
    },
    {
      "datasource": {
        "type": "mysql",
        "uid": "d51d42e2-9ecf-465b-a78e-724aa75cefa4"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {
            "align": "auto",
            "cellOptions": {
              "type": "auto"
            },
            "filterable": true,
            "inspect": false
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "description"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 436
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "severity"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 104
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "env"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 94
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "startsAt"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 156
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "ID"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 94
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "状态"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 101
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "名称"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 209
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "主机名"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 173
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "项目"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 130
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "环境"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 107
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "描述"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 497
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 22,
        "w": 24,
        "x": 0,
        "y": 30
      },
      "id": 2,
      "options": {
        "cellHeight": "sm",
        "footer": {
          "countRows": false,
          "fields": "",
          "reducer": [
            "sum"
          ],
          "show": false
        },
        "frameIndex": 2,
        "showHeader": true,
        "sortBy": [
          {
            "desc": false,
            "displayName": "ID"
          }
        ]
      },
      "pluginVersion": "10.0.10",
      "targets": [
        {
          "datasource": {
            "type": "mysql",
            "uid": "d51d42e2-9ecf-465b-a78e-724aa75cefa4"
          },
          "editorMode": "code",
          "format": "table",
          "group": [],
          "hide": false,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT\n  ID,\n  status,\n  startsAt,\n  endsAt\nFROM Alert\nWHERE\n  startsAt BETWEEN  FROM_UNIXTIME(${__from:date:seconds})  AND  FROM_UNIXTIME(${__to:date:seconds})\nORDER BY ID",
          "refId": "A",
          "select": [
            [
              {
                "params": [
                  "ID"
                ],
                "type": "column"
              }
            ]
          ],
          "sql": {
            "columns": [
              {
                "parameters": [],
                "type": "function"
              }
            ],
            "groupBy": [
              {
                "property": {
                  "type": "string"
                },
                "type": "groupBy"
              }
            ],
            "limit": 50
          },
          "table": "alert",
          "timeColumn": "startsAt",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        },
        {
          "datasource": {
            "type": "mysql",
            "uid": "d51d42e2-9ecf-465b-a78e-724aa75cefa4"
          },
          "editorMode": "code",
          "format": "table",
          "group": [],
          "hide": false,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT\n\tAlertID AS \"ID\",\n\tValue AS \"alertname\"\nFROM\n\tAlertLabel\nWHERE\n\tAlertID IN (\n\tSELECT\n\t\tID \n\tFROM\n\t\tAlert \n\tWHERE\n\t  startsAt BETWEEN  FROM_UNIXTIME(${__from:date:seconds})  AND  FROM_UNIXTIME(${__to:date:seconds})\n\t)\n\tAND Label=\"alertname\"",
          "refId": "B",
          "select": [
            [
              {
                "params": [
                  "ID"
                ],
                "type": "column"
              }
            ]
          ],
          "sql": {
            "columns": [
              {
                "parameters": [],
                "type": "function"
              }
            ],
            "groupBy": [
              {
                "property": {
                  "type": "string"
                },
                "type": "groupBy"
              }
            ],
            "limit": 50
          },
          "table": "alert",
          "timeColumn": "startsAt",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        },
        {
          "datasource": {
            "type": "mysql",
            "uid": "d51d42e2-9ecf-465b-a78e-724aa75cefa4"
          },
          "editorMode": "code",
          "format": "table",
          "group": [],
          "hide": false,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT\n\tAlertID AS \"ID\",\n\tValue AS \"env\"\nFROM\n\tAlertLabel\nWHERE\n\tAlertID IN (\n\tSELECT\n\t\tID \n\tFROM\n\t\tAlert \n\tWHERE\n\t  startsAt BETWEEN  FROM_UNIXTIME(${__from:date:seconds})  AND  FROM_UNIXTIME(${__to:date:seconds})\n\t)\n\tAND Label=\"idc\"",
          "refId": "C",
          "select": [
            [
              {
                "params": [
                  "ID"
                ],
                "type": "column"
              }
            ]
          ],
          "sql": {
            "columns": [
              {
                "parameters": [],
                "type": "function"
              }
            ],
            "groupBy": [
              {
                "property": {
                  "type": "string"
                },
                "type": "groupBy"
              }
            ],
            "limit": 50
          },
          "table": "alert",
          "timeColumn": "startsAt",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        },
        {
          "datasource": {
            "type": "mysql",
            "uid": "d51d42e2-9ecf-465b-a78e-724aa75cefa4"
          },
          "editorMode": "code",
          "format": "table",
          "group": [],
          "hide": false,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT\n\tAlertID AS \"ID\",\n\tValue AS \"severity\"\nFROM\n\tAlertLabel\nWHERE\n\tAlertID IN (\n\tSELECT\n\t\tID \n\tFROM\n\t\tAlert \n\tWHERE\n\t  startsAt BETWEEN  FROM_UNIXTIME(${__from:date:seconds})  AND  FROM_UNIXTIME(${__to:date:seconds})\n\t)\n\tAND Label=\"severity\"",
          "refId": "D",
          "select": [
            [
              {
                "params": [
                  "ID"
                ],
                "type": "column"
              }
            ]
          ],
          "sql": {
            "columns": [
              {
                "parameters": [],
                "type": "function"
              }
            ],
            "groupBy": [
              {
                "property": {
                  "type": "string"
                },
                "type": "groupBy"
              }
            ],
            "limit": 50
          },
          "table": "alert",
          "timeColumn": "startsAt",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        },
        {
          "datasource": {
            "type": "mysql",
            "uid": "d51d42e2-9ecf-465b-a78e-724aa75cefa4"
          },
          "editorMode": "code",
          "format": "table",
          "group": [],
          "hide": false,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT\n\tAlertID AS \"ID\",\n\tValue AS \"az\"\nFROM\n\tAlertLabel\nWHERE\n\tAlertID IN (\n\tSELECT\n\t\tID \n\tFROM\n\t\tAlert \n\tWHERE\n\t  startsAt BETWEEN  FROM_UNIXTIME(${__from:date:seconds})  AND  FROM_UNIXTIME(${__to:date:seconds})\n\t)\n\tAND Label=\"az\"",
          "refId": "E",
          "select": [
            [
              {
                "params": [
                  "ID"
                ],
                "type": "column"
              }
            ]
          ],
          "sql": {
            "columns": [
              {
                "parameters": [],
                "type": "function"
              }
            ],
            "groupBy": [
              {
                "property": {
                  "type": "string"
                },
                "type": "groupBy"
              }
            ],
            "limit": 50
          },
          "table": "alert",
          "timeColumn": "startsAt",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        },
        {
          "datasource": {
            "type": "mysql",
            "uid": "d51d42e2-9ecf-465b-a78e-724aa75cefa4"
          },
          "editorMode": "code",
          "format": "table",
          "group": [],
          "hide": false,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT\n\tAlertID AS \"ID\",\n\tValue AS \"hostname\"\nFROM\n\tAlertLabel\nWHERE\n\tAlertID IN (\n\tSELECT\n\t\tID \n\tFROM\n\t\tAlert \n\tWHERE\n\t  startsAt BETWEEN  FROM_UNIXTIME(${__from:date:seconds})  AND  FROM_UNIXTIME(${__to:date:seconds})\n\t)\n\tAND Label=\"namehost\"",
          "refId": "F",
          "select": [
            [
              {
                "params": [
                  "ID"
                ],
                "type": "column"
              }
            ]
          ],
          "sql": {
            "columns": [
              {
                "parameters": [],
                "type": "function"
              }
            ],
            "groupBy": [
              {
                "property": {
                  "type": "string"
                },
                "type": "groupBy"
              }
            ],
            "limit": 50
          },
          "table": "alert",
          "timeColumn": "startsAt",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        },
        {
          "datasource": {
            "type": "mysql",
            "uid": "d51d42e2-9ecf-465b-a78e-724aa75cefa4"
          },
          "editorMode": "code",
          "format": "table",
          "group": [],
          "hide": false,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT\n\tAlertID AS \"ID\",\n\tValue AS \"project\"\nFROM\n\tAlertLabel\nWHERE\n\tAlertID IN (\n\tSELECT\n\t\tID \n\tFROM\n\t\tAlert \n\tWHERE\n\t  startsAt BETWEEN  FROM_UNIXTIME(${__from:date:seconds})  AND  FROM_UNIXTIME(${__to:date:seconds})\n\t)\n\tAND Label=\"name\"",
          "refId": "G",
          "select": [
            [
              {
                "params": [
                  "ID"
                ],
                "type": "column"
              }
            ]
          ],
          "sql": {
            "columns": [
              {
                "parameters": [],
                "type": "function"
              }
            ],
            "groupBy": [
              {
                "property": {
                  "type": "string"
                },
                "type": "groupBy"
              }
            ],
            "limit": 50
          },
          "table": "alert",
          "timeColumn": "startsAt",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        },
        {
          "datasource": {
            "type": "mysql",
            "uid": "d51d42e2-9ecf-465b-a78e-724aa75cefa4"
          },
          "editorMode": "code",
          "format": "table",
          "group": [],
          "hide": false,
          "metricColumn": "none",
          "rawQuery": true,
          "rawSql": "SELECT\n\tAlertID AS \"ID\",\n\tValue AS \"description\"\nFROM\n\tAlertAnnotation\nWHERE\n\tAlertID IN (\n\tSELECT\n\t\tID \n\tFROM\n\t\tAlert \n\tWHERE\n\t  startsAt BETWEEN  FROM_UNIXTIME(${__from:date:seconds})  AND  FROM_UNIXTIME(${__to:date:seconds})\n\t)\n\tAND Annotation=\"short\"",
          "refId": "H",
          "select": [
            [
              {
                "params": [
                  "ID"
                ],
                "type": "column"
              }
            ]
          ],
          "sql": {
            "columns": [
              {
                "parameters": [],
                "type": "function"
              }
            ],
            "groupBy": [
              {
                "property": {
                  "type": "string"
                },
                "type": "groupBy"
              }
            ],
            "limit": 50
          },
          "table": "alert",
          "timeColumn": "startsAt",
          "timeColumnType": "timestamp",
          "where": [
            {
              "name": "$__timeFilter",
              "params": [],
              "type": "macro"
            }
          ]
        }
      ],
      "title": "history alert details",
      "transformations": [
        {
          "id": "merge",
          "options": {}
        },
        {
          "id": "organize",
          "options": {
            "excludeByName": {
              "ID": false,
              "alertGroupID": true
            },
            "indexByName": {
              "ID": 0,
              "alertGroupID": 1,
              "alertname": 2,
              "az": 6,
              "description": 8,
              "endsAt": 11,
              "env": 7,
              "fingerprint": 12,
              "hostname": 4,
              "project": 5,
              "severity": 9,
              "startsAt": 10,
              "status": 3
            },
            "renameByName": {
              "ID": "",
              "alertname": "名称",
              "az": "地区",
              "description": "描述",
              "endsAt": "结束时间",
              "env": "环境",
              "hostname": "主机名",
              "project": "项目",
              "severity": "严重性",
              "startsAt": "开始时间",
              "status": "状态"
            }
          }
        }
      ],
      "type": "table"
    }
  ],
  "refresh": "",
  "schemaVersion": 38,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": []
  },
  "time": {
    "from": "now-24h",
    "to": "now"
  },
  "timepicker": {},
  "timezone": "browser",
  "title": "prometheus alert history-record",
  "uid": "E9sEj4J7k3",
  "version": 41,
  "weekStart": ""
}

 

标签:__,grafana,groupBy,prometheus,startsAt,ID,type,id,模板
From: https://www.cnblogs.com/putaoo/p/17921249.html

相关文章

  • BFS模板
    #classSolution:#defBFS(self,start,target):#q=[]#用一个列表做队列#v=[]#记录走过的路#q.append(start)#把起点放入队列#v.append(start)#加入走过的路#step=0#记录扩散步数#while......
  • Cloudeye对接Prometheus实现华为云全方位监控
    本文分享自华为云社区《Cloudeye对接Prometheus实现华为云全方位监控》,作者:可以交个朋友。一、背景云眼系统Cloudeye服务为我们提供了针对弹性云服务器、宽带等资源的立体化监控平台。帮助我们全面了解华为云上的资源使用情况、业务的运行状况。将华为云Cloudeye服务接入prom......
  • 【misc】[HNCTF 2022 WEEK2]calc_jail_beginner_level4.1(JAIL) --沙盒逃逸,python模板
    这道题没给附件,直接连上看看这里一开始用().__class__.__base__.__subclasses__()[-4].__init__.__globals__[bytes([115,121,115,116,101,109]).decode()](bytes([115,104]).decode())进行尝试,后面发现bytes函数被禁用了,可以用另外的函数代替().__class__.__base__.__subclasse......
  • 一些模板
    1e12找原根板子#include<bits/stdc++.h>#definelllonglongusingnamespacestd;lln,prime[1000005],is_prime[1000005],cnt,qv[1000005],qn[1000005],top,g,Phi,sum,ans[1000005],mod;voidfj(llx){ top=0; for(lli=1;prime[i]*prime[i]<=x;i++){ if(x%pri......
  • Grafana 自定义数据源支持 RESTful API 查询
    背景数据爆炸的时代,信息化步伐越来越快,接入互联网的服务越来越多。随着业务迭代变更越来越复杂化,需求/产品者对系统的要求越来越高,对业务走势及健康状态需要更直观的感知。这意味着我们需要随时能够“看见”系统的状态,对系统/业务的实时监控以及可视化是技术演进的必然。Grafana......
  • P2197 【模板】Nim 游戏
    原题链接题解说的很详细,我来讲讲我对为什么要用异或判断的想法异或为零是先手必败状态的一个属性,我们通过属性来判断类别。代码#include<bits/stdc++.h>usingnamespacestd;intmain(){intt;cin>>t;while(t--){intn;cin>>n;......
  • P3386 【模板】二分图最大匹配
    原题链接洛谷题解很详细,自己写了些理解在代码注释里代码#include<bits/stdc++.h>usingnamespacestd;intatch[50005]={0};intvis[50005]={0};vector<int>G[505];intweiy(intnow)//让now在他的“仓库”里按顺序找下一个能连的右点,找得到返回1,找不到返回0{vis[n......
  • 【misc】[HNCTF 2022 WEEK2]calc_jail_beginner_level4(JAIL) --沙盒逃逸,python模板注
    查看附件信息这里禁用了__import__,直接导致了help()函数和breakpoint()函数没法使用,并且还过滤了关键字符,这里考虑python模板注入,但是这里还过滤chr(),这里可以使用bytes函数payload如下:().__class__.__base__.__subclasses__()[-4].__init__.__globals__['system']('sh')......
  • VUE3学习基础之模板语法
    我的vue3学习之路总是学学停停,最开始在18年开发微信小程序,就发现小程序和vue的语法有些相似,然后就去看了vue2的文档,随后忙其它的事情就丢下了。直到22年又开始捡起来vue3,有了组合式api,语法简明很多,然后又不知道忙什么丢下。。。前段有些空时间,就把vue3的学习整理下,使用vite构建......
  • Python中配置Excel导出模板
    定义Excel列对象classExcelColumn:"""定义Excel中的列参数:name(str):列的名称。width(int|None,可选):列的宽度。默认为None。required(bool,可选):指示列是否必需。默认为False。mapping_factory(Callable......