{
   "__inputs": [
      {
         "description": "",
         "label": "test-cluster",
         "name": "DS_TEST-CLUSTER",
         "pluginId": "prometheus",
         "pluginName": "Prometheus",
         "type": "datasource"
      }
   ],
   "__requires": [ ],
   "annotations": {
      "list": [ ]
   },
   "editable": true,
   "gnetId": null,
   "graphTooltip": 1,
   "hideControls": false,
   "id": null,
   "links": [ ],
   "panels": [
      {
         "collapse": true,
         "collapsed": true,
         "gridPos": {
            "h": 1,
            "w": 24,
            "x": 0,
            "y": 0
         },
         "id": 2,
         "panels": [
            {
               "aliasColors": { },
               "bars": false,
               "dashLength": 10,
               "dashes": false,
               "datasource": "${DS_TEST-CLUSTER}",
               "description": "TiDB uptime since the last restart.",
               "fill": 1,
               "fillGradient": 0,
               "gridPos": {
                  "h": 6,
                  "w": 12,
                  "x": 0,
                  "y": 0
               },
               "id": 3,
               "legend": {
                  "alignAsTable": false,
                  "avg": false,
                  "current": false,
                  "max": false,
                  "min": false,
                  "rightSide": true,
                  "show": true,
                  "sideWidth": null,
                  "total": false,
                  "values": false
               },
               "lines": true,
               "linewidth": 1,
               "links": [ ],
               "nullPointMode": "null",
               "percentage": false,
               "pointradius": 5,
               "points": false,
               "renderer": "flot",
               "repeat": null,
               "seriesOverrides": [ ],
               "spaceLength": 10,
               "stack": false,
               "steppedLine": false,
               "targets": [
                  {
                     "expr": "time() - process_start_time_seconds{k8s_cluster=\"$k8s_cluster\", tidb_cluster=\"$tidb_cluster\", instance=~\"$instance\", job=\"tidb\"}",
                     "format": "time_series",
                     "intervalFactor": 2,
                     "legendFormat": "{{instance}}",
                     "refId": "A"
                  }
               ],
               "thresholds": [ ],
               "timeFrom": null,
               "timeShift": null,
               "title": "Uptime",
               "tooltip": {
                  "shared": true,
                  "sort": 0,
                  "value_type": "individual"
               },
               "type": "graph",
               "xaxis": {
                  "buckets": null,
                  "mode": "time",
                  "name": null,
                  "show": true,
                  "values": [ ]
               },
               "yaxes": [
                  {
                     "format": "s",
                     "label": null,
                     "logBase": 1,
                     "max": null,
                     "min": null,
                     "show": true
                  },
                  {
                     "format": "s",
                     "label": null,
                     "logBase": 1,
                     "max": null,
                     "min": null,
                     "show": true
                  }
               ]
            },
            {
               "aliasColors": { },
               "bars": false,
               "dashLength": 10,
               "dashes": false,
               "datasource": "${DS_TEST-CLUSTER}",
               "description": "TiDB current connection counts.",
               "fill": 1,
               "fillGradient": 0,
               "gridPos": {
                  "h": 6,
                  "w": 12,
                  "x": 12,
                  "y": 0
               },
               "id": 4,
               "legend": {
                  "alignAsTable": false,
                  "avg": false,
                  "current": false,
                  "max": false,
                  "min": false,
                  "rightSide": true,
                  "show": true,
                  "sideWidth": null,
                  "total": false,
                  "values": false
               },
               "lines": true,
               "linewidth": 1,
               "links": [ ],
               "nullPointMode": "null",
               "percentage": false,
               "pointradius": 5,
               "points": false,
               "renderer": "flot",
               "repeat": null,
               "seriesOverrides": [ ],
               "spaceLength": 10,
               "stack": true,
               "steppedLine": false,
               "targets": [
                  {
                     "expr": "tidb_server_connections{k8s_cluster=\"$k8s_cluster\", tidb_cluster=\"$tidb_cluster\", instance=~\"$instance\"}",
                     "format": "time_series",
                     "intervalFactor": 2,
                     "legendFormat": "{{instance}} {{resource_group}}",
                     "refId": "A"
                  },
                  {
                     "expr": "sum(tidb_server_connections{k8s_cluster=\"$k8s_cluster\", tidb_cluster=\"$tidb_cluster\"})",
                     "format": "time_series",
                     "intervalFactor": 2,
                     "legendFormat": "total",
                     "refId": "B"
                  }
               ],
               "thresholds": [ ],
               "timeFrom": null,
               "timeShift": null,
               "title": "Connection Count",
               "tooltip": {
                  "shared": true,
                  "sort": 0,
                  "value_type": "individual"
               },
               "type": "graph",
               "xaxis": {
                  "buckets": null,
                  "mode": "time",
                  "name": null,
                  "show": true,
                  "values": [ ]
               },
               "yaxes": [
                  {
                     "format": "short",
                     "label": null,
                     "logBase": 1,
                     "max": null,
                     "min": null,
                     "show": true
                  },
                  {
                     "format": "short",
                     "label": null,
                     "logBase": 1,
                     "max": null,
                     "min": null,
                     "show": true
                  }
               ]
            },
            {
               "aliasColors": { },
               "bars": false,
               "dashLength": 10,
               "dashes": false,
               "datasource": "${DS_TEST-CLUSTER}",
               "description": "TiDB CPU usage calculated with process CPU running seconds.",
               "fill": 1,
               "fillGradient": 0,
               "gridPos": {
                  "h": 6,
                  "w": 12,
                  "x": 0,
                  "y": 0
               },
               "id": 5,
               "legend": {
                  "alignAsTable": false,
                  "avg": false,
                  "current": false,
                  "max": false,
                  "min": false,
                  "rightSide": true,
                  "show": true,
                  "sideWidth": null,
                  "total": false,
                  "values": false
               },
               "lines": true,
               "linewidth": 1,
               "links": [ ],
               "nullPointMode": "null",
               "percentage": false,
               "pointradius": 5,
               "points": false,
               "renderer": "flot",
               "repeat": null,
               "seriesOverrides": [ ],
               "spaceLength": 10,
               "stack": false,
               "steppedLine": false,
               "targets": [
                  {
                     "expr": "rate(process_cpu_seconds_total{k8s_cluster=\"$k8s_cluster\", tidb_cluster=\"$tidb_cluster\", instance=~\"$instance\", job=\"tidb\"}[1m])",
                     "format": "time_series",
                     "intervalFactor": 2,
                     "legendFormat": "{{instance}}",
                     "refId": "A"
                  },
                  {
                     "expr": "tidb_server_maxprocs{k8s_cluster=\"$k8s_cluster\", tidb_cluster=\"$tidb_cluster\", instance=~\"$instance\"}",
                     "format": "time_series",
                     "intervalFactor": 2,
                     "legendFormat": "quota-{{instance}}",
                     "refId": "B"
                  }
               ],
               "thresholds": [ ],
               "timeFrom": null,
               "timeShift": null,
               "title": "CPU Usage",
               "tooltip": {
                  "shared": true,
                  "sort": 0,
                  "value_type": "individual"
               },
               "type": "graph",
               "xaxis": {
                  "buckets": null,
                  "mode": "time",
                  "name": null,
                  "show": true,
                  "values": [ ]
               },
               "yaxes": [
                  {
                     "format": "percentunit",
                     "label": null,
                     "logBase": 1,
                     "max": null,
                     "min": null,
                     "show": true
                  },
                  {
                     "format": "percentunit",
                     "label": null,
                     "logBase": 1,
                     "max": null,
                     "min": null,
                     "show": true
                  }
               ]
            },
            {
               "aliasColors": { },
               "bars": false,
               "dashLength": 10,
               "dashes": false,
               "datasource": "${DS_TEST-CLUSTER}",
               "description": "TiDB process rss memory usage.TiDB heap memory size in use.",
               "fill": 1,
               "fillGradient": 0,
               "gridPos": {
                  "h": 6,
                  "w": 12,
                  "x": 12,
                  "y": 0
               },
               "id": 6,
               "legend": {
                  "alignAsTable": false,
                  "avg": false,
                  "current": false,
                  "max": false,
                  "min": false,
                  "rightSide": true,
                  "show": true,
                  "sideWidth": null,
                  "total": false,
                  "values": false
               },
               "lines": true,
               "linewidth": 1,
               "links": [ ],
               "nullPointMode": "null",
               "percentage": false,
               "pointradius": 5,
               "points": false,
               "renderer": "flot",
               "repeat": null,
               "seriesOverrides": [ ],
               "spaceLength": 10,
               "stack": false,
               "steppedLine": false,
               "targets": [
                  {
                     "expr": "process_resident_memory_bytes{k8s_cluster=\"$k8s_cluster\", tidb_cluster=\"$tidb_cluster\", instance=~\"$instance\", job=\"tidb\"}",
                     "format": "time_series",
                     "intervalFactor": 2,
                     "legendFormat": "process-{{instance}}",
                     "refId": "A"
                  },
                  {
                     "expr": "go_memory_classes_heap_objects_bytes{k8s_cluster=\"$k8s_cluster\", tidb_cluster=\"$tidb_cluster\", instance=~\"$instance\", job=\"tidb\"} + go_memory_classes_heap_unused_bytes{k8s_cluster=\"$k8s_cluster\", tidb_cluster=\"$tidb_cluster\", instance=~\"$instance\", job=\"tidb\"}",
                     "format": "time_series",
                     "intervalFactor": 2,
                     "legendFormat": "HeapInuse-{{instance}}",
                     "refId": "B"
                  },
                  {
                     "expr": "tidb_server_memory_quota_bytes{k8s_cluster=\"$k8s_cluster\", tidb_cluster=\"$tidb_cluster\", instance=~\"$instance\", job=\"tidb\"}",
                     "format": "time_series",
                     "intervalFactor": 2,
                     "legendFormat": "quota-{{instance}}",
                     "refId": "C"
                  }
               ],
               "thresholds": [ ],
               "timeFrom": null,
               "timeShift": null,
               "title": "Memory Usage",
               "tooltip": {
                  "shared": true,
                  "sort": 0,
                  "value_type": "individual"
               },
               "type": "graph",
               "xaxis": {
                  "buckets": null,
                  "mode": "time",
                  "name": null,
                  "show": true,
                  "values": [ ]
               },
               "yaxes": [
                  {
                     "format": "bytes",
                     "label": null,
                     "logBase": 1,
                     "max": null,
                     "min": null,
                     "show": true
                  },
                  {
                     "format": "bytes",
                     "label": null,
                     "logBase": 1,
                     "max": null,
                     "min": null,
                     "show": true
                  }
               ]
            }
         ],
         "repeat": null,
         "repeatIteration": null,
         "repeatRowId": null,
         "showTitle": true,
         "title": "Server",
         "titleSize": "h6",
         "type": "row"
      },
      {
         "collapse": true,
         "collapsed": true,
         "gridPos": {
            "h": 1,
            "w": 24,
            "x": 0,
            "y": 0
         },
         "id": 7,
         "panels": [
            {
               "aliasColors": { },
               "bars": false,
               "dashLength": 10,
               "dashes": false,
               "datasource": "${DS_TEST-CLUSTER}",
               "description": "TiDB query durations by histogram buckets with different percents.",
               "fill": 1,
               "fillGradient": 0,
               "gridPos": {
                  "h": 6,
                  "w": 12,
                  "x": 0,
                  "y": 0
               },
               "id": 8,
               "legend": {
                  "alignAsTable": false,
                  "avg": false,
                  "current": false,
                  "max": false,
                  "min": false,
                  "rightSide": true,
                  "show": true,
                  "sideWidth": null,
                  "total": false,
                  "values": false
               },
               "lines": true,
               "linewidth": 1,
               "links": [ ],
               "nullPointMode": "null",
               "percentage": false,
               "pointradius": 5,
               "points": false,
               "renderer": "flot",
               "repeat": null,
               "seriesOverrides": [ ],
               "spaceLength": 10,
               "stack": false,
               "steppedLine": false,
               "targets": [
                  {
                     "expr": "histogram_quantile(0.99, sum(rate(tidb_server_handle_query_duration_seconds_bucket{k8s_cluster=\"$k8s_cluster\", tidb_cluster=\"$tidb_cluster\", instance=~\"$instance\", sql_type!=\"internal\"}[1m])) by (le))",
                     "format": "time_series",
                     "intervalFactor": 2,
                     "legendFormat": "99",
                     "refId": "A"
                  },
                  {
                     "expr": "histogram_quantile(0.95, sum(rate(tidb_server_handle_query_duration_seconds_bucket{k8s_cluster=\"$k8s_cluster\", tidb_cluster=\"$tidb_cluster\", instance=~\"$instance\", sql_type!=\"internal\"}[1m])) by (le))",
                     "format": "time_series",
                     "intervalFactor": 2,
                     "legendFormat": "95",
                     "refId": "B"
                  },
                  {
                     "expr": "sum(rate(tidb_server_handle_query_duration_seconds_sum{k8s_cluster=\"$k8s_cluster\", tidb_cluster=\"$tidb_cluster\", instance=~\"$instance\", sql_type!=\"internal\"}[30s])) / sum(rate(tidb_server_handle_query_duration_seconds_count{k8s_cluster=\"$k8s_cluster\", tidb_cluster=\"$tidb_cluster\", instance=~\"$instance\", sql_type!=\"internal\"}[30s]))",
                     "format": "time_series",
                     "intervalFactor": 2,
                     "legendFormat": "avg",
                     "refId": "C"
                  }
               ],
               "thresholds": [ ],
               "timeFrom": null,
               "timeShift": null,
               "title": "Duration",
               "tooltip": {
                  "shared": true,
                  "sort": 0,
                  "value_type": "individual"
               },
               "type": "graph",
               "xaxis": {
                  "buckets": null,
                  "mode": "time",
                  "name": null,
                  "show": true,
                  "values": [ ]
               },
               "yaxes": [
                  {
                     "format": "s",
                     "label": null,
                     "logBase": 1,
                     "max": null,
                     "min": null,
                     "show": true
                  },
                  {
                     "format": "s",
                     "label": null,
                     "logBase": 1,
                     "max": null,
                     "min": null,
                     "show": true
                  }
               ]
            },
            {
               "aliasColors": { },
               "bars": false,
               "dashLength": 10,
               "dashes": false,
               "datasource": "${DS_TEST-CLUSTER}",
               "description": "TiDB failed query statistics by query type.",
               "fill": 1,
               "fillGradient": 0,
               "gridPos": {
                  "h": 6,
                  "w": 12,
                  "x": 12,
                  "y": 0
               },
               "id": 9,
               "legend": {
                  "alignAsTable": false,
                  "avg": false,
                  "current": false,
                  "max": false,
                  "min": false,
                  "rightSide": true,
                  "show": true,
                  "sideWidth": null,
                  "total": false,
                  "values": false
               },
               "lines": true,
               "linewidth": 1,
               "links": [ ],
               "nullPointMode": "null",
               "percentage": false,
               "pointradius": 5,
               "points": false,
               "renderer": "flot",
               "repeat": null,
               "seriesOverrides": [ ],
               "spaceLength": 10,
               "stack": false,
               "steppedLine": false,
               "targets": [
                  {
                     "expr": "sum(increase(tidb_server_execute_error_total{k8s_cluster=\"$k8s_cluster\", tidb_cluster=\"$tidb_cluster\", instance=~\"$instance\"}[1m])) by (type, instance)",
                     "format": "time_series",
                     "intervalFactor": 2,
                     "legendFormat": "{{type}}-{{instance}}",
                     "refId": "A"
                  }
               ],
               "thresholds": [ ],
               "timeFrom": null,
               "timeShift": null,
               "title": "Failed Query OPS",
               "tooltip": {
                  "shared": true,
                  "sort": 0,
                  "value_type": "individual"
               },
               "type": "graph",
               "xaxis": {
                  "buckets": null,
                  "mode": "time",
                  "name": null,
                  "show": true,
                  "values": [ ]
               },
               "yaxes": [
                  {
                     "format": "short",
                     "label": null,
                     "logBase": 1,
                     "max": null,
                     "min": null,
                     "show": true
                  },
                  {
                     "format": "short",
                     "label": null,
                     "logBase": 1,
                     "max": null,
                     "min": null,
                     "show": true
                  }
               ]
            },
            {
               "aliasColors": { },
               "bars": false,
               "dashLength": 10,
               "dashes": false,
               "datasource": "${DS_TEST-CLUSTER}",
               "description": "MySQL command processing numbers per second. See https://dev.mysql.com/doc/internals/en/text-protocol.html and https://dev.mysql.com/doc/internals/en/prepared-statements.html",
               "fill": 1,
               "fillGradient": 0,
               "gridPos": {
                  "h": 6,
                  "w": 12,
                  "x": 0,
                  "y": 0
               },
               "id": 10,
               "legend": {
                  "alignAsTable": false,
                  "avg": false,
                  "current": false,
                  "max": false,
                  "min": false,
                  "rightSide": true,
                  "show": true,
                  "sideWidth": null,
                  "total": false,
                  "values": false
               },
               "lines": true,
               "linewidth": 1,
               "links": [ ],
               "nullPointMode": "null",
               "percentage": false,
               "pointradius": 5,
               "points": false,
               "renderer": "flot",
               "repeat": null,
               "seriesOverrides": [ ],
               "spaceLength": 10,
               "stack": false,
               "steppedLine": false,
               "targets": [
                  {
                     "expr": "sum(rate(tidb_server_query_total{k8s_cluster=\"$k8s_cluster\", tidb_cluster=\"$tidb_cluster\", instance=~\"$instance\"}[1m])) by (result)",
                     "format": "time_series",
                     "intervalFactor": 2,
                     "legendFormat": "query {{result}}",
                     "refId": "A"
                  },
                  {
                     "expr": "sum(rate(tidb_server_query_total{k8s_cluster=\"$k8s_cluster\", tidb_cluster=\"$tidb_cluster\", instance=~\"$instance\", result=\"OK\"}[1m]  offset 1d))",
                     "format": "time_series",
                     "hide": true,
                     "intervalFactor": 2,
                     "legendFormat": "yesterday",
                     "refId": "B"
                  },
                  {
                     "expr": "sum(tidb_server_connections{k8s_cluster=\"$k8s_cluster\", tidb_cluster=\"$tidb_cluster\", instance=~\"$instance\"}) * sum(rate(tidb_server_handle_query_duration_seconds_count{k8s_cluster=\"$k8s_cluster\", tidb_cluster=\"$tidb_cluster\", instance=~\"$instance\"}[1m])) / sum(rate(tidb_server_handle_query_duration_seconds_sum{k8s_cluster=\"$k8s_cluster\", tidb_cluster=\"$tidb_cluster\", instance=~\"$instance\"}[1m]))",
                     "format": "time_series",
                     "hide": true,
                     "intervalFactor": 2,
                     "legendFormat": "ideal CPS",
                     "refId": "C"
                  }
               ],
               "thresholds": [ ],
               "timeFrom": null,
               "timeShift": null,
               "title": "Command Per Second",
               "tooltip": {
                  "shared": true,
                  "sort": 0,
                  "value_type": "individual"
               },
               "type": "graph",
               "xaxis": {
                  "buckets": null,
                  "mode": "time",
                  "name": null,
                  "show": true,
                  "values": [ ]
               },
               "yaxes": [
                  {
                     "format": "short",
                     "label": null,
                     "logBase": 1,
                     "max": null,
                     "min": null,
                     "show": true
                  },
                  {
                     "format": "short",
                     "label": null,
                     "logBase": 1,
                     "max": null,
                     "min": null,
                     "show": true
                  }
               ]
            },
            {
               "aliasColors": { },
               "bars": false,
               "dashLength": 10,
               "dashes": false,
               "datasource": "${DS_TEST-CLUSTER}",
               "description": "TiDB query total statistics including both successful and failed ones.",
               "fill": 1,
               "fillGradient": 0,
               "gridPos": {
                  "h": 6,
                  "w": 12,
                  "x": 12,
                  "y": 0
               },
               "id": 11,
               "legend": {
                  "alignAsTable": false,
                  "avg": false,
                  "current": false,
                  "max": false,
                  "min": false,
                  "rightSide": true,
                  "show": true,
                  "sideWidth": null,
                  "total": false,
                  "values": false
               },
               "lines": true,
               "linewidth": 1,
               "links": [ ],
               "nullPointMode": "null",
               "percentage": false,
               "pointradius": 5,
               "points": false,
               "renderer": "flot",
               "repeat": null,
               "seriesOverrides": [ ],
               "spaceLength": 10,
               "stack": false,
               "steppedLine": false,
               "targets": [
                  {
                     "expr": "sum(rate(tidb_server_query_total{k8s_cluster=\"$k8s_cluster\", tidb_cluster=\"$tidb_cluster\", instance=~\"$instance\"}[1m])) by (instance)",
                     "format": "time_series",
                     "intervalFactor": 2,
                     "legendFormat": "{{instance}}",
                     "refId": "A"
                  }
               ],
               "thresholds": [ ],
               "timeFrom": null,
               "timeShift": null,
               "title": "CPS By Instance",
               "tooltip": {
                  "shared": true,
                  "sort": 0,
                  "value_type": "individual"
               },
               "type": "graph",
               "xaxis": {
                  "buckets": null,
                  "mode": "time",
                  "name": null,
                  "show": true,
                  "values": [ ]
               },
               "yaxes": [
                  {
                     "format": "short",
                     "label": null,
                     "logBase": 1,
                     "max": null,
                     "min": null,
                     "show": true
                  },
                  {
                     "format": "short",
                     "label": null,
                     "logBase": 1,
                     "max": null,
                     "min": null,
                     "show": true
                  }
               ]
            },
            {
               "aliasColors": { },
               "bars": false,
               "dashLength": 10,
               "dashes": false,
               "datasource": "${DS_TEST-CLUSTER}",
               "description": "TiDB statement statistics.",
               "fill": 1,
               "fillGradient": 0,
               "gridPos": {
                  "h": 6,
                  "w": 12,
                  "x": 0,
                  "y": 0
               },
               "id": 12,
               "legend": {
                  "alignAsTable": false,
                  "avg": false,
                  "current": false,
                  "max": false,
                  "min": false,
                  "rightSide": true,
                  "show": true,
                  "sideWidth": null,
                  "total": false,
                  "values": false
               },
               "lines": true,
               "linewidth": 1,
               "links": [ ],
               "nullPointMode": "null",
               "percentage": false,
               "pointradius": 5,
               "points": false,
               "renderer": "flot",
               "repeat": null,
               "seriesOverrides": [ ],
               "spaceLength": 10,
               "stack": false,
               "steppedLine": false,
               "targets": [
                  {
                     "expr": "sum(rate(tidb_executor_statement_total{k8s_cluster=\"$k8s_cluster\", tidb_cluster=\"$tidb_cluster\", instance=~\"$instance\"}[1m])) by (type)",
                     "format": "time_series",
                     "intervalFactor": 2,
                     "legendFormat": "{{type}}",
                     "refId": "A"
                  },
                  {
                     "expr": "sum(rate(tidb_executor_statement_total{k8s_cluster=\"$k8s_cluster\", tidb_cluster=\"$tidb_cluster\", instance=~\"$instance\"}[1m]))",
                     "format": "time_series",
                     "intervalFactor": 2,
                     "legendFormat": "total",
                     "refId": "B"
                  }
               ],
               "thresholds": [ ],
               "timeFrom": null,
               "timeShift": null,
               "title": "QPS",
               "tooltip": {
                  "shared": true,
                  "sort": 0,
                  "value_type": "individual"
               },
               "type": "graph",
               "xaxis": {
                  "buckets": null,
                  "mode": "time",
                  "name": null,
                  "show": true,
                  "values": [ ]
               },
               "yaxes": [
                  {
                     "format": "short",
                     "label": null,
                     "logBase": 1,
                     "max": null,
                     "min": null,
                     "show": true
                  },
                  {
                     "format": "short",
                     "label": null,
                     "logBase": 1,
                     "max": null,
                     "min": null,
                     "show": true
                  }
               ]
            },
            {
               "aliasColors": { },
               "bars": false,
               "dashLength": 10,
               "dashes": false,
               "datasource": "${DS_TEST-CLUSTER}",
               "description": "MySQL command statistics by command type. See https://dev.mysql.com/doc/internals/en/text-protocol.html and https://dev.mysql.com/doc/internals/en/prepared-statements.html",
               "fill": 1,
               "fillGradient": 0,
               "gridPos": {
                  "h": 6,
                  "w": 12,
                  "x": 12,
                  "y": 0
               },
               "id": 13,
               "legend": {
                  "alignAsTable": false,
                  "avg": false,
                  "current": false,
                  "max": false,
                  "min": false,
                  "rightSide": true,
                  "show": true,
                  "sideWidth": null,
                  "total": false,
                  "values": false
               },
               "lines": true,
               "linewidth": 1,
               "links": [ ],
               "nullPointMode": "null",
               "percentage": false,
               "pointradius": 5,
               "points": false,
               "renderer": "flot",
               "repeat": null,
               "seriesOverrides": [ ],
               "spaceLength": 10,
               "stack": false,
               "steppedLine": false,
               "targets": [
                  {
                     "expr": "sum(rate(tidb_server_query_total{k8s_cluster=\"$k8s_cluster\", tidb_cluster=\"$tidb_cluster\", instance=~\"$instance\"}[1m])) by (type)",
                     "format": "time_series",
                     "intervalFactor": 2,
                     "legendFormat": "{{type}}",
                     "refId": "A"
                  }
               ],
               "thresholds": [ ],
               "timeFrom": null,
               "timeShift": null,
               "title": "CPS by CMD",
               "tooltip": {
                  "shared": true,
                  "sort": 0,
                  "value_type": "individual"
               },
               "type": "graph",
               "xaxis": {
                  "buckets": null,
                  "mode": "time",
                  "name": null,
                  "show": true,
                  "values": [ ]
               },
               "yaxes": [
                  {
                     "format": "short",
                     "label": null,
                     "logBase": 1,
                     "max": null,
                     "min": null,
                     "show": true
                  },
                  {
                     "format": "short",
                     "label": null,
                     "logBase": 1,
                     "max": null,
                     "min": null,
                     "show": true
                  }
               ]
            }
         ],
         "repeat": null,
         "repeatIteration": null,
         "repeatRowId": null,
         "showTitle": true,
         "title": "Query Summary",
         "titleSize": "h6",
         "type": "row"
      },
      {
         "collapse": true,
         "collapsed": true,
         "gridPos": {
            "h": 1,
            "w": 24,
            "x": 0,
            "y": 0
         },
         "id": 14,
         "panels": [
            {
               "aliasColors": { },
               "bars": false,
               "dashLength": 10,
               "dashes": false,
               "datasource": "${DS_TEST-CLUSTER}",
               "description": "The time cost of parsing SQL to AST",
               "fill": 1,
               "fillGradient": 0,
               "gridPos": {
                  "h": 6,
                  "w": 12,
                  "x": 0,
                  "y": 0
               },
               "id": 15,
               "legend": {
                  "alignAsTable": false,
                  "avg": false,
                  "current": false,
                  "max": false,
                  "min": false,
                  "rightSide": true,
                  "show": true,
                  "sideWidth": null,
                  "total": false,
                  "values": false
               },
               "lines": true,
               "linewidth": 1,
               "links": [ ],
               "nullPointMode": "null",
               "percentage": false,
               "pointradius": 5,
               "points": false,
               "renderer": "flot",
               "repeat": null,
               "seriesOverrides": [ ],
               "spaceLength": 10,
               "stack": false,
               "steppedLine": false,
               "targets": [
                  {
                     "expr": "histogram_quantile(0.99, sum(rate(tidb_session_parse_duration_seconds_bucket{k8s_cluster=\"$k8s_cluster\", tidb_cluster=\"$tidb_cluster\", instance=~\"$instance\", sql_type=\"general\"}[1m])) by (le))",
                     "format": "time_series",
                     "intervalFactor": 2,
                     "legendFormat": "99",
                     "refId": "A"
                  },
                  {
                     "expr": "histogram_quantile(0.95, sum(rate(tidb_session_parse_duration_seconds_bucket{k8s_cluster=\"$k8s_cluster\", tidb_cluster=\"$tidb_cluster\", instance=~\"$instance\", sql_type=\"general\"}[1m])) by (le))",
                     "format": "time_series",
                     "intervalFactor": 2,
                     "legendFormat": "95",
                     "refId": "B"
                  }
               ],
               "thresholds": [ ],
               "timeFrom": null,
               "timeShift": null,
               "title": "Parse Duration",
               "tooltip": {
                  "shared": true,
                  "sort": 0,
                  "value_type": "individual"
               },
               "type": "graph",
               "xaxis": {
                  "buckets": null,
                  "mode": "time",
                  "name": null,
                  "show": true,
                  "values": [ ]
               },
               "yaxes": [
                  {
                     "format": "s",
                     "label": null,
                     "logBase": 1,
                     "max": null,
                     "min": null,
                     "show": true
                  },
                  {
                     "format": "s",
                     "label": null,
                     "logBase": 1,
                     "max": null,
                     "min": null,
                     "show": true
                  }
               ]
            },
            {
               "aliasColors": { },
               "bars": false,
               "dashLength": 10,
               "dashes": false,
               "datasource": "${DS_TEST-CLUSTER}",
               "description": "The time cost of building the query plan",
               "fill": 1,
               "fillGradient": 0,
               "gridPos": {
                  "h": 6,
                  "w": 12,
                  "x": 12,
                  "y": 0
               },
               "id": 16,
               "legend": {
                  "alignAsTable": false,
                  "avg": false,
                  "current": false,
                  "max": false,
                  "min": false,
                  "rightSide": true,
                  "show": true,
                  "sideWidth": null,
                  "total": false,
                  "values": false
               },
               "lines": true,
               "linewidth": 1,
               "links": [ ],
               "nullPointMode": "null",
               "percentage": false,
               "pointradius": 5,
               "points": false,
               "renderer": "flot",
               "repeat": null,
               "seriesOverrides": [ ],
               "spaceLength": 10,
               "stack": false,
               "steppedLine": false,
               "targets": [
                  {
                     "expr": "histogram_quantile(0.99, sum(rate(tidb_session_compile_duration_seconds_bucket{k8s_cluster=\"$k8s_cluster\", tidb_cluster=\"$tidb_cluster\", instance=~\"$instance\", sql_type=\"general\"}[1m])) by (le))",
                     "format": "time_series",
                     "intervalFactor": 2,
                     "legendFormat": "99",
                     "refId": "A"
                  },
                  {
                     "expr": "histogram_quantile(0.95, sum(rate(tidb_session_compile_duration_seconds_bucket{k8s_cluster=\"$k8s_cluster\", tidb_cluster=\"$tidb_cluster\", instance=~\"$instance\", sql_type=\"general\"}[1m])) by (le))",
                     "format": "time_series",
                     "intervalFactor": 2,
                     "legendFormat": "95",
                     "refId": "B"
                  }
               ],
               "thresholds": [ ],
               "timeFrom": null,
               "timeShift": null,
               "title": "Compile Duration",
               "tooltip": {
                  "shared": true,
                  "sort": 0,
                  "value_type": "individual"
               },
               "type": "graph",
               "xaxis": {
                  "buckets": null,
                  "mode": "time",
                  "name": null,
                  "show": true,
                  "values": [ ]
               },
               "yaxes": [
                  {
                     "format": "s",
                     "label": null,
                     "logBase": 1,
                     "max": null,
                     "min": null,
                     "show": true
                  },
                  {
                     "format": "s",
                     "label": null,
                     "logBase": 1,
                     "max": null,
                     "min": null,
                     "show": true
                  }
               ]
            },
            {
               "aliasColors": { },
               "bars": false,
               "dashLength": 10,
               "dashes": false,
               "datasource": "${DS_TEST-CLUSTER}",
               "description": "The time cost of executing the SQL which does not include the time to get the results of the query.",
               "fill": 1,
               "fillGradient": 0,
               "gridPos": {
                  "h": 6,
                  "w": 12,
                  "x": 0,
                  "y": 0
               },
               "id": 17,
               "legend": {
                  "alignAsTable": false,
                  "avg": false,
                  "current": false,
                  "max": false,
                  "min": false,
                  "rightSide": true,
                  "show": true,
                  "sideWidth": null,
                  "total": false,
                  "values": false
               },
               "lines": true,
               "linewidth": 1,
               "links": [ ],
               "nullPointMode": "null",
               "percentage": false,
               "pointradius": 5,
               "points": false,
               "renderer": "flot",
               "repeat": null,
               "seriesOverrides": [ ],
               "spaceLength": 10,
               "stack": false,
               "steppedLine": false,
               "targets": [
                  {
                     "expr": "histogram_quantile(0.99, sum(rate(tidb_session_execute_duration_seconds_bucket{k8s_cluster=\"$k8s_cluster\", tidb_cluster=\"$tidb_cluster\", instance=~\"$instance\", sql_type=\"general\"}[1m])) by (le))",
                     "format": "time_series",
                     "intervalFactor": 2,
                     "legendFormat": "99",
                     "refId": "A"
                  },
                  {
                     "expr": "histogram_quantile(0.95, sum(rate(tidb_session_execute_duration_seconds_bucket{k8s_cluster=\"$k8s_cluster\", tidb_cluster=\"$tidb_cluster\", instance=~\"$instance\", sql_type=\"general\"}[1m])) by (le))",
                     "format": "time_series",
                     "intervalFactor": 2,
                     "legendFormat": "95",
                     "refId": "B"
                  }
               ],
               "thresholds": [ ],
               "timeFrom": null,
               "timeShift": null,
               "title": "Execution Duration",
               "tooltip": {
                  "shared": true,
                  "sort": 0,
                  "value_type": "individual"
               },
               "type": "graph",
               "xaxis": {
                  "buckets": null,
                  "mode": "time",
                  "name": null,
                  "show": true,
                  "values": [ ]
               },
               "yaxes": [
                  {
                     "format": "s",
                     "label": null,
                     "logBase": 1,
                     "max": null,
                     "min": null,
                     "show": true
                  },
                  {
                     "format": "s",
                     "label": null,
                     "logBase": 1,
                     "max": null,
                     "min": null,
                     "show": true
                  }
               ]
            },
            {
               "aliasColors": { },
               "bars": false,
               "dashLength": 10,
               "dashes": false,
               "datasource": "${DS_TEST-CLUSTER}",
               "description": "TiDB plan cache hit total.",
               "fill": 1,
               "fillGradient": 0,
               "gridPos": {
                  "h": 6,
                  "w": 12,
                  "x": 12,
                  "y": 0
               },
               "id": 18,
               "legend": {
                  "alignAsTable": false,
                  "avg": false,
                  "current": false,
                  "max": false,
                  "min": false,
                  "rightSide": true,
                  "show": true,
                  "sideWidth": null,
                  "total": false,
                  "values": false
               },
               "lines": true,
               "linewidth": 1,
               "links": [ ],
               "nullPointMode": "null",
               "percentage": false,
               "pointradius": 5,
               "points": false,
               "renderer": "flot",
               "repeat": null,
               "seriesOverrides": [ ],
               "spaceLength": 10,
               "stack": false,
               "steppedLine": false,
               "targets": [
                  {
                     "expr": "sum(rate(tidb_server_plan_cache_total{k8s_cluster=\"$k8s_cluster\", tidb_cluster=\"$tidb_cluster\", instance=~\"$instance\"}[1m])) by (type)",
                     "format": "time_series",
                     "intervalFactor": 2,
                     "legendFormat": "{{type}}",
                     "refId": "A"
                  }
               ],
               "thresholds": [ ],
               "timeFrom": null,
               "timeShift": null,
               "title": "Queries Using Plan Cache OPS",
               "tooltip": {
                  "shared": true,
                  "sort": 0,
                  "value_type": "individual"
               },
               "type": "graph",
               "xaxis": {
                  "buckets": null,
                  "mode": "time",
                  "name": null,
                  "show": true,
                  "values": [ ]
               },
               "yaxes": [
                  {
                     "format": "short",
                     "label": null,
                     "logBase": 1,
                     "max": null,
                     "min": null,
                     "show": true
                  },
                  {
                     "format": "short",
                     "label": null,
                     "logBase": 1,
                     "max": null,
                     "min": null,
                     "show": true
                  }
               ]
            }
         ],
         "repeat": null,
         "repeatIteration": null,
         "repeatRowId": null,
         "showTitle": true,
         "title": "Query Detail",
         "titleSize": "h6",
         "type": "row"
      },
      {
         "collapse": true,
         "collapsed": true,
         "gridPos": {
            "h": 1,
            "w": 24,
            "x": 0,
            "y": 0
         },
         "id": 19,
         "panels": [
            {
               "aliasColors": { },
               "bars": false,
               "dashLength": 10,
               "dashes": false,
               "datasource": "${DS_TEST-CLUSTER}",
               "description": "TiDB transaction processing counts by type.",
               "fill": 1,
               "fillGradient": 0,
               "gridPos": {
                  "h": 6,
                  "w": 12,
                  "x": 0,
                  "y": 0
               },
               "id": 20,
               "legend": {
                  "alignAsTable": false,
                  "avg": false,
                  "current": false,
                  "max": false,
                  "min": false,
                  "rightSide": true,
                  "show": true,
                  "sideWidth": null,
                  "total": false,
                  "values": false
               },
               "lines": true,
               "linewidth": 1,
               "links": [ ],
               "nullPointMode": "null",
               "percentage": false,
               "pointradius": 5,
               "points": false,
               "renderer": "flot",
               "repeat": null,
               "seriesOverrides": [ ],
               "spaceLength": 10,
               "stack": false,
               "steppedLine": false,
               "targets": [
                  {
                     "expr": "sum(rate(tidb_session_transaction_duration_seconds_count{k8s_cluster=\"$k8s_cluster\", tidb_cluster=\"$tidb_cluster\", instance=~\"$instance\"}[1m])) by (type, txn_mode)",
                     "format": "time_series",
                     "intervalFactor": 2,
                     "legendFormat": "{{type}}-{{txn_mode}}",
                     "refId": "A"
                  }
               ],
               "thresholds": [ ],
               "timeFrom": null,
               "timeShift": null,
               "title": "TPS",
               "tooltip": {
                  "shared": true,
                  "sort": 0,
                  "value_type": "individual"
               },
               "type": "graph",
               "xaxis": {
                  "buckets": null,
                  "mode": "time",
                  "name": null,
                  "show": true,
                  "values": [ ]
               },
               "yaxes": [
                  {
                     "format": "short",
                     "label": null,
                     "logBase": 1,
                     "max": null,
                     "min": null,
                     "show": true
                  },
                  {
                     "format": "short",
                     "label": null,
                     "logBase": 1,
                     "max": null,
                     "min": null,
                     "show": true
                  }
               ]
            },
            {
               "aliasColors": { },
               "bars": false,
               "dashLength": 10,
               "dashes": false,
               "datasource": "${DS_TEST-CLUSTER}",
               "description": "Bucketed histogram of transaction execution durations, including retry.",
               "fill": 1,
               "fillGradient": 0,
               "gridPos": {
                  "h": 6,
                  "w": 12,
                  "x": 12,
                  "y": 0
               },
               "id": 21,
               "legend": {
                  "alignAsTable": false,
                  "avg": false,
                  "current": false,
                  "max": false,
                  "min": false,
                  "rightSide": true,
                  "show": true,
                  "sideWidth": null,
                  "total": false,
                  "values": false
               },
               "lines": true,
               "linewidth": 1,
               "links": [ ],
               "nullPointMode": "null",
               "percentage": false,
               "pointradius": 5,
               "points": false,
               "renderer": "flot",
               "repeat": null,
               "seriesOverrides": [ ],
               "spaceLength": 10,
               "stack": false,
               "steppedLine": false,
               "targets": [
                  {
                     "expr": "histogram_quantile(0.99, sum(rate(tidb_session_transaction_duration_seconds_bucket{k8s_cluster=\"$k8s_cluster\", tidb_cluster=\"$tidb_cluster\", instance=~\"$instance\", sql_type=\"general\"}[1m])) by (le, txn_mode))",
                     "format": "time_series",
                     "intervalFactor": 2,
                     "legendFormat": "99-{{txn_mode}}",
                     "refId": "A"
                  },
                  {
                     "expr": "histogram_quantile(0.95, sum(rate(tidb_session_transaction_duration_seconds_bucket{k8s_cluster=\"$k8s_cluster\", tidb_cluster=\"$tidb_cluster\", instance=~\"$instance\", sql_type=\"general\"}[1m])) by (le, txn_mode))",
                     "format": "time_series",
                     "intervalFactor": 2,
                     "legendFormat": "95-{{txn_mode}}",
                     "refId": "B"
                  },
                  {
                     "expr": "histogram_quantile(0.80, sum(rate(tidb_session_transaction_duration_seconds_bucket{k8s_cluster=\"$k8s_cluster\", tidb_cluster=\"$tidb_cluster\", instance=~\"$instance\", sql_type=\"general\"}[1m])) by (le, txn_mode))",
                     "format": "time_series",
                     "intervalFactor": 2,
                     "legendFormat": "80-{{txn_mode}}",
                     "refId": "C"
                  }
               ],
               "thresholds": [ ],
               "timeFrom": null,
               "timeShift": null,
               "title": "Transaction Duration",
               "tooltip": {
                  "shared": true,
                  "sort": 0,
                  "value_type": "individual"
               },
               "type": "graph",
               "xaxis": {
                  "buckets": null,
                  "mode": "time",
                  "name": null,
                  "show": true,
                  "values": [ ]
               },
               "yaxes": [
                  {
                     "format": "s",
                     "label": null,
                     "logBase": 1,
                     "max": null,
                     "min": null,
                     "show": true
                  },
                  {
                     "format": "s",
                     "label": null,
                     "logBase": 1,
                     "max": null,
                     "min": null,
                     "show": true
                  }
               ]
            },
            {
               "aliasColors": { },
               "bars": false,
               "dashLength": 10,
               "dashes": false,
               "datasource": "${DS_TEST-CLUSTER}",
               "description": "The max TiDB statements numbers within one transaction.",
               "fill": 1,
               "fillGradient": 0,
               "gridPos": {
                  "h": 6,
                  "w": 12,
                  "x": 0,
                  "y": 0
               },
               "id": 22,
               "legend": {
                  "alignAsTable": false,
                  "avg": false,
                  "current": false,
                  "max": false,
                  "min": false,
                  "rightSide": true,
                  "show": true,
                  "sideWidth": null,
                  "total": false,
                  "values": false
               },
               "lines": true,
               "linewidth": 1,
               "links": [ ],
               "nullPointMode": "null",
               "percentage": false,
               "pointradius": 5,
               "points": false,
               "renderer": "flot",
               "repeat": null,
               "seriesOverrides": [ ],
               "spaceLength": 10,
               "stack": false,
               "steppedLine": false,
               "targets": [
                  {
                     "expr": "histogram_quantile(1, sum(rate(tidb_session_transaction_statement_num_bucket{k8s_cluster=\"$k8s_cluster\", tidb_cluster=\"$tidb_cluster\", instance=~\"$instance\"}[30s])) by (le))",
                     "format": "time_series",
                     "intervalFactor": 2,
                     "legendFormat": "max",
                     "refId": "A"
                  }
               ],
               "thresholds": [ ],
               "timeFrom": null,
               "timeShift": null,
               "title": "Max Transaction Statement Num",
               "tooltip": {
                  "shared": true,
                  "sort": 0,
                  "value_type": "individual"
               },
               "type": "graph",
               "xaxis": {
                  "buckets": null,
                  "mode": "time",
                  "name": null,
                  "show": true,
                  "values": [ ]
               },
               "yaxes": [
                  {
                     "format": "short",
                     "label": null,
                     "logBase": 1,
                     "max": null,
                     "min": null,
                     "show": true
                  },
                  {
                     "format": "short",
                     "label": null,
                     "logBase": 1,
                     "max": null,
                     "min": null,
                     "show": true
                  }
               ]
            },
            {
               "aliasColors": { },
               "bars": false,
               "dashLength": 10,
               "dashes": false,
               "datasource": "${DS_TEST-CLUSTER}",
               "description": "The max TiDB transaction retry count.",
               "fill": 1,
               "fillGradient": 0,
               "gridPos": {
                  "h": 6,
                  "w": 12,
                  "x": 12,
                  "y": 0
               },
               "id": 23,
               "legend": {
                  "alignAsTable": false,
                  "avg": false,
                  "current": false,
                  "max": false,
                  "min": false,
                  "rightSide": true,
                  "show": true,
                  "sideWidth": null,
                  "total": false,
                  "values": false
               },
               "lines": true,
               "linewidth": 1,
               "links": [ ],
               "nullPointMode": "null",
               "percentage": false,
               "pointradius": 5,
               "points": false,
               "renderer": "flot",
               "repeat": null,
               "seriesOverrides": [ ],
               "spaceLength": 10,
               "stack": false,
               "steppedLine": false,
               "targets": [
                  {
                     "expr": "histogram_quantile(1.0, sum(rate(tidb_session_retry_num_bucket{k8s_cluster=\"$k8s_cluster\", tidb_cluster=\"$tidb_cluster\", instance=~\"$instance\"}[30s])) by (le))",
                     "format": "time_series",
                     "intervalFactor": 2,
                     "legendFormat": "max",
                     "refId": "A"
                  }
               ],
               "thresholds": [ ],
               "timeFrom": null,
               "timeShift": null,
               "title": "Max Transaction Retry Num",
               "tooltip": {
                  "shared": true,
                  "sort": 0,
                  "value_type": "individual"
               },
               "type": "graph",
               "xaxis": {
                  "buckets": null,
                  "mode": "time",
                  "name": null,
                  "show": true,
                  "values": [ ]
               },
               "yaxes": [
                  {
                     "format": "short",
                     "label": null,
                     "logBase": 1,
                     "max": null,
                     "min": null,
                     "show": true
                  },
                  {
                     "format": "short",
                     "label": null,
                     "logBase": 1,
                     "max": null,
                     "min": null,
                     "show": true
                  }
               ]
            }
         ],
         "repeat": null,
         "repeatIteration": null,
         "repeatRowId": null,
         "showTitle": true,
         "title": "Transaction",
         "titleSize": "h6",
         "type": "row"
      }
   ],
   "refresh": "30s",
   "rows": [ ],
   "schemaVersion": 14,
   "style": "dark",
   "tags": [ ],
   "templating": {
      "list": [
         {
            "allValue": null,
            "current": { },
            "datasource": "${DS_TEST-CLUSTER}",
            "hide": 2,
            "includeAll": false,
            "label": "K8s-cluster",
            "multi": false,
            "name": "k8s_cluster",
            "options": [ ],
            "query": "label_values(pd_cluster_status, k8s_cluster)",
            "refresh": 2,
            "regex": "",
            "sort": 1,
            "tagValuesQuery": "",
            "tags": [ ],
            "tagsQuery": "",
            "type": "query",
            "useTags": false
         },
         {
            "allValue": null,
            "current": { },
            "datasource": "${DS_TEST-CLUSTER}",
            "hide": 2,
            "includeAll": false,
            "label": "tidb_cluster",
            "multi": false,
            "name": "tidb_cluster",
            "options": [ ],
            "query": "label_values(pd_cluster_status{k8s_cluster=\"$kuberentes\"}, tidb_cluster)",
            "refresh": 2,
            "regex": "",
            "sort": 1,
            "tagValuesQuery": "",
            "tags": [ ],
            "tagsQuery": "",
            "type": "query",
            "useTags": false
         },
         {
            "allValue": ".*",
            "current": { },
            "datasource": "${DS_TEST-CLUSTER}",
            "hide": 0,
            "includeAll": true,
            "label": "Instance",
            "multi": false,
            "name": "instance",
            "options": [ ],
            "query": "label_values(tidb_server_connections{k8s_cluster=\"$k8s_cluster\", tidb_cluster=\"$tidb_cluster\"}, instance)",
            "refresh": 1,
            "regex": "",
            "sort": 1,
            "tagValuesQuery": "",
            "tags": [ ],
            "tagsQuery": "",
            "type": "query",
            "useTags": false
         }
      ]
   },
   "time": {
      "from": "now-1h",
      "to": "now"
   },
   "timepicker": {
      "refresh_intervals": [
         "5s",
         "10s",
         "30s",
         "1m",
         "5m",
         "15m",
         "30m",
         "1h",
         "2h",
         "1d"
      ],
      "time_options": [
         "5m",
         "15m",
         "1h",
         "6h",
         "12h",
         "24h",
         "2d",
         "7d",
         "30d"
      ]
   },
   "timezone": "browser",
   "title": "Test-Cluster-TiDB-Summary",
   "version": 0
}
