Grafana dashboard: timeseries_result_cmp
Description: 查看「多个选定算法」在「选定数据集」的「选定序列」上的异常分数、检测耗时和指标对比


{
  "__inputs": [
    {
      "name": "DS_TSAD_EVALUATOR",
      "label": "TSAD_Evaluator",
      "description": "",
      "type": "datasource",
      "pluginId": "influxdb",
      "pluginName": "InfluxDB"
    }
  ],
  "__elements": [],
  "__requires": [
    {
      "type": "panel",
      "id": "barchart",
      "name": "Bar chart",
      "version": ""
    },
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "8.4.5"
    },
    {
      "type": "datasource",
      "id": "influxdb",
      "name": "InfluxDB",
      "version": "1.0.0"
    },
    {
      "type": "panel",
      "id": "stat",
      "name": "Stat",
      "version": ""
    },
    {
      "type": "panel",
      "id": "timeseries",
      "name": "Time series",
      "version": ""
    }
  ],
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "target": {
          "limit": 100,
          "matchAny": false,
          "tags": [],
          "type": "dashboard"
        },
        "type": "dashboard"
      },
      {
        "datasource": "${DS_TSAD_EVALUATOR}",
        "enable": true,
        "iconColor": "red",
        "name": "label",
        "query": "select label from \"$dataset@$timeseries\" where label=1"
      }
    ]
  },
  "editable": true,
  "fiscalYearStartMonth": 0,
  "graphTooltip": 0,
  "id": null,
  "iteration": 1655101202986,
  "links": [],
  "liveNow": false,
  "panels": [
    {
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "id": 23,
      "title": "Data Range",
      "type": "row"
    },
    {
      "datasource": {
        "type": "influxdb",
        "uid": "${DS_TSAD_EVALUATOR}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "continuous-blues"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 4,
        "w": 12,
        "x": 0,
        "y": 1
      },
      "id": 4,
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "/^Time$/",
          "values": false
        },
        "text": {},
        "textMode": "auto"
      },
      "pluginVersion": "8.4.5",
      "targets": [
        {
          "query": "SELECT label FROM \"$dataset@$timeseries\" limit 1",
          "rawQuery": true,
          "refId": "A",
          "resultFormat": "table"
        }
      ],
      "title": "From",
      "transparent": true,
      "type": "stat"
    },
    {
      "datasource": {
        "type": "influxdb",
        "uid": "${DS_TSAD_EVALUATOR}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "continuous-purples"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 4,
        "w": 12,
        "x": 12,
        "y": 1
      },
      "id": 6,
      "options": {
        "colorMode": "value",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "/^Time$/",
          "values": false
        },
        "text": {},
        "textMode": "auto"
      },
      "pluginVersion": "8.4.5",
      "targets": [
        {
          "query": "SELECT label FROM \"$dataset@$timeseries\" order by time desc limit 1",
          "rawQuery": true,
          "refId": "A"
        }
      ],
      "title": "To",
      "transparent": true,
      "type": "stat"
    },
    {
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 5
      },
      "id": 18,
      "title": "Time Series",
      "type": "row"
    },
    {
      "datasource": {
        "type": "influxdb",
        "uid": "${DS_TSAD_EVALUATOR}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 0,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "lineInterpolation": "linear",
            "lineStyle": {
              "fill": "solid"
            },
            "lineWidth": 1,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "auto",
            "spanNulls": false,
            "stacking": {
              "group": "A",
              "mode": "none"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 10,
        "w": 24,
        "x": 0,
        "y": 6
      },
      "id": 2,
      "options": {
        "legend": {
          "calcs": [],
          "displayMode": "list",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "single",
          "sort": "none"
        }
      },
      "targets": [
        {
          "query": "SELECT ${data_dim:doublequote} FROM \"$dataset@$timeseries\" WHERE $timeFilter \n",
          "rawQuery": true,
          "refId": "A"
        }
      ],
      "title": "Data",
      "transparent": true,
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "influxdb",
        "uid": "${DS_TSAD_EVALUATOR}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 0,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "lineInterpolation": "linear",
            "lineWidth": 1,
            "pointSize": 5,
            "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": 10,
        "w": 24,
        "x": 0,
        "y": 16
      },
      "id": 29,
      "options": {
        "legend": {
          "calcs": [],
          "displayMode": "list",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "single",
          "sort": "none"
        }
      },
      "targets": [
        {
          "query": "SELECT mean(score) FROM /^$detector@$dataset@$timeseries$/ WHERE $timeFilter GROUP BY time($__interval) fill(null)",
          "rawQuery": true,
          "refId": "A"
        }
      ],
      "title": "Score",
      "transparent": true,
      "type": "timeseries"
    },
    {
      "collapsed": false,
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 26
      },
      "id": 13,
      "panels": [],
      "title": "Metric",
      "type": "row"
    },
    {
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisLabel": "",
            "axisPlacement": "auto",
            "axisSoftMin": 0,
            "fillOpacity": 80,
            "gradientMode": "hue",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "lineWidth": 1,
            "scaleDistribution": {
              "type": "linear"
            }
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 6,
        "x": 0,
        "y": 27
      },
      "id": 8,
      "maxPerRow": 4,
      "options": {
        "barRadius": 0,
        "barWidth": 0.97,
        "groupWidth": 0.7,
        "legend": {
          "calcs": [],
          "displayMode": "hidden",
          "placement": "bottom"
        },
        "orientation": "auto",
        "showValue": "auto",
        "stacking": "none",
        "text": {},
        "tooltip": {
          "mode": "single",
          "sort": "none"
        },
        "xTickLabelRotation": 0,
        "xTickLabelSpacing": 0
      },
      "pluginVersion": "8.0.6",
      "repeat": "metric",
      "repeatDirection": "h",
      "targets": [
        {
          "datasource": {
            "type": "influxdb",
            "uid": "${DS_TSAD_EVALUATOR}"
          },
          "query": "select last(detector_name), mean($metric) from result_ts_meta where \"ds_name\" = '$dataset' and \"ts_name\" = '$timeseries' and \"detector_name\" =~ /$detector/ group by detector_name",
          "rawQuery": true,
          "refId": "A",
          "resultFormat": "table"
        }
      ],
      "title": "$metric",
      "transparent": true,
      "type": "barchart"
    }
  ],
  "refresh": false,
  "schemaVersion": 35,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": [
      {
        "current": {},
        "datasource": {
          "type": "influxdb",
          "uid": "${DS_TSAD_EVALUATOR}"
        },
        "definition": "select ds_name from (select * from result_ts_meta)",
        "hide": 0,
        "includeAll": false,
        "multi": false,
        "name": "dataset",
        "options": [],
        "query": "select ds_name from (select * from result_ts_meta)",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "type": "query"
      },
      {
        "current": {},
        "datasource": {
          "type": "influxdb",
          "uid": "${DS_TSAD_EVALUATOR}"
        },
        "definition": "select ts_name from (select * from result_ts_meta where \"ds_name\"='$dataset')",
        "hide": 0,
        "includeAll": false,
        "multi": false,
        "name": "timeseries",
        "options": [],
        "query": "select ts_name from (select * from result_ts_meta where \"ds_name\"='$dataset')",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 1,
        "type": "query"
      },
      {
        "current": {},
        "datasource": {
          "type": "influxdb",
          "uid": "${DS_TSAD_EVALUATOR}"
        },
        "definition": "select detector_name from (select * from result_ts_meta where \"ds_name\" = '$dataset' and \"ts_name\" = '$timeseries')",
        "hide": 0,
        "includeAll": false,
        "multi": true,
        "name": "detector",
        "options": [],
        "query": "select detector_name from (select * from result_ts_meta where \"ds_name\" = '$dataset' and \"ts_name\" = '$timeseries')",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 1,
        "type": "query"
      },
      {
        "current": {},
        "datasource": {
          "type": "influxdb",
          "uid": "${DS_TSAD_EVALUATOR}"
        },
        "definition": "show field keys from \"$dataset@$timeseries\"",
        "hide": 0,
        "includeAll": false,
        "multi": true,
        "name": "data_dim",
        "options": [],
        "query": "show field keys from \"$dataset@$timeseries\"",
        "refresh": 1,
        "regex": "^(?!label).*$",
        "skipUrlSync": false,
        "sort": 0,
        "type": "query"
      },
      {
        "current": {},
        "datasource": {
          "type": "influxdb",
          "uid": "${DS_TSAD_EVALUATOR}"
        },
        "definition": "show field keys from  result_ts_meta",
        "hide": 0,
        "includeAll": false,
        "multi": true,
        "name": "metric",
        "options": [],
        "query": "show field keys from  result_ts_meta",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 1,
        "type": "query"
      }
    ]
  },
  "time": {
    "from": "2014-12-22T07:56:55.879Z",
    "to": "2015-01-22T01:16:09.431Z"
  },
  "timepicker": {},
  "timezone": "",
  "title": "timeseries_result_cmp",
  "uid": "G7kyIQP7z",
  "version": 2,
  "weekStart": "",
  "gnetId": 16436,
  "description": "查看「多个选定算法」在「选定数据集」的「选定序列」上的异常分数、检测耗时和指标对比"
}