Grafana dashboard: Sandwich Monitor

#### Revision >= 6 是适配cicd版的面板  
- ark_requests_total: 对使用sandwich packet的http请求计数 Count  
- ark_plain_requests_total: 对没使用sandwich packet的http请求计数 Count 
- link_requests_total: 对使用sandwich packet的TCP请求计数 Count 
- sandwich_dispatch_remote_duration_seconds: 对远程调用URI计时 Timing  
- sandwich_dispatch_local_duration_second: 对本地调用URI计时 Timing  


{
  "__inputs": [
    {
      "name": "DS_LOCAL",
      "label": "local",
      "description": "",
      "type": "datasource",
      "pluginId": "prometheus",
      "pluginName": "Prometheus"
    }
  ],
  "__requires": [
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "7.3.7"
    },
    {
      "type": "panel",
      "id": "graph",
      "name": "Graph",
      "version": ""
    },
    {
      "type": "datasource",
      "id": "prometheus",
      "name": "Prometheus",
      "version": "1.0.0"
    }
  ],
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      },
      {
        "datasource": "-- Grafana --",
        "enable": true,
        "expr": "",
        "iconColor": "rgba(0, 211, 255, 1)",
        "iconSize": 0,
        "lineColor": "",
        "name": "Annotations & Alerts",
        "query": "",
        "showLine": false,
        "step": "",
        "tagKeys": "",
        "tags": null,
        "tagsField": "",
        "textField": "",
        "textFormat": "",
        "titleFormat": "",
        "type": "dashboard"
      },
      {
        "datasource": "-- Grafana --",
        "enable": true,
        "expr": "",
        "iconColor": "rgba(0, 211, 255, 1)",
        "iconSize": 0,
        "lineColor": "",
        "name": "Annotations & Alerts",
        "query": "",
        "showLine": false,
        "step": "",
        "tagKeys": "",
        "tags": null,
        "tagsField": "",
        "textField": "",
        "textFormat": "",
        "titleFormat": "",
        "type": "dashboard"
      }
    ]
  },
  "editable": true,
  "gnetId": 13458,
  "graphTooltip": 0,
  "id": null,
  "iteration": 1618317070877,
  "links": [],
  "panels": [
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "$datasource",
      "editable": false,
      "error": false,
      "fieldConfig": {
        "defaults": {
          "custom": {}
        },
        "overrides": []
      },
      "fill": 0,
      "fillGradient": 0,
      "gridPos": {
        "h": 12,
        "w": 12,
        "x": 0,
        "y": 0
      },
      "hiddenSeries": false,
      "id": 8,
      "isNew": false,
      "legend": {
        "alignAsTable": false,
        "avg": false,
        "current": false,
        "hideEmpty": false,
        "hideZero": false,
        "max": false,
        "min": false,
        "rightSide": false,
        "show": true,
        "total": false,
        "values": false
      },
      "lines": true,
      "linewidth": 1,
      "nullPointMode": "null",
      "options": {
        "alertThreshold": true
      },
      "percentage": false,
      "pluginVersion": "7.3.7",
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "span": 0,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "expr": "sandwich_dispatch_local_duration_seconds{job=\"$job\", project=\"$project\", env_name=\"$env\", uri=\"$uri\", stage=\"$stage\"}",
          "interval": "",
          "intervalFactor": 2,
          "legendFormat": "{{instance}}, quantile={{quantile}}, {{uri}}",
          "refId": "A"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "Dispatch Local Latency",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "format": "",
        "logBase": 0,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "short",
          "logBase": 1,
          "show": true
        },
        {
          "format": "short",
          "logBase": 1,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "$datasource",
      "editable": false,
      "error": false,
      "fieldConfig": {
        "defaults": {
          "custom": {}
        },
        "overrides": []
      },
      "fill": 1,
      "fillGradient": 0,
      "gridPos": {
        "h": 12,
        "w": 12,
        "x": 12,
        "y": 0
      },
      "hiddenSeries": false,
      "id": 4,
      "isNew": false,
      "legend": {
        "alignAsTable": false,
        "avg": false,
        "current": false,
        "hideEmpty": false,
        "hideZero": false,
        "max": false,
        "min": false,
        "rightSide": false,
        "show": true,
        "total": false,
        "values": false
      },
      "lines": true,
      "linewidth": 1,
      "nullPointMode": "null",
      "options": {
        "alertThreshold": true
      },
      "percentage": false,
      "pluginVersion": "7.3.7",
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "span": 0,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "expr": "rate(ark_requests_total{status=\"error\", job=\"$job\", project=\"$project\", env_name=\"$env\", stage=\"$stage\"}[5m])",
          "interval": "",
          "intervalFactor": 1,
          "legendFormat": "{{instance}}, status={{status}}, {{stage}}",
          "refId": "A"
        },
        {
          "expr": "rate(ark_requests_total{status=\"ok\", job=\"$job\", project=\"$project\", env_name=\"$env\", stage=\"$stage\"}[5m])",
          "interval": "",
          "intervalFactor": 1,
          "legendFormat": "{{instance}}, status={{status}}, {{stage}}",
          "refId": "B"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "Ark Request QPS",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "format": "",
        "logBase": 0,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "short",
          "logBase": 1,
          "show": true
        },
        {
          "format": "short",
          "logBase": 1,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "$datasource",
      "editable": false,
      "error": false,
      "fieldConfig": {
        "defaults": {
          "custom": {}
        },
        "overrides": []
      },
      "fill": 1,
      "fillGradient": 0,
      "gridPos": {
        "h": 9,
        "w": 12,
        "x": 0,
        "y": 12
      },
      "hiddenSeries": false,
      "id": 3,
      "isNew": false,
      "legend": {
        "alignAsTable": false,
        "avg": false,
        "current": false,
        "hideEmpty": false,
        "hideZero": false,
        "max": false,
        "min": false,
        "rightSide": false,
        "show": true,
        "total": false,
        "values": false
      },
      "lines": true,
      "linewidth": 1,
      "nullPointMode": "null",
      "options": {
        "alertThreshold": true
      },
      "percentage": false,
      "pluginVersion": "7.3.7",
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "span": 0,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "expr": "rate(ark_plain_requests_total{status=\"error\", job=\"$job\", project=\"$project\", env_name=\"$env\", stage=\"$stage\"}[5m])",
          "interval": "",
          "intervalFactor": 1,
          "legendFormat": "",
          "refId": "A"
        },
        {
          "expr": "rate(ark_plain_requests_total{status=\"ok\", job=\"$job\", project=\"$project\", env_name=\"$env\", stage=\"$stage\"}[5m])",
          "interval": "",
          "intervalFactor": 1,
          "legendFormat": "",
          "refId": "B"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "Ark Plain Request QPS",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "format": "",
        "logBase": 0,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "short",
          "logBase": 1,
          "show": true
        },
        {
          "format": "short",
          "logBase": 1,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "$datasource",
      "editable": false,
      "error": false,
      "fieldConfig": {
        "defaults": {
          "custom": {}
        },
        "overrides": []
      },
      "fill": 1,
      "fillGradient": 0,
      "gridPos": {
        "h": 12,
        "w": 12,
        "x": 12,
        "y": 12
      },
      "hiddenSeries": false,
      "id": 2,
      "isNew": false,
      "legend": {
        "alignAsTable": false,
        "avg": false,
        "current": false,
        "hideEmpty": false,
        "hideZero": false,
        "max": false,
        "min": false,
        "rightSide": false,
        "show": true,
        "total": false,
        "values": false
      },
      "lines": true,
      "linewidth": 1,
      "nullPointMode": "null",
      "options": {
        "alertThreshold": true
      },
      "percentage": false,
      "pluginVersion": "7.3.7",
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "span": 0,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "expr": "rate(link_requests_total{status=\"error\", job=\"$job\", project=\"$project\", env_name=\"$env\", stage=\"$stage\"}[5m])",
          "interval": "",
          "intervalFactor": 1,
          "legendFormat": "",
          "refId": "A"
        },
        {
          "expr": "rate(link_requests_total{status=\"ok\", job=\"$job\", project=\"$project\", env_name=\"$env\", stage=\"$stage\"}[5m])",
          "interval": "",
          "intervalFactor": 1,
          "legendFormat": "",
          "refId": "B"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "Link Request QPS",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "format": "",
        "logBase": 0,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "short",
          "logBase": 1,
          "show": true
        },
        {
          "format": "short",
          "logBase": 1,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "$datasource",
      "editable": false,
      "error": false,
      "fieldConfig": {
        "defaults": {
          "custom": {}
        },
        "overrides": []
      },
      "fill": 0,
      "fillGradient": 0,
      "gridPos": {
        "h": 12,
        "w": 12,
        "x": 0,
        "y": 21
      },
      "hiddenSeries": false,
      "id": 6,
      "isNew": false,
      "legend": {
        "alignAsTable": false,
        "avg": false,
        "current": false,
        "hideEmpty": false,
        "hideZero": false,
        "max": false,
        "min": false,
        "rightSide": false,
        "show": true,
        "total": false,
        "values": false
      },
      "lines": true,
      "linewidth": 1,
      "nullPointMode": "null",
      "options": {
        "alertThreshold": true
      },
      "percentage": false,
      "pluginVersion": "7.3.7",
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "span": 0,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "expr": "sandwich_dispatch_remote_duration_seconds{job=\"$job\", project=\"$project\", uri=\"$uri\", env_name=\"$env\", stage=\"$stage\"}",
          "format": "time_series",
          "interval": "",
          "intervalFactor": 2,
          "legendFormat": "",
          "refId": "A"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "Dispatch Remote Latency",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "format": "",
        "logBase": 0,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "short",
          "logBase": 1,
          "show": true
        },
        {
          "format": "short",
          "logBase": 1,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_LOCAL}",
      "fieldConfig": {
        "defaults": {
          "custom": {}
        },
        "overrides": []
      },
      "fill": 1,
      "fillGradient": 0,
      "gridPos": {
        "h": 12,
        "w": 24,
        "x": 0,
        "y": 33
      },
      "hiddenSeries": false,
      "id": 10,
      "legend": {
        "alignAsTable": true,
        "avg": false,
        "current": false,
        "max": true,
        "min": false,
        "show": true,
        "sort": "max",
        "sortDesc": true,
        "total": false,
        "values": true
      },
      "lines": true,
      "linewidth": 1,
      "nullPointMode": "null",
      "options": {
        "alertThreshold": true
      },
      "percentage": false,
      "pluginVersion": "7.3.7",
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "expr": "topk(10, max by(uri) (sandwich_dispatch_local_duration_seconds{job=\"$job\", env_name=\"$env\", project=\"$project\", stage=\"$stage\"})*1000)",
          "interval": "",
          "legendFormat": "",
          "refId": "A"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "Top 10 Slowest Local Uri",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "$$hashKey": "object:96",
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "$$hashKey": "object:97",
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    }
  ],
  "refresh": false,
  "schemaVersion": 26,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": [
      {
        "allFormat": "",
        "allValue": "",
        "current": {
          "selected": false,
          "text": "local",
          "value": "local"
        },
        "datasource": null,
        "error": null,
        "hide": 0,
        "includeAll": false,
        "label": "",
        "multi": false,
        "multiFormat": "",
        "name": "datasource",
        "options": [],
        "query": "prometheus",
        "queryValue": "",
        "refresh": 1,
        "regex": "^(?!default$).*$",
        "skipUrlSync": false,
        "sort": 0,
        "type": "datasource"
      },
      {
        "allFormat": "",
        "allValue": "",
        "current": {},
        "datasource": "$datasource",
        "definition": "label_values(sandwich_dispatch_local_duration_seconds, job)",
        "error": null,
        "hide": 2,
        "includeAll": false,
        "label": "job",
        "multi": false,
        "multiFormat": "",
        "name": "job",
        "options": [],
        "query": "label_values(sandwich_dispatch_local_duration_seconds, job)",
        "refresh": 1,
        "regex": "_service_metrics_",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allFormat": "",
        "allValue": "",
        "current": {},
        "datasource": "$datasource",
        "definition": "label_values(sandwich_dispatch_local_duration_seconds{job=\"$job\"}, project)",
        "error": null,
        "hide": 0,
        "includeAll": false,
        "label": "",
        "multi": false,
        "multiFormat": "",
        "name": "project",
        "options": [],
        "query": "label_values(sandwich_dispatch_local_duration_seconds{job=\"$job\"}, project)",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allFormat": "",
        "allValue": "",
        "current": {},
        "datasource": "$datasource",
        "definition": "label_values(sandwich_dispatch_local_duration_seconds{job=\"$job\",  project=\"$project\"}, env_name)",
        "error": null,
        "hide": 0,
        "includeAll": false,
        "label": "",
        "multi": false,
        "multiFormat": "",
        "name": "env",
        "options": [],
        "query": "label_values(sandwich_dispatch_local_duration_seconds{job=\"$job\",  project=\"$project\"}, env_name)",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "$datasource",
        "definition": "label_values(sandwich_dispatch_local_duration_seconds{job=\"$job\", project=\"$project\"}, stage)",
        "error": null,
        "hide": 0,
        "includeAll": false,
        "label": null,
        "multi": false,
        "name": "stage",
        "options": [],
        "query": "label_values(sandwich_dispatch_local_duration_seconds{job=\"$job\", project=\"$project\"}, stage)",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allFormat": "",
        "allValue": "",
        "current": {},
        "datasource": "$datasource",
        "definition": "label_values(sandwich_dispatch_local_duration_seconds{job=\"$job\", project=\"$project\"}, uri)",
        "error": null,
        "hide": 0,
        "includeAll": false,
        "label": "uri",
        "multi": false,
        "multiFormat": "",
        "name": "uri",
        "options": [],
        "query": "label_values(sandwich_dispatch_local_duration_seconds{job=\"$job\", project=\"$project\"}, uri)",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      }
    ]
  },
  "time": {
    "from": "now-6h",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ],
    "time_options": null
  },
  "timezone": "",
  "title": "Sandwich Monitor",
  "uid": "6QbtdRoGk",
  "version": 6
}