Grafana dashboard: MySQL Query Performance Troubleshooting (Designed for PMM2)
Description: This dashboards allows you to troubleshoot queries which are heavy on system resources CPU,  Disk, Network, Memory or which cause extensive Locking on the database level


{
  "__inputs": [
    {
      "name": "DS_PROMETHEUS",
      "label": "Prometheus",
      "description": "",
      "type": "datasource",
      "pluginId": "prometheus",
      "pluginName": "Prometheus"
    },
    {
      "name": "DS_CLICKHOUSE",
      "label": "ClickHouse",
      "description": "",
      "type": "datasource",
      "pluginId": "vertamedia-clickhouse-datasource",
      "pluginName": "ClickHouse"
    }
  ],
  "__requires": [
    {
      "type": "panel",
      "id": "digiapulssi-breadcrumb-panel",
      "name": "Breadcrumb",
      "version": "1.1.6"
    },
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "6.7.4"
    },
    {
      "type": "panel",
      "id": "graph",
      "name": "Graph",
      "version": ""
    },
    {
      "type": "datasource",
      "id": "prometheus",
      "name": "Prometheus",
      "version": "1.0.0"
    },
    {
      "type": "panel",
      "id": "singlestat",
      "name": "Singlestat",
      "version": ""
    },
    {
      "type": "panel",
      "id": "table",
      "name": "Table",
      "version": ""
    },
    {
      "type": "panel",
      "id": "text",
      "name": "Text",
      "version": ""
    },
    {
      "type": "datasource",
      "id": "vertamedia-clickhouse-datasource",
      "name": "ClickHouse",
      "version": "1.9.5"
    }
  ],
  "annotations": {
    "list": [
      {
        "$$hashKey": "object:63",
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": false,
        "iconColor": "#e0752d",
        "limit": 100,
        "matchAny": true,
        "name": "PMM Annotations",
        "showIn": 0,
        "tags": [
          "pmm_annotation",
          "$node_name",
          "$service_name"
        ],
        "type": "tags"
      },
      {
        "$$hashKey": "object:64",
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": true,
        "iconColor": "#6ed0e0",
        "limit": 100,
        "name": "Annotations & Alerts",
        "showIn": 0,
        "tags": [],
        "type": "dashboard"
      }
    ]
  },
  "editable": true,
  "gnetId": 12630,
  "graphTooltip": 1,
  "id": null,
  "iteration": 1594587449117,
  "links": [
    {
      "icon": "doc",
      "includeVars": true,
      "keepTime": true,
      "tags": [
        "Home"
      ],
      "targetBlank": false,
      "title": "Home",
      "type": "link",
      "url": "/graph/d/pmm-home/home-dashboard"
    },
    {
      "icon": "dashboard",
      "includeVars": true,
      "keepTime": true,
      "tags": [
        "Query Analytics"
      ],
      "targetBlank": false,
      "title": "Query Analytics",
      "type": "link",
      "url": "/graph/d/pmm-qan/pmm-query-analytics"
    },
    {
      "icon": "bolt",
      "includeVars": true,
      "keepTime": true,
      "tags": [
        "Compare"
      ],
      "targetBlank": false,
      "title": "Compare",
      "type": "link",
      "url": "/graph/d/mysql-instance-compare/mysql-instances-compare"
    },
    {
      "asDropdown": true,
      "includeVars": true,
      "keepTime": true,
      "tags": [
        "MySQL"
      ],
      "targetBlank": false,
      "title": "MySQL",
      "type": "dashboards"
    },
    {
      "asDropdown": true,
      "includeVars": true,
      "keepTime": true,
      "tags": [
        "MySQL_HA"
      ],
      "targetBlank": false,
      "title": "HA",
      "type": "dashboards"
    },
    {
      "asDropdown": true,
      "includeVars": false,
      "keepTime": true,
      "tags": [
        "Services"
      ],
      "targetBlank": false,
      "title": "Services",
      "type": "dashboards"
    },
    {
      "asDropdown": true,
      "includeVars": false,
      "keepTime": true,
      "tags": [
        "PMM"
      ],
      "targetBlank": false,
      "title": "PMM",
      "type": "dashboards"
    }
  ],
  "panels": [
    {
      "breadcrumbItemsMaxAmount": 6,
      "datasource": "${DS_PROMETHEUS}",
      "gridPos": {
        "h": 2,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "hideTextInRootDashboard": false,
      "id": 999,
      "isRootDashboard": false,
      "links": [],
      "targets": [
        {
          "expr": "",
          "format": "time_series",
          "intervalFactor": 1,
          "refId": "A"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": " ",
      "transparent": true,
      "type": "digiapulssi-breadcrumb-panel"
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorPostfix": true,
      "colorValue": true,
      "colors": [
        "rgba(245, 54, 54, 0.9)",
        "rgba(237, 129, 40, 0.89)",
        "rgba(50, 172, 45, 0.97)"
      ],
      "datasource": "${DS_PROMETHEUS}",
      "decimals": 2,
      "description": "The parameter shows how long a system has been “up” and running without a shut down or restart.",
      "editable": true,
      "error": false,
      "format": "s",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 2,
        "w": 3,
        "x": 0,
        "y": 2
      },
      "height": "125px",
      "id": 321,
      "interval": "$interval",
      "links": [],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "postfix": "s",
      "postfixFontSize": "50%",
      "prefix": "",
      "prefixFontSize": "70%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "rgba(31, 118, 189, 0.18)",
        "full": false,
        "lineColor": "rgb(31, 120, 193)",
        "show": false
      },
      "tableColumn": "",
      "targets": [
        {
          "calculatedInterval": "10m",
          "datasourceErrors": {},
          "errors": {},
          "expr": "avg by (node_name) ((node_time_seconds{node_name=~\"$node_name\"} - node_boot_time_seconds{node_name=~\"$node_name\"}) or (time() - node_boot_time_seconds{node_name=~\"$node_name\"}))",
          "format": "time_series",
          "hide": false,
          "interval": "5m",
          "intervalFactor": 1,
          "legendFormat": "",
          "metric": "",
          "refId": "A",
          "step": 300
        }
      ],
      "thresholds": "300,3600",
      "title": "System Uptime",
      "type": "singlestat",
      "valueFontSize": "50%",
      "valueMaps": [],
      "valueName": "current"
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorValue": true,
      "colors": [
        "#299c46",
        "rgba(237, 129, 40, 0.89)",
        "#d44a3a"
      ],
      "datasource": "${DS_PROMETHEUS}",
      "decimals": 2,
      "description": "The system load is a measurement of the computational work the system is performing. Each running process either using or waiting for CPU resources adds 1 to the load.",
      "format": "none",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 2,
        "w": 3,
        "x": 3,
        "y": 2
      },
      "id": 323,
      "interval": null,
      "links": [],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "postfix": "",
      "postfixFontSize": "50%",
      "prefix": "",
      "prefixFontSize": "50%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "rgba(31, 118, 189, 0.18)",
        "full": false,
        "lineColor": "rgb(31, 120, 193)",
        "show": true,
        "ymax": null,
        "ymin": null
      },
      "tableColumn": "",
      "targets": [
        {
          "expr": "avg by (node_name) (avg_over_time(node_load1{node_name=~\"$node_name\"}[$interval]) or avg_over_time(node_load1{node_name=~\"$node_name\"}[5m]))",
          "format": "time_series",
          "interval": "$interval",
          "intervalFactor": 1,
          "refId": "A"
        }
      ],
      "thresholds": "10,20",
      "title": "Load Average",
      "type": "singlestat",
      "valueFontSize": "50%",
      "valueMaps": [
        {
          "op": "=",
          "text": "N/A",
          "value": "null"
        }
      ],
      "valueName": "current"
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorValue": false,
      "colors": [
        "rgba(245, 54, 54, 0.9)",
        "rgba(237, 129, 40, 0.89)",
        "rgba(50, 172, 45, 0.97)"
      ],
      "datasource": "${DS_PROMETHEUS}",
      "decimals": 2,
      "description": "RAM (Random Access Memory) is the hardware in a computing device where the operating system, application programs and data in current use are kept so they can be quickly reached by the device's processor.",
      "editable": true,
      "error": false,
      "format": "bytes",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 2,
        "w": 3,
        "x": 6,
        "y": 2
      },
      "height": "125px",
      "id": 327,
      "interval": "$interval",
      "links": [],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "postfix": "",
      "postfixFontSize": "50%",
      "prefix": "",
      "prefixFontSize": "50%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "rgba(31, 118, 189, 0.18)",
        "full": false,
        "lineColor": "rgb(31, 120, 193)",
        "show": false
      },
      "tableColumn": "",
      "targets": [
        {
          "expr": "avg by (node_name) (node_memory_MemTotal_bytes{node_name=~\"$node_name\"})",
          "format": "time_series",
          "interval": "5m",
          "intervalFactor": 1,
          "refId": "A",
          "step": 300
        }
      ],
      "thresholds": "",
      "title": "RAM",
      "type": "singlestat",
      "valueFontSize": "50%",
      "valueMaps": [
        {
          "op": "=",
          "text": "N/A",
          "value": "null"
        }
      ],
      "valueName": "current"
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorValue": true,
      "colors": [
        "#d44a3a",
        "rgba(237, 129, 40, 0.89)",
        "#299c46"
      ],
      "datasource": "${DS_PROMETHEUS}",
      "decimals": 2,
      "description": "Percent of Memory Available\nNote: on Modern Linux Kernels amount of Memory Available for application is not the same as Free+Cached+Buffers",
      "format": "percent",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 2,
        "w": 3,
        "x": 9,
        "y": 2
      },
      "id": 329,
      "interval": null,
      "links": [],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "postfix": "",
      "postfixFontSize": "50%",
      "prefix": "",
      "prefixFontSize": "50%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "rgba(31, 118, 189, 0.18)",
        "full": false,
        "lineColor": "rgb(31, 120, 193)",
        "show": true,
        "ymax": null,
        "ymin": null
      },
      "tableColumn": "",
      "targets": [
        {
          "expr": "avg by (node_name) ((node_memory_MemAvailable_bytes{node_name=~\"$node_name\"} or (node_memory_MemFree_bytes{node_name=~\"$node_name\"} + node_memory_Buffers_bytes{node_name=~\"$node_name\"} + node_memory_Cached_bytes{node_name=~\"$node_name\"})) / node_memory_MemTotal_bytes{node_name=~\"$node_name\"} * 100)",
          "format": "time_series",
          "interval": "$interval",
          "intervalFactor": 1,
          "refId": "A"
        }
      ],
      "thresholds": "5,10",
      "title": "Memory Available",
      "type": "singlestat",
      "valueFontSize": "50%",
      "valueMaps": [
        {
          "op": "=",
          "text": "N/A",
          "value": "null"
        }
      ],
      "valueName": "current"
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorValue": false,
      "colors": [
        "rgba(245, 54, 54, 0.9)",
        "rgba(237, 129, 40, 0.89)",
        "rgba(50, 172, 45, 0.97)"
      ],
      "datasource": "${DS_PROMETHEUS}",
      "decimals": 2,
      "description": "RAM + SWAP",
      "editable": true,
      "error": false,
      "format": "bytes",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 2,
        "w": 3,
        "x": 12,
        "y": 2
      },
      "height": "125px",
      "id": 331,
      "interval": "$interval",
      "links": [],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "postfix": "",
      "postfixFontSize": "50%",
      "prefix": "",
      "prefixFontSize": "50%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "rgba(31, 118, 189, 0.18)",
        "full": false,
        "lineColor": "rgb(31, 120, 193)",
        "show": false
      },
      "tableColumn": "",
      "targets": [
        {
          "expr": "avg by (node_name) (node_memory_MemTotal_bytes{node_name=~\"$node_name\"}+node_memory_SwapTotal_bytes{node_name=~\"$node_name\"})",
          "format": "time_series",
          "interval": "5m",
          "intervalFactor": 1,
          "refId": "A",
          "step": 300
        }
      ],
      "thresholds": "",
      "title": "Virtual Memory",
      "type": "singlestat",
      "valueFontSize": "50%",
      "valueMaps": [
        {
          "op": "=",
          "text": "N/A",
          "value": "null"
        }
      ],
      "valueName": "current"
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorValue": false,
      "colors": [
        "rgba(245, 54, 54, 0.9)",
        "rgba(237, 129, 40, 0.89)",
        "rgba(50, 172, 45, 0.97)"
      ],
      "datasource": "${DS_PROMETHEUS}",
      "decimals": 2,
      "description": "Sum of disk space on all partitions. Note  it can be significantly over-reported in some installations",
      "editable": true,
      "error": false,
      "format": "bytes",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 2,
        "w": 3,
        "x": 15,
        "y": 2
      },
      "height": "125px",
      "id": 333,
      "interval": "$interval",
      "links": [
        {
          "targetBlank": true,
          "title": "Disk Space",
          "url": "/graph/d/node-disk/disk-details?$__url_time_range&$__all_variables"
        }
      ],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "postfix": "",
      "postfixFontSize": "50%",
      "prefix": "",
      "prefixFontSize": "80%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "rgba(31, 118, 189, 0.18)",
        "full": false,
        "lineColor": "rgb(31, 120, 193)",
        "show": false
      },
      "tableColumn": "",
      "targets": [
        {
          "expr": "avg by (node_name) (sum(avg(node_filesystem_size_bytes{node_name=~\"$node_name\",fstype=~\"(ext.|xfs|vfat|)\"}) without (mountpoint)) without (device,fstype))",
          "format": "time_series",
          "interval": "5m",
          "intervalFactor": 1,
          "refId": "A",
          "step": 300
        }
      ],
      "thresholds": "",
      "title": "Disk Space",
      "type": "singlestat",
      "valueFontSize": "50%",
      "valueMaps": [
        {
          "op": "=",
          "text": "N/A",
          "value": "null"
        }
      ],
      "valueName": "current"
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorValue": true,
      "colors": [
        "#d44a3a",
        "rgba(237, 129, 40, 0.89)",
        "#299c46"
      ],
      "datasource": "${DS_PROMETHEUS}",
      "decimals": 2,
      "description": "Lowest percent of the disk space available",
      "format": "percent",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 2,
        "w": 3,
        "x": 18,
        "y": 2
      },
      "id": 335,
      "interval": null,
      "links": [],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "postfix": "",
      "postfixFontSize": "50%",
      "prefix": "",
      "prefixFontSize": "50%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "rgba(31, 118, 189, 0.18)",
        "full": false,
        "lineColor": "rgb(31, 120, 193)",
        "show": true,
        "ymax": null,
        "ymin": null
      },
      "tableColumn": "",
      "targets": [
        {
          "expr": "min(node_filesystem_free_bytes{node_name=~\"$node_name\", fstype!~\"rootfs|selinuxfs|autofs|rpc_pipefs|tmpfs|shm|overlay|squashfs\"}/node_filesystem_size_bytes{node_name=~\"$node_name\", fstype!~\"rootfs|selinuxfs|autofs|rpc_pipefs|tmpfs|shm|overlay|squashfs\"})*100",
          "format": "time_series",
          "interval": "$interval",
          "intervalFactor": 1,
          "refId": "A"
        }
      ],
      "thresholds": "5,20",
      "title": "Min Space Available",
      "type": "singlestat",
      "valueFontSize": "50%",
      "valueMaps": [
        {
          "op": "=",
          "text": "N/A",
          "value": "null"
        }
      ],
      "valueName": "current"
    },
    {
      "content": "<h5><b><font color=#e68a00><center><a href=\"/graph/d/node-instance-summary/node-summary?var-node_name=$node_name\" target=\"_blank\">$crop_host...</a></center></font></b></h5>\n\n\n",
      "datasource": "${DS_PROMETHEUS}",
      "gridPos": {
        "h": 2,
        "w": 3,
        "x": 21,
        "y": 2
      },
      "id": 1001,
      "links": [],
      "mode": "html",
      "timeFrom": null,
      "timeShift": null,
      "title": "Node",
      "type": "text"
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorPostfix": true,
      "colorValue": true,
      "colors": [
        "rgba(245, 54, 54, 0.9)",
        "rgba(237, 129, 40, 0.89)",
        "rgba(50, 172, 45, 0.97)"
      ],
      "datasource": "${DS_PROMETHEUS}",
      "decimals": 2,
      "description": "**MySQL Uptime**\n\nThe amount of time since the last restart of the MySQL server process.",
      "editable": true,
      "error": false,
      "format": "s",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 2,
        "w": 3,
        "x": 0,
        "y": 4
      },
      "height": "125px",
      "id": 12,
      "interval": "",
      "links": [],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "postfix": "s",
      "postfixFontSize": "50%",
      "prefix": "",
      "prefixFontSize": "80%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "rgba(31, 118, 189, 0.18)",
        "full": false,
        "lineColor": "rgb(31, 120, 193)",
        "show": true
      },
      "tableColumn": "",
      "targets": [
        {
          "calculatedInterval": "10m",
          "datasourceErrors": {},
          "errors": {},
          "expr": "avg by (service_name) (mysql_global_status_uptime{service_name=~\"$service_name\"})",
          "format": "time_series",
          "interval": "5m",
          "intervalFactor": 1,
          "legendFormat": "",
          "metric": "",
          "refId": "A",
          "step": 300
        }
      ],
      "thresholds": "300,3600",
      "title": "MySQL Uptime",
      "type": "singlestat",
      "valueFontSize": "50%",
      "valueMaps": [],
      "valueName": "current"
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorValue": true,
      "colors": [
        "rgba(255, 255, 255, 0.97)",
        "rgba(237, 129, 40, 0.89)",
        "rgba(245, 54, 54, 0.9)"
      ],
      "datasource": "${DS_PROMETHEUS}",
      "decimals": 2,
      "description": "**Max Load**\n\nMaximum number of  Threads_Number which was sustained over the time\n",
      "editable": true,
      "error": false,
      "format": "short",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 2,
        "w": 3,
        "x": 3,
        "y": 4
      },
      "height": "125px",
      "id": 13,
      "interval": "$interval",
      "links": [],
      "mappingType": 1,
      "mappingTypes": [
        {
          "$$hashKey": "object:2889",
          "name": "value to text",
          "value": 1
        },
        {
          "$$hashKey": "object:2890",
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "postfix": "",
      "postfixFontSize": "50%",
      "prefix": "",
      "prefixFontSize": "80%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "rgba(31, 118, 189, 0.18)",
        "full": false,
        "lineColor": "rgb(31, 120, 193)",
        "show": true
      },
      "tableColumn": "",
      "targets": [
        {
          "calculatedInterval": "10m",
          "datasourceErrors": {},
          "errors": {},
          "expr": "avg by (service_name) (avg_over_time(mysql_global_status_threads_running{service_name=~\"$service_name\"}[$interval]) or avg_over_time(mysql_global_status_threads_running{service_name=~\"$service_name\"}[5m]))",
          "format": "time_series",
          "interval": "$interval",
          "intervalFactor": 1,
          "legendFormat": "",
          "metric": "",
          "refId": "A",
          "step": 20
        }
      ],
      "thresholds": "10,100",
      "timeFrom": null,
      "title": "Max Load",
      "type": "singlestat",
      "valueFontSize": "50%",
      "valueMaps": [],
      "valueName": "max"
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorValue": false,
      "colors": [
        "rgba(245, 54, 54, 0.9)",
        "rgba(237, 129, 40, 0.89)",
        "rgba(50, 172, 45, 0.97)"
      ],
      "datasource": "${DS_PROMETHEUS}",
      "decimals": 2,
      "description": "**Current QPS**\n\nBased on the queries reported by MySQL's ``SHOW STATUS`` command, it is the number of statements executed by the server within the last second. This variable includes statements executed within stored programs, unlike the Questions variable. It does not count \n``COM_PING`` or ``COM_STATISTICS`` commands.",
      "editable": true,
      "error": false,
      "format": "short",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 2,
        "w": 3,
        "x": 6,
        "y": 4
      },
      "height": "125px",
      "id": 1033,
      "interval": "$interval",
      "links": [
        {
          "targetBlank": true,
          "title": "MySQL Server Status Variables",
          "url": "https://dev.mysql.com/doc/refman/5.7/en/server-status-variables.html#statvar_Queries"
        }
      ],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "postfix": "",
      "postfixFontSize": "50%",
      "prefix": "",
      "prefixFontSize": "80%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "rgba(31, 118, 189, 0.18)",
        "full": false,
        "lineColor": "rgb(31, 120, 193)",
        "show": true
      },
      "tableColumn": "",
      "targets": [
        {
          "calculatedInterval": "10m",
          "datasourceErrors": {},
          "errors": {},
          "expr": "avg by (service_name) (rate(mysql_global_status_queries{service_name=~\"$service_name\"}[$interval]) or irate(mysql_global_status_queries{service_name=~\"$service_name\"}[5m]))",
          "format": "time_series",
          "interval": "$interval",
          "intervalFactor": 1,
          "legendFormat": "",
          "metric": "",
          "refId": "A",
          "step": 20
        }
      ],
      "thresholds": "35,75",
      "timeFrom": null,
      "title": "Current QPS",
      "type": "singlestat",
      "valueFontSize": "50%",
      "valueMaps": [],
      "valueName": "current"
    },
    {
      "content": "<h3><b><font color=#e68a00><center>$version</center></font></b></h3>\n\n\n",
      "datasource": "${DS_PROMETHEUS}",
      "gridPos": {
        "h": 2,
        "w": 3,
        "x": 9,
        "y": 4
      },
      "id": 401,
      "links": [],
      "mode": "html",
      "timeFrom": null,
      "timeShift": null,
      "title": "Version",
      "type": "text"
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorValue": false,
      "colors": [
        "rgba(50, 172, 45, 0.97)",
        "rgba(237, 129, 40, 0.89)",
        "rgba(245, 54, 54, 0.9)"
      ],
      "datasource": "${DS_PROMETHEUS}",
      "decimals": 0,
      "description": "**InnoDB Buffer Pool Size**\n\nInnoDB maintains a storage area called the buffer pool for caching data and indexes in memory.  Knowing how the InnoDB buffer pool works, and taking advantage of it to keep frequently accessed data in memory, is one of the most important aspects of MySQL tuning. The goal is to keep the working set in memory. In most cases, this should be between 60%-90% of available memory on a dedicated database host, but depends on many factors.",
      "editable": true,
      "error": false,
      "format": "bytes",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 2,
        "w": 3,
        "x": 12,
        "y": 4
      },
      "height": "125px",
      "id": 51,
      "interval": "$interval",
      "links": [
        {
          "targetBlank": true,
          "title": "Tuning the InnoDB Buffer Pool Size",
          "url": "https://www.percona.com/blog/2015/06/02/80-ram-tune-innodb_buffer_pool_size/"
        }
      ],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "postfix": "",
      "postfixFontSize": "50%",
      "prefix": "",
      "prefixFontSize": "80%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "rgba(31, 118, 189, 0.18)",
        "full": false,
        "lineColor": "rgb(31, 120, 193)",
        "show": true
      },
      "tableColumn": "",
      "targets": [
        {
          "calculatedInterval": "10m",
          "datasourceErrors": {},
          "errors": {},
          "expr": "avg by (service_name) (mysql_global_variables_innodb_buffer_pool_size{service_name=~\"$service_name\"})",
          "format": "time_series",
          "interval": "5m",
          "intervalFactor": 1,
          "legendFormat": "",
          "metric": "",
          "refId": "A",
          "step": 300
        }
      ],
      "thresholds": "90,95",
      "title": "InnoDB Buffer Pool Size",
      "type": "singlestat",
      "valueFontSize": "50%",
      "valueMaps": [],
      "valueName": "current"
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorValue": true,
      "colors": [
        "#299c46",
        "rgba(237, 129, 40, 0.89)",
        "#d44a3a"
      ],
      "datasource": "${DS_PROMETHEUS}",
      "description": "**InnoDB Buffer Pool Size % of Total RAM**\n\nInnoDB maintains a storage area called the buffer pool for caching data and indexes in memory.  Knowing how the InnoDB buffer pool works, and taking advantage of it to keep frequently accessed data in memory, is one of the most important aspects of MySQL tuning. The goal is to keep the working set in memory. In most cases, this should be between 60%-90% of available memory on a dedicated database host, but depends on many factors.",
      "format": "percent",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 2,
        "w": 3,
        "x": 15,
        "y": 4
      },
      "id": 52,
      "interval": null,
      "links": [
        {
          "targetBlank": true,
          "title": "Tuning the InnoDB Buffer Pool Size",
          "url": "https://www.percona.com/blog/2015/06/02/80-ram-tune-innodb_buffer_pool_size/"
        }
      ],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "postfix": "",
      "postfixFontSize": "50%",
      "prefix": "",
      "prefixFontSize": "80%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "repeat": null,
      "sparkline": {
        "fillColor": "rgba(31, 118, 189, 0.18)",
        "full": false,
        "lineColor": "rgb(31, 120, 193)",
        "show": true,
        "ymax": 100,
        "ymin": 0
      },
      "tableColumn": "",
      "targets": [
        {
          "calculatedInterval": "10m",
          "datasourceErrors": {},
          "errors": {},
          "expr": "avg by (node_name) ((mysql_global_variables_innodb_buffer_pool_size{service_name=~\"$service_name\"} * 100)) / \non (node_name) (avg by (node_name) (node_memory_MemTotal_bytes{node_name=~\"$node_name\"}))",
          "format": "time_series",
          "interval": "5m",
          "intervalFactor": 1,
          "legendFormat": "",
          "metric": "",
          "refId": "A",
          "step": 300
        }
      ],
      "thresholds": "40,80",
      "title": "Buffer Pool Size of Total RAM",
      "type": "singlestat",
      "valueFontSize": "50%",
      "valueMaps": [
        {
          "op": "=",
          "text": "N/A",
          "value": "null"
        }
      ],
      "valueName": "current"
    },
    {
      "cacheTimeout": null,
      "colorBackground": false,
      "colorValue": true,
      "colors": [
        "#299c46",
        "rgba(237, 129, 40, 0.89)",
        "#d44a3a"
      ],
      "datasource": "${DS_PROMETHEUS}",
      "decimals": 2,
      "description": "Percent of Active Sections which are blocked due to waiting on Innodb Row Locks",
      "format": "percentunit",
      "gauge": {
        "maxValue": 100,
        "minValue": 0,
        "show": false,
        "thresholdLabels": false,
        "thresholdMarkers": true
      },
      "gridPos": {
        "h": 2,
        "w": 3,
        "x": 18,
        "y": 4
      },
      "id": 1034,
      "interval": null,
      "links": [],
      "mappingType": 1,
      "mappingTypes": [
        {
          "name": "value to text",
          "value": 1
        },
        {
          "name": "range to text",
          "value": 2
        }
      ],
      "maxDataPoints": 100,
      "nullPointMode": "connected",
      "nullText": null,
      "postfix": "",
      "postfixFontSize": "50%",
      "prefix": "",
      "prefixFontSize": "50%",
      "rangeMaps": [
        {
          "from": "null",
          "text": "N/A",
          "to": "null"
        }
      ],
      "sparkline": {
        "fillColor": "rgba(31, 118, 189, 0.18)",
        "full": false,
        "lineColor": "rgb(31, 120, 193)",
        "show": true,
        "ymax": 1,
        "ymin": 0
      },
      "tableColumn": "",
      "targets": [
        {
          "calculatedInterval": "10m",
          "datasourceErrors": {},
          "errors": {},
          "expr": "avg by (service_name) ((rate(mysql_global_status_innodb_row_lock_time{service_name=~\"$service_name\"}[$interval])/1000 or irate(mysql_global_status_innodb_row_lock_time{service_name=~\"$service_name\"}[5m])/1000)/((avg_over_time(mysql_global_status_threads_running{service_name=~\"$service_name\"}[$interval]))or (avg_over_time(mysql_global_status_threads_running{service_name=~\"$service_name\"}[5m]))))",
          "format": "time_series",
          "interval": "$interval",
          "intervalFactor": 1,
          "legendFormat": "",
          "metric": "",
          "refId": "A",
          "step": 300
        }
      ],
      "thresholds": "0.10,0.50",
      "title": "Row Lock Blocking",
      "type": "singlestat",
      "valueFontSize": "50%",
      "valueMaps": [
        {
          "op": "=",
          "text": "N/A",
          "value": "null"
        }
      ],
      "valueName": "avg"
    },
    {
      "content": "<h4><b><font color=#e68a00><center><a href=\"/graph/d/mysql-instance-summary/mysql-instance-summary?var-service_name=$service_name\" target=\"_blank\">$service_name</a></center></font></b></h4>",
      "datasource": "${DS_PROMETHEUS}",
      "gridPos": {
        "h": 2,
        "w": 3,
        "x": 21,
        "y": 4
      },
      "id": 1000,
      "links": [],
      "mode": "html",
      "timeFrom": null,
      "timeShift": null,
      "title": "Service",
      "type": "text"
    },
    {
      "collapsed": true,
      "datasource": "${DS_PROMETHEUS}",
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 6
      },
      "id": 1003,
      "panels": [
        {
          "aliasColors": {
            "Max Core Utilization": "#bf1b00",
            "idle": "#806EB7",
            "iowait": "#E24D42",
            "nice": "#1F78C1",
            "softirq": "#FFF899",
            "steal": "#8F3BB8",
            "system": "#EAB839",
            "user": "#508642"
          },
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "${DS_PROMETHEUS}",
          "decimals": 2,
          "description": "The CPU time is measured in clock ticks or seconds. It is useful to measure CPU time as a percentage of the CPU's capacity, which is called the CPU usage.",
          "editable": true,
          "error": false,
          "fill": 6,
          "fillGradient": 0,
          "grid": {},
          "gridPos": {
            "h": 6,
            "w": 8,
            "x": 0,
            "y": 7
          },
          "height": "",
          "hiddenSeries": false,
          "id": 337,
          "legend": {
            "alignAsTable": false,
            "avg": false,
            "current": false,
            "hideEmpty": true,
            "hideZero": true,
            "max": false,
            "min": false,
            "rightSide": false,
            "show": true,
            "sort": "avg",
            "sortDesc": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 1,
          "links": [],
          "nullPointMode": "null",
          "options": {
            "dataLinks": []
          },
          "paceLength": 10,
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [
            {
              "$$hashKey": "object:794",
              "alias": "Max Core Utilization",
              "lines": false,
              "pointradius": 1,
              "points": true,
              "stack": false
            }
          ],
          "spaceLength": 10,
          "stack": true,
          "steppedLine": true,
          "targets": [
            {
              "expr": "avg by (node_name,mode) (clamp_max(((avg by (mode) ( (clamp_max(rate(node_cpu_seconds_total{node_name=~\"$node_name\",mode!=\"idle\",mode!=\"iowait\"}[$interval]),1)) or (clamp_max(irate(node_cpu_seconds_total{node_name=~\"$node_name\",mode!=\"idle\",mode!=\"iowait\"}[5m]),1)) ))*100 or (avg_over_time(node_cpu_average{node_name=~\"$node_name\", mode!=\"total\", mode!=\"idle\",mode!=\"iowait\"}[$interval]) or avg_over_time(node_cpu_average{node_name=~\"$node_name\", mode!=\"total\", mode!=\"idle\",mode!=\"iowait\"}[5m]))),100))",
              "format": "time_series",
              "interval": "$interval",
              "intervalFactor": 1,
              "legendFormat": "{{ mode }}",
              "refId": "B"
            },
            {
              "expr": "clamp_max(max by () (sum  by (cpu) ( (clamp_max(rate(node_cpu_seconds_total{node_name=~\"$node_name\",mode!=\"idle\",mode!=\"iowait\"}[$interval]),1)) or (clamp_max(irate(node_cpu_seconds_total{node_name=~\"$node_name\",mode!=\"idle\",mode!=\"iowait\"}[5m]),1)) )),1)",
              "format": "time_series",
              "hide": true,
              "interval": "$interval",
              "intervalFactor": 1,
              "legendFormat": "Max Core Utilization",
              "refId": "C"
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeRegions": [],
          "timeShift": null,
          "title": "CPU Usage",
          "tooltip": {
            "msResolution": false,
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "$$hashKey": "object:813",
              "decimals": 2,
              "format": "percent",
              "label": "",
              "logBase": 1,
              "max": "100",
              "min": 0,
              "show": true
            },
            {
              "$$hashKey": "object:814",
              "decimals": null,
              "format": "short",
              "logBase": 1,
              "max": null,
              "min": 0,
              "show": false
            }
          ],
          "yaxis": {
            "align": false,
            "alignLevel": null
          }
        },
        {
          "aliasColors": {
            "Allocated": "#E0752D",
            "CPU Load": "#64B0C8",
            "IO Load ": "#EA6460",
            "Limit": "#1F78C1",
            "Max CPU Core Utilization": "dark-purple",
            "Max Core Usage": "#bf1b00",
            "Normalized CPU Load": "#6ED0E0"
          },
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "${DS_PROMETHEUS}",
          "decimals": 2,
          "description": "",
          "editable": true,
          "error": false,
          "fill": 7,
          "fillGradient": 0,
          "grid": {},
          "gridPos": {
            "h": 6,
            "w": 8,
            "x": 8,
            "y": 7
          },
          "hiddenSeries": false,
          "id": 339,
          "legend": {
            "alignAsTable": false,
            "avg": false,
            "current": false,
            "hideEmpty": false,
            "max": false,
            "min": false,
            "rightSide": false,
            "show": true,
            "sort": "avg",
            "sortDesc": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 2,
          "links": [],
          "nullPointMode": "null",
          "options": {
            "dataLinks": []
          },
          "paceLength": 10,
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [
            {
              "$$hashKey": "object:879",
              "alias": "Max CPU Core Utilization"
            }
          ],
          "spaceLength": 10,
          "stack": false,
          "steppedLine": true,
          "targets": [
            {
              "calculatedInterval": "2s",
              "datasourceErrors": {},
              "errors": {},
              "expr": "100*clamp_max(max by () (sum  by (cpu) ( (clamp_max(rate(node_cpu_seconds_total{node_name=~\"$node_name\",mode!=\"idle\",mode!=\"iowait\"}[$interval]),1)) or (clamp_max(irate(node_cpu_seconds_total{node_name=~\"$node_name\",mode!=\"idle\",mode!=\"iowait\"}[5m]),1)) )),1)",
              "format": "time_series",
              "interval": "$interval",
              "intervalFactor": 1,
              "legendFormat": "Max CPU Core Utilization",
              "metric": "",
              "refId": "A",
              "step": 300,
              "target": ""
            }
          ],
          "thresholds": [
            {
              "$$hashKey": "object:1044",
              "colorMode": "critical",
              "fill": true,
              "line": true,
              "op": "gt",
              "value": 90,
              "yaxis": "left"
            }
          ],
          "timeFrom": null,
          "timeRegions": [],
          "timeShift": null,
          "title": "Max  CPU Core Usage",
          "tooltip": {
            "msResolution": false,
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "$$hashKey": "object:898",
              "decimals": 2,
              "format": "percent",
              "label": "",
              "logBase": 1,
              "max": "100",
              "min": 0,
              "show": true
            },
            {
              "$$hashKey": "object:899",
              "decimals": 2,
              "format": "percentunit",
              "logBase": 1,
              "max": "1",
              "min": 0,
              "show": false
            }
          ],
          "yaxis": {
            "align": false,
            "alignLevel": null
          }
        },
        {
          "aliasColors": {
            "Allocated": "#E0752D",
            "CPU Load": "#64B0C8",
            "IO Load ": "#EA6460",
            "Limit": "#1F78C1",
            "Max CPU Core Utilization": "#bf1b00",
            "Max Core Usage": "#bf1b00",
            "Normalized CPU Load": "dark-blue"
          },
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "${DS_PROMETHEUS}",
          "decimals": 2,
          "description": "",
          "editable": true,
          "error": false,
          "fill": 7,
          "fillGradient": 0,
          "grid": {},
          "gridPos": {
            "h": 6,
            "w": 8,
            "x": 16,
            "y": 7
          },
          "hiddenSeries": false,
          "id": 1004,
          "legend": {
            "alignAsTable": false,
            "avg": false,
            "current": false,
            "hideEmpty": false,
            "max": false,
            "min": false,
            "rightSide": false,
            "show": true,
            "sort": "avg",
            "sortDesc": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 2,
          "links": [],
          "nullPointMode": "null",
          "options": {
            "dataLinks": []
          },
          "paceLength": 10,
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "spaceLength": 10,
          "stack": false,
          "steppedLine": true,
          "targets": [
            {
              "calculatedInterval": "2s",
              "datasourceErrors": {},
              "errors": {},
              "expr": "avg by (node_name) ((avg_over_time(node_procs_running{node_name=~\"$node_name\"}[$interval])-1) / scalar(count(node_cpu_seconds_total{mode=\"user\", node_name=~\"$node_name\"})) or (avg_over_time(node_procs_running{node_name=~\"$node_name\"}[5m])-1) / scalar(count(node_cpu_seconds_total{mode=\"user\", node_name=~\"$node_name\"})))",
              "format": "time_series",
              "hide": false,
              "interval": "$interval",
              "intervalFactor": 1,
              "legendFormat": "Normalized CPU Load",
              "metric": "",
              "refId": "B",
              "step": 300,
              "target": ""
            }
          ],
          "thresholds": [
            {
              "$$hashKey": "object:1803",
              "colorMode": "critical",
              "fill": true,
              "line": true,
              "op": "gt",
              "value": 3,
              "yaxis": "left"
            }
          ],
          "timeFrom": null,
          "timeRegions": [],
          "timeShift": null,
          "title": "CPU Saturation ",
          "tooltip": {
            "msResolution": false,
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "$$hashKey": "object:1520",
              "decimals": 2,
              "format": "short",
              "label": "",
              "logBase": 1,
              "max": null,
              "min": 0,
              "show": true
            },
            {
              "$$hashKey": "object:1521",
              "decimals": 2,
              "format": "percentunit",
              "logBase": 1,
              "max": "1",
              "min": 0,
              "show": false
            }
          ],
          "yaxis": {
            "align": false,
            "alignLevel": null
          }
        },
        {
          "aliasColors": {},
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "${DS_PROMETHEUS}",
          "decimals": 2,
          "description": "",
          "editable": true,
          "error": false,
          "fill": 0,
          "fillGradient": 0,
          "grid": {},
          "gridPos": {
            "h": 6,
            "w": 8,
            "x": 0,
            "y": 13
          },
          "hiddenSeries": false,
          "id": 47,
          "legend": {
            "alignAsTable": false,
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "show": true,
            "sort": "avg",
            "sortDesc": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 2,
          "links": [],
          "nullPointMode": "null",
          "options": {
            "dataLinks": []
          },
          "paceLength": 10,
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "spaceLength": 10,
          "stack": false,
          "steppedLine": true,
          "targets": [
            {
              "calculatedInterval": "2m",
              "datasourceErrors": {},
              "errors": {},
              "expr": "avg by (service_name) (rate(mysql_global_status_connections{service_name=~\"$service_name\"}[$interval]) or \nirate(mysql_global_status_connections{service_name=~\"$service_name\"}[5m]))",
              "format": "time_series",
              "interval": "$interval",
              "intervalFactor": 1,
              "legendFormat": "New Connections ",
              "metric": "",
              "refId": "A",
              "step": 20
            }
          ],
          "thresholds": [
            {
              "$$hashKey": "object:2058",
              "colorMode": "warning",
              "fill": true,
              "line": true,
              "op": "gt",
              "value": 1000,
              "yaxis": "left"
            }
          ],
          "timeFrom": null,
          "timeRegions": [],
          "timeShift": null,
          "title": "MySQL  Connections",
          "tooltip": {
            "msResolution": false,
            "shared": true,
            "sort": 0,
            "value_type": "cumulative"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "$$hashKey": "object:1876",
              "decimals": 2,
              "format": "ops",
              "label": "",
              "logBase": 1,
              "max": null,
              "min": 0,
              "show": true
            },
            {
              "$$hashKey": "object:1877",
              "format": "short",
              "label": "",
              "logBase": 1,
              "max": null,
              "min": 0,
              "show": false
            }
          ],
          "yaxis": {
            "align": false,
            "alignLevel": null
          }
        },
        {
          "aliasColors": {
            "Questions": "dark-purple"
          },
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "${DS_PROMETHEUS}",
          "decimals": 2,
          "description": "**MySQL Questions**\n\nThe number of statements executed by the server. This includes only statements sent to the server by clients and not statements executed within stored programs, unlike the Queries used in the QPS calculation. \n\nThis variable does not count the following commands:\n* ``COM_PING``\n* ``COM_STATISTICS``\n* ``COM_STMT_PREPARE``\n* ``COM_STMT_CLOSE``\n* ``COM_STMT_RESET``",
          "editable": true,
          "error": false,
          "fill": 0,
          "fillGradient": 0,
          "grid": {},
          "gridPos": {
            "h": 6,
            "w": 8,
            "x": 8,
            "y": 13
          },
          "hiddenSeries": false,
          "id": 53,
          "legend": {
            "alignAsTable": false,
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "rightSide": false,
            "show": true,
            "sort": "avg",
            "sortDesc": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 2,
          "links": [],
          "nullPointMode": "null",
          "options": {
            "dataLinks": []
          },
          "paceLength": 10,
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "spaceLength": 10,
          "stack": false,
          "steppedLine": true,
          "targets": [
            {
              "calculatedInterval": "2m",
              "datasourceErrors": {},
              "errors": {},
              "expr": "avg by (service_name) (rate(mysql_global_status_questions{service_name=~\"$service_name\"}[$interval]) or \nirate(mysql_global_status_questions{service_name=~\"$service_name\"}[5m]))",
              "format": "time_series",
              "interval": "$interval",
              "intervalFactor": 1,
              "legendFormat": "Questions",
              "metric": "",
              "refId": "A",
              "step": 20
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeRegions": [],
          "timeShift": null,
          "title": "MySQL Questions",
          "tooltip": {
            "msResolution": false,
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "$$hashKey": "object:2107",
              "decimals": 2,
              "format": "ops",
              "logBase": 1,
              "max": null,
              "min": 0,
              "show": true
            },
            {
              "$$hashKey": "object:2108",
              "format": "short",
              "logBase": 1,
              "max": null,
              "min": 0,
              "show": false
            }
          ],
          "yaxis": {
            "align": false,
            "alignLevel": null
          }
        },
        {
          "aliasColors": {},
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "${DS_PROMETHEUS}",
          "decimals": 2,
          "description": "**MySQL Handlers**\n\nHandler statistics are internal statistics on how MySQL is selecting, updating, inserting, and modifying rows, tables, and indexes.\n\nThis is in fact the layer between the Storage Engine and MySQL.\n\n* `read_rnd_next` is incremented when the server performs a full table scan and this is a counter you don't really want to see with a high value.\n* `read_key` is incremented when a read is done with an index.\n* `read_next` is incremented when the storage engine is asked to 'read the next index entry'. A high value means a lot of index scans are being done.",
          "editable": true,
          "error": false,
          "fill": 7,
          "fillGradient": 0,
          "grid": {},
          "gridPos": {
            "h": 6,
            "w": 8,
            "x": 16,
            "y": 13
          },
          "hiddenSeries": false,
          "id": 8,
          "legend": {
            "alignAsTable": false,
            "avg": false,
            "current": false,
            "hideZero": true,
            "max": false,
            "min": false,
            "rightSide": false,
            "show": true,
            "sort": "avg",
            "sortDesc": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 2,
          "links": [],
          "nullPointMode": "null",
          "options": {
            "dataLinks": []
          },
          "paceLength": 10,
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "spaceLength": 10,
          "stack": true,
          "steppedLine": true,
          "targets": [
            {
              "calculatedInterval": "2m",
              "datasourceErrors": {},
              "errors": {},
              "expr": "avg by (service_name,handler) (rate(mysql_global_status_handlers_total{service_name=~\"$service_name\", handler!~\"commit|rollback|savepoint.*|prepare|external_lock\"}[$interval]) or \nirate(mysql_global_status_handlers_total{service_name=~\"$service_name\", handler!~\"commit|rollback|savepoint.*|prepare|external_lock\"}[5m]))",
              "format": "time_series",
              "interval": "$interval",
              "intervalFactor": 1,
              "legendFormat": "{{ handler }}",
              "metric": "",
              "refId": "J",
              "step": 20
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeRegions": [],
          "timeShift": null,
          "title": "MySQL Handlers",
          "tooltip": {
            "msResolution": false,
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "$$hashKey": "object:2272",
              "decimals": 2,
              "format": "ops",
              "label": "",
              "logBase": 1,
              "max": null,
              "min": 0,
              "show": true
            },
            {
              "$$hashKey": "object:2273",
              "format": "short",
              "logBase": 1,
              "max": null,
              "min": 0,
              "show": false
            }
          ],
          "yaxis": {
            "align": false,
            "alignLevel": null
          }
        },
        {
          "columns": [],
          "datasource": "${DS_CLICKHOUSE}",
          "fontSize": "100%",
          "gridPos": {
            "h": 10,
            "w": 24,
            "x": 0,
            "y": 19
          },
          "id": 1006,
          "links": [],
          "pageSize": null,
          "scroll": true,
          "showHeader": true,
          "sort": {
            "col": 2,
            "desc": true
          },
          "styles": [
            {
              "$$hashKey": "object:3008",
              "alias": "",
              "align": "auto",
              "colorMode": "value",
              "colors": [
                "rgba(255, 255, 255, 0.97)",
                "rgba(237, 129, 40, 0.89)",
                "rgba(245, 54, 54, 0.9)"
              ],
              "dateFormat": "YYYY-MM-DD HH:mm:ss",
              "decimals": 2,
              "link": false,
              "mappingType": 1,
              "pattern": "CPUScore",
              "thresholds": [
                "100",
                "500"
              ],
              "type": "number",
              "unit": "short"
            },
            {
              "$$hashKey": "object:3477",
              "alias": "",
              "align": "auto",
              "colorMode": "value",
              "colors": [
                "rgba(255, 255, 255, 0.97)",
                "rgba(237, 129, 40, 0.89)",
                "rgba(245, 54, 54, 0.9)"
              ],
              "dateFormat": "YYYY-MM-DD HH:mm:ss",
              "decimals": 2,
              "mappingType": 1,
              "pattern": "Rows_examined",
              "thresholds": [
                "10000",
                "100000"
              ],
              "type": "number",
              "unit": "ops"
            },
            {
              "$$hashKey": "object:3697",
              "alias": "",
              "align": "auto",
              "colorMode": null,
              "colors": [
                "rgba(245, 54, 54, 0.9)",
                "rgba(237, 129, 40, 0.89)",
                "rgba(50, 172, 45, 0.97)"
              ],
              "dateFormat": "YYYY-MM-DD HH:mm:ss",
              "decimals": 2,
              "mappingType": 1,
              "pattern": "Rows_affected",
              "thresholds": [],
              "type": "number",
              "unit": "ops"
            },
            {
              "$$hashKey": "object:3730",
              "alias": "",
              "align": "auto",
              "colorMode": "value",
              "colors": [
                "rgba(255, 255, 255, 0.97)",
                "rgba(237, 129, 40, 0.89)",
                "rgba(245, 54, 54, 0.9)"
              ],
              "dateFormat": "YYYY-MM-DD HH:mm:ss",
              "decimals": 2,
              "mappingType": 1,
              "pattern": "Latency_ms",
              "thresholds": [
                "10",
                "30"
              ],
              "type": "number",
              "unit": "ms"
            },
            {
              "$$hashKey": "object:4973",
              "alias": "",
              "align": "auto",
              "colorMode": null,
              "colors": [
                "rgba(245, 54, 54, 0.9)",
                "rgba(237, 129, 40, 0.89)",
                "rgba(50, 172, 45, 0.97)"
              ],
              "dateFormat": "YYYY-MM-DD HH:mm:ss",
              "decimals": 2,
              "link": true,
              "linkTargetBlank": true,
              "linkTooltip": "Analyze Query",
              "linkUrl": "/graph/d/pmm-qan/pmm-query-analytics?var-service_name=$service_name&filter_by=${__cell}&from=$__from&to=$__to",
              "mappingType": 1,
              "pattern": "queryid",
              "thresholds": [],
              "type": "string",
              "unit": "short"
            },
            {
              "$$hashKey": "object:2447",
              "alias": "",
              "align": "auto",
              "colorMode": "value",
              "colors": [
                "rgba(255, 255, 255, 0.97)",
                "rgba(237, 129, 40, 0.89)",
                "rgba(245, 54, 54, 0.9)"
              ],
              "decimals": 2,
              "pattern": "/.*/",
              "thresholds": [
                "1000",
                "10000"
              ],
              "type": "number",
              "unit": "short"
            }
          ],
          "targets": [
            {
              "database": "pmm",
              "dateLoading": false,
              "dateTimeColDataType": "period_start",
              "dateTimeType": "DATETIME",
              "datetimeLoading": false,
              "format": "table",
              "formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t",
              "interval": "1m",
              "intervalFactor": 1,
              "query": "SELECT\n    queryid,\n    any(fingerprint) Query,\n    (sum(num_queries)*100+sum(m_rows_examined_sum)+sum(m_rows_affected_sum)*10)/($__to-$__from) CPUScore,\n    sum(num_queries)/($__to-$__from)*1000 QPS,\n    sum(m_rows_examined_sum)/($__to-$__from)*1000 as Rows_examined,\n    sum(m_rows_affected_sum)/($__to-$__from)*1000 as Rows_affected,\n    sum(m_query_time_sum)/sum(m_query_time_cnt)*1000 as Latency_ms\nFROM $table\nWHERE $timeFilter and service_name='$service_name'\nGROUP BY queryid\nORDER BY CPUScore desc limit 50",
              "rawQuery": "SELECT     queryid,     any(fingerprint) Query,     (sum(num_queries)*100+sum(m_rows_examined_sum)+sum(m_rows_affected_sum)*10)/(1593037233284-1592950833284) CPUScore,     sum(num_queries)/(1593037233284-1592950833284)*1000 QPS,     sum(m_rows_examined_sum)/(1593037233284-1592950833284)*1000 as Rows_examined,     sum(m_rows_affected_sum)/(1593037233284-1592950833284)*1000 as Rows_affected,     sum(m_query_time_sum)/sum(m_query_time_cnt)*1000 as Latency_ms FROM pmm.metrics WHERE period_start >= toDateTime(1592952481) and service_name='mysql4-mysql' GROUP BY queryid ORDER BY CPUScore desc limit 50",
              "refId": "A",
              "round": "1m",
              "table": "metrics",
              "tableLoading": false
            }
          ],
          "timeFrom": null,
          "timeShift": null,
          "title": "CPU Intensive Queries",
          "transform": "table",
          "type": "table"
        }
      ],
      "title": "CPU Analyses - $node_name",
      "type": "row"
    },
    {
      "collapsed": true,
      "datasource": "${DS_PROMETHEUS}",
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 7
      },
      "id": 1008,
      "panels": [
        {
          "aliasColors": {
            "Swap In (Reads)": "#6ed0e0",
            "Swap Out (Writes)": "#ef843c",
            "Total": "#bf1b00"
          },
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "${DS_PROMETHEUS}",
          "decimals": 2,
          "description": "Disk I/O includes read or write or input/output operations involving a physical disk. It is the speed with which the data transfer takes place between the hard disk drive and RAM.\n",
          "editable": true,
          "error": false,
          "fill": 7,
          "fillGradient": 0,
          "grid": {},
          "gridPos": {
            "h": 6,
            "w": 8,
            "x": 0,
            "y": 8
          },
          "hiddenSeries": false,
          "id": 341,
          "legend": {
            "alignAsTable": false,
            "avg": false,
            "current": false,
            "hideEmpty": false,
            "max": false,
            "min": false,
            "rightSide": false,
            "show": true,
            "sort": "avg",
            "sortDesc": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 2,
          "links": [
            {
              "targetBlank": true,
              "title": "Disk Performance",
              "url": "/graph/d/node-disk/disk-details?$__url_time_range&$__all_variables"
            }
          ],
          "nullPointMode": "null",
          "options": {
            "dataLinks": []
          },
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [
            {
              "$$hashKey": "object:433",
              "alias": "Disk Writes (Page Out)",
              "transform": "negative-Y"
            },
            {
              "$$hashKey": "object:434",
              "alias": "Total",
              "legend": false,
              "lines": false
            },
            {
              "$$hashKey": "object:435",
              "alias": "Swap Out (Writes)",
              "transform": "negative-Y"
            }
          ],
          "spaceLength": 10,
          "stack": false,
          "steppedLine": true,
          "targets": [
            {
              "calculatedInterval": "2s",
              "datasourceErrors": {},
              "errors": {},
              "expr": "avg by (node_name) (rate(node_vmstat_pgpgin{node_name=\"$node_name\"}[$interval]) * 1024 or irate(node_vmstat_pgpgin{node_name=\"$node_name\"}[5m]) * 1024)",
              "format": "time_series",
              "interval": "$interval",
              "intervalFactor": 1,
              "legendFormat": "Disk Reads (Page In)",
              "metric": "",
              "refId": "A",
              "step": 300,
              "target": ""
            },
            {
              "calculatedInterval": "2s",
              "datasourceErrors": {},
              "errors": {},
              "expr": "avg by (node_name) ((rate(node_vmstat_pgpgout{node_name=\"$node_name\"}[$interval]) * 1024 or irate(node_vmstat_pgpgout{node_name=\"$node_name\"}[5m]) * 1024))",
              "format": "time_series",
              "interval": "$interval",
              "intervalFactor": 1,
              "legendFormat": "Disk Writes (Page Out)",
              "metric": "",
              "refId": "B",
              "step": 300,
              "target": ""
            },
            {
              "expr": "avg by (node_name) ((rate(node_vmstat_pgpgin{node_name=\"$node_name\"}[$interval]) * 1024 or irate(node_vmstat_pgpgin{node_name=\"$node_name\"}[5m]) * 1024 ) + (rate(node_vmstat_pgpgout{node_name=\"$node_name\"}[$interval]) * 1024 or irate(node_vmstat_pgpgout{node_name=\"$node_name\"}[5m]) * 1024))",
              "format": "time_series",
              "interval": "$interval",
              "intervalFactor": 1,
              "legendFormat": "Total",
              "refId": "C"
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeRegions": [],
          "timeShift": null,
          "title": "Disk I/O ",
          "tooltip": {
            "msResolution": false,
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "$$hashKey": "object:462",
              "decimals": 2,
              "format": "Bps",
              "label": "Page Out (-) / Page In (+)",
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            },
            {
              "$$hashKey": "object:463",
              "format": "bytes",
              "logBase": 1,
              "max": null,
              "min": 0,
              "show": false
            }
          ],
          "yaxis": {
            "align": false,
            "alignLevel": null
          }
        },
        {
          "aliasColors": {
            "Total": "#bf1b00"
          },
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "${DS_PROMETHEUS}",
          "decimals": 2,
          "description": "Shows how much disk was loaded for reads or writes as average number of outstanding requests at different period of time.  High disk load is a good measure of actual storage utilization. Different storage types handle load differently - some will show latency increases on low loads others can handle higher load with no problems.",
          "editable": true,
          "error": false,
          "fill": 7,
          "fillGradient": 0,
          "grid": {},
          "gridPos": {
            "h": 6,
            "w": 8,
            "x": 8,
            "y": 8
          },
          "hiddenSeries": false,
          "id": 1009,
          "legend": {
            "alignAsTable": false,
            "avg": false,
            "current": false,
            "hideEmpty": true,
            "hideZero": true,
            "max": false,
            "min": false,
            "rightSide": false,
            "show": true,
            "sort": "avg",
            "sortDesc": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 2,
          "links": [
            {
              "targetBlank": true,
              "title": "Disk Performance",
              "url": "/graph/d/node-disk/disk-details?$__url_time_range&$__all_variables"
            }
          ],
          "nullPointMode": "null",
          "options": {
            "dataLinks": [
              {
                "targetBlank": true,
                "title": "Disk Details - ${__series.labels.node_name}",
                "url": "/graph/d/node-disk/disk-details?var-node_name=${__field.labels.node_name}&$__url_time_range"
              }
            ]
          },
          "paceLength": 10,
          "percentage": false,
          "pointradius": 1,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [
            {
              "$$hashKey": "object:757",
              "alias": "Write Load",
              "transform": "negative-Y"
            },
            {
              "$$hashKey": "object:758",
              "alias": "Total",
              "legend": false,
              "lines": false
            }
          ],
          "spaceLength": 10,
          "stack": false,
          "steppedLine": true,
          "targets": [
            {
              "calculatedInterval": "2m",
              "datasourceErrors": {},
              "errors": {},
              "expr": "avg by (node_name) (sum(rate(node_disk_read_time_seconds_total{node_name=~\"$node_name\"}[$interval])) or sum(irate(node_disk_read_time_seconds_total{node_name=~\"$node_name\"}[5m])) or\n(sum(rdsosmetrics_diskIO_readIOsPS{node_name=~\"$node_name\"})))",
              "format": "time_series",
              "interval": "$interval",
              "intervalFactor": 1,
              "legendFormat": "Read Load",
              "metric": "",
              "refId": "A",
              "step": 300,
              "target": ""
            },
            {
              "calculatedInterval": "2m",
              "datasourceErrors": {},
              "errors": {},
              "expr": "avg by (node_name) (sum(rate(node_disk_write_time_seconds_total{node_name=~\"$node_name\"}[$interval])) or sum(irate(node_disk_write_time_seconds_total{node_name=~\"$node_name\"}[5m])) or (sum(rdsosmetrics_diskIO_writeIOsPS{node_name=~\"$node_name\"})))",
              "format": "time_series",
              "interval": "$interval",
              "intervalFactor": 1,
              "legendFormat": "Write Load",
              "metric": "",
              "refId": "B",
              "step": 300,
              "target": ""
            },
            {
              "expr": "avg by (node_name) ((sum(rate(node_disk_read_time_seconds_total{node_name=~\"$node_name\"}[$interval])) or sum(irate(node_disk_read_time_seconds_total{node_name=~\"$node_name\"}[5m]))) + (sum(rate(node_disk_write_time_seconds_total{node_name=~\"$node_name\"}[$interval])) or sum(irate(node_disk_write_time_seconds_total{node_name=~\"$node_name\"}[5m]))) or\n(sum(rdsosmetrics_diskIO_writeIOsPS{node_name=~\"$node_name\"})) +  (sum(rdsosmetrics_diskIO_readIOsPS{node_name=~\"$node_name\"})))",
              "format": "time_series",
              "interval": "$interval",
              "intervalFactor": 1,
              "legendFormat": "Total",
              "refId": "C"
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeRegions": [],
          "timeShift": null,
          "title": "Disk IO Load",
          "tooltip": {
            "msResolution": false,
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "$$hashKey": "object:779",
              "decimals": 2,
              "format": "short",
              "label": "Write Load (-) / Read Load (+)",
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            },
            {
              "$$hashKey": "object:780",
              "format": "s",
              "label": "",
              "logBase": 1,
              "max": null,
              "min": 0,
              "show": false
            }
          ],
          "yaxis": {
            "align": false,
            "alignLevel": null
          }
        },
        {
          "aliasColors": {
            "Read Latency": "#1f78c1",
            "Write Latency": "#e24d42"
          },
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "${DS_PROMETHEUS}",
          "decimals": 2,
          "description": "Shows average latency for Reads and Writes IO Devices.  Higher than typical latency for highly loaded storage indicates saturation (overload) and is frequent cause of performance problems.  Higher than normal latency also can indicate internal storage problems.",
          "fill": 2,
          "fillGradient": 0,
          "gridPos": {
            "h": 6,
            "w": 8,
            "x": 16,
            "y": 8
          },
          "hiddenSeries": false,
          "id": 1010,
          "legend": {
            "alignAsTable": false,
            "avg": false,
            "current": false,
            "hideEmpty": true,
            "hideZero": true,
            "max": false,
            "min": false,
            "show": true,
            "sort": "avg",
            "sortDesc": true,
            "total": false,
            "values": false
          },
          "lines": false,
          "linewidth": 2,
          "links": [],
          "nullPointMode": "null",
          "options": {
            "dataLinks": [
              {
                "targetBlank": true,
                "title": "Disk Details - ${__series.labels.node_name}",
                "url": "/graph/d/node-disk/disk-details?var-node_name=${__field.labels.node_name}&$__url_time_range"
              }
            ]
          },
          "paceLength": 10,
          "percentage": false,
          "pointradius": 1,
          "points": true,
          "renderer": "flot",
          "seriesOverrides": [
            {
              "$$hashKey": "object:1068",
              "alias": "Avg Read Latency (1h)",
              "fill": 0,
              "lines": true,
              "linewidth": 1,
              "points": false
            },
            {
              "$$hashKey": "object:1069",
              "alias": "Avg Write Latency (1h)",
              "fill": 0,
              "lines": true,
              "linewidth": 1,
              "points": false
            }
          ],
          "spaceLength": 10,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "expr": "avg by (node_name) ((sum(rate(node_disk_read_time_seconds_total{node_name=~\"$node_name\"}[$interval])) / sum(rate(node_disk_reads_completed_total{node_name=~\"$node_name\"}[$interval]) > 0 )) or (sum(irate(node_disk_read_time_seconds_total{node_name=~\"$node_name\"}[5m])) / \nsum(irate(node_disk_reads_completed_total{node_name=~\"$node_name\"}[5m]) > 0 ))\nor avg_over_time(aws_rds_read_latency_average{node_name=~\"$node_name\"}[$interval])/1000 or avg_over_time(aws_rds_read_latency_average{node_name=~\"$node_name\"}[5m])/1000 or\navg_over_time(rdsosmetrics_diskIO_readLatency{node_name=~\"$node_name\"}[$interval])/1000 or avg_over_time(rdsosmetrics_diskIO_readLatency{node_name=~\"$node_name\"}[5m])/1000)",
              "format": "time_series",
              "interval": "$interval",
              "intervalFactor": 1,
              "legendFormat": "Read Latency",
              "refId": "A"
            },
            {
              "expr": "avg by (node_name) ((sum(rate(node_disk_write_time_seconds_total{node_name=~\"$node_name\"}[$interval])) / sum(rate(node_disk_writes_completed_total{node_name=~\"$node_name\"}[$interval]) > 0 )) or (sum(irate(node_disk_write_time_seconds_total{node_name=~\"$node_name\"}[5m])) / \nsum(irate(node_disk_writes_completed_total{node_name=~\"$node_name\"}[5m]) > 0 ))\nor (avg_over_time(aws_rds_write_latency_average{node_name=~\"$node_name\"}[$interval])/1000 or avg_over_time(aws_rds_write_latency_average{node_name=~\"$node_name\"}[5m])/1000) or\n(avg_over_time(rdsosmetrics_diskIO_writeLatency{node_name=~\"$node_name\"}[$interval]) or avg_over_time(rdsosmetrics_diskIO_writeLatency{node_name=~\"$node_name\"}[5m]))/1000)",
              "format": "time_series",
              "interval": "$interval",
              "intervalFactor": 1,
              "legendFormat": "Write Latency",
              "refId": "B"
            },
            {
              "expr": "avg by (node_name) ((sum(rate(node_disk_read_time_seconds_total{node_name=~\"$node_name\"}[1h])) / sum(rate(node_disk_reads_completed_total{node_name=~\"$node_name\"}[1h]) > 0 ))\nor avg_over_time(aws_rds_read_latency_average{node_name=~\"$node_name\"}[1h])/1000 or avg_over_time(aws_rds_read_latency_average{node_name=~\"$node_name\"}[1h])/1000 or\navg_over_time(rdsosmetrics_diskIO_readLatency{node_name=~\"$node_name\"}[1h])/1000 or avg_over_time(rdsosmetrics_diskIO_readLatency{node_name=~\"$node_name\"}[1h])/1000)",
              "format": "time_series",
              "interval": "$interval",
              "intervalFactor": 1,
              "legendFormat": "Avg Read Latency (1h)",
              "refId": "C"
            },
            {
              "expr": "avg by (node_name) ((sum(rate(node_disk_write_time_seconds_total{node_name=~\"$node_name\"}[1h])) / sum(rate(node_disk_writes_completed_total{node_name=~\"$node_name\"}[1h]) > 0 )) \nor (avg_over_time(aws_rds_write_latency_average{node_name=~\"$node_name\"}[$interval])/1000 or avg_over_time(aws_rds_write_latency_average{node_name=~\"$node_name\"}[1h])/1000) or\n(avg_over_time(rdsosmetrics_diskIO_writeLatency{node_name=~\"$node_name\"}[$interval])/1000 or avg_over_time(rdsosmetrics_diskIO_writeLatency{node_name=~\"$node_name\"}[1h])/1000))",
              "format": "time_series",
              "interval": "$interval",
              "intervalFactor": 1,
              "legendFormat": "Avg Write Latency (1h)",
              "refId": "D"
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeRegions": [],
          "timeShift": null,
          "title": "Disk IO Latency",
          "tooltip": {
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "$$hashKey": "object:1100",
              "decimals": 2,
              "format": "s",
              "label": null,
              "logBase": 2,
              "max": null,
              "min": null,
              "show": true
            },
            {
              "$$hashKey": "object:1101",
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": false
            }
          ],
          "yaxis": {
            "align": false,
            "alignLevel": null
          }
        },
        {
          "aliasColors": {
            "Data Total IOPS ": "semi-dark-red"
          },
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "${DS_PROMETHEUS}",
          "decimals": 2,
          "description": "",
          "editable": true,
          "error": false,
          "fill": 7,
          "fillGradient": 0,
          "grid": {},
          "gridPos": {
            "h": 6,
            "w": 8,
            "x": 0,
            "y": 14
          },
          "hiddenSeries": false,
          "id": 1011,
          "legend": {
            "alignAsTable": false,
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "rightSide": false,
            "show": true,
            "sort": "avg",
            "sortDesc": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 2,
          "links": [],
          "nullPointMode": "null",
          "options": {
            "dataLinks": []
          },
          "paceLength": 10,
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [
            {
              "$$hashKey": "object:1575",
              "alias": "Data Written",
              "transform": "negative-Y"
            },
            {
              "$$hashKey": "object:1576",
              "alias": "Data Total Bandwith",
              "legend": false,
              "lines": false
            }
          ],
          "spaceLength": 10,
          "stack": false,
          "steppedLine": true,
          "targets": [
            {
              "calculatedInterval": "2m",
              "datasourceErrors": {},
              "errors": {},
              "expr": "avg by (service_name) (rate(mysql_global_status_innodb_data_read{service_name=~\"$service_name\"}[$interval]) or irate(mysql_global_status_innodb_data_read{service_name=~\"$service_name\"}[5m]))",
              "format": "time_series",
              "interval": "$interval",
              "intervalFactor": 1,
              "legendFormat": "Data Read",
              "metric": "",
              "refId": "C",
              "step": 300
            },
            {
              "calculatedInterval": "2m",
              "datasourceErrors": {},
              "errors": {},
              "expr": "avg by (service_name) (rate(mysql_global_status_innodb_data_written{service_name=~\"$service_name\"}[$interval]) or irate(mysql_global_status_innodb_data_written{service_name=~\"$service_name\"}[5m]))",
              "format": "time_series",
              "interval": "$interval",
              "intervalFactor": 1,
              "legendFormat": "Data Written",
              "metric": "",
              "refId": "D",
              "step": 300
            },
            {
              "expr": "avg by (service_name) ((rate(mysql_global_status_innodb_data_read{service_name=~\"$service_name\"}[$interval]) or irate(mysql_global_status_innodb_data_read{service_name=~\"$service_name\"}[5m]))+ (rate(mysql_global_status_innodb_data_written{service_name=~\"$service_name\"}[$interval]) or irate(mysql_global_status_innodb_data_written{service_name=~\"$service_name\"}[5m])))",
              "format": "time_series",
              "intervalFactor": 1,
              "legendFormat": "Data Total Bandwith",
              "refId": "A"
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeRegions": [],
          "timeShift": null,
          "title": "InnoDB Data Bandwitdh",
          "tooltip": {
            "msResolution": false,
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "$$hashKey": "object:1597",
              "decimals": 2,
              "format": "Bps",
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            },
            {
              "$$hashKey": "object:1598",
              "decimals": 2,
              "format": "short",
              "logBase": 1,
              "max": null,
              "min": 0,
              "show": true
            }
          ],
          "yaxis": {
            "align": false,
            "alignLevel": null
          }
        },
        {
          "aliasColors": {
            "Log Writes": "semi-dark-orange",
            "Log Written": "semi-dark-red"
          },
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "${DS_PROMETHEUS}",
          "decimals": 2,
          "description": "**InnoDB I/O**\n\n_Data Writes_ - The total number of InnoDB data writes.\\\n_Data Reads_ - The total number of InnoDB data reads (OS file reads).\\\n_Log Writes_ - The number of physical writes to the InnoDB redo log file.\\\n_Data Fsyncs_ - The number of fsync() operations. The frequency of fsync() calls is influenced by the setting of the `innodb_flush_method` configuration option.",
          "editable": true,
          "error": false,
          "fill": 0,
          "fillGradient": 0,
          "grid": {},
          "gridPos": {
            "h": 6,
            "w": 8,
            "x": 8,
            "y": 14
          },
          "hiddenSeries": false,
          "id": 1012,
          "legend": {
            "alignAsTable": false,
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "rightSide": false,
            "show": true,
            "sort": "avg",
            "sortDesc": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 2,
          "links": [],
          "nullPointMode": "null",
          "options": {
            "dataLinks": []
          },
          "paceLength": 10,
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [
            {
              "$$hashKey": "object:1753",
              "alias": "Log Written",
              "yaxis": 2
            }
          ],
          "spaceLength": 10,
          "stack": false,
          "steppedLine": true,
          "targets": [
            {
              "calculatedInterval": "2m",
              "datasourceErrors": {},
              "errors": {},
              "expr": "avg by (service_name) (rate(mysql_global_status_innodb_log_writes{service_name=~\"$service_name\"}[$interval]) or irate(mysql_global_status_innodb_log_writes{service_name=~\"$service_name\"}[5m]))",
              "format": "time_series",
              "interval": "$interval",
              "intervalFactor": 1,
              "legendFormat": "Log Writes",
              "metric": "",
              "refId": "B",
              "step": 300
            },
            {
              "expr": "avg by (service_name) (rate(mysql_global_status_innodb_os_log_written{service_name=~\"$service_name\"}[$interval]) or irate(mysql_global_status_innodb_os_log_written{service_name=~\"$service_name\"}[5m]))",
              "format": "time_series",
              "interval": "$interval",
              "intervalFactor": 1,
              "legendFormat": "Log Written",
              "refId": "A"
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeRegions": [],
          "timeShift": null,
          "title": "InnoDB Log IO",
          "tooltip": {
            "msResolution": false,
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "$$hashKey": "object:1766",
              "decimals": 2,
              "format": "ops",
              "logBase": 1,
              "max": null,
              "min": 0,
              "show": true
            },
            {
              "$$hashKey": "object:1767",
              "decimals": 2,
              "format": "Bps",
              "logBase": 1,
              "max": null,
              "min": 0,
              "show": true
            }
          ],
          "yaxis": {
            "align": false,
            "alignLevel": null
          }
        },
        {
          "aliasColors": {
            "Data Fsyncs": "semi-dark-purple",
            "Log Fsyncs": "semi-dark-blue"
          },
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "${DS_PROMETHEUS}",
          "decimals": 2,
          "description": "",
          "editable": true,
          "error": false,
          "fill": 7,
          "fillGradient": 0,
          "grid": {},
          "gridPos": {
            "h": 6,
            "w": 8,
            "x": 16,
            "y": 14
          },
          "hiddenSeries": false,
          "id": 1013,
          "legend": {
            "alignAsTable": false,
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "rightSide": false,
            "show": true,
            "sort": "avg",
            "sortDesc": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 2,
          "links": [],
          "nullPointMode": "null",
          "options": {
            "dataLinks": []
          },
          "paceLength": 10,
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "spaceLength": 10,
          "stack": true,
          "steppedLine": true,
          "targets": [
            {
              "calculatedInterval": "2m",
              "datasourceErrors": {},
              "errors": {},
              "expr": "avg by (service_name) (rate(mysql_global_status_innodb_data_fsyncs{service_name=~\"$service_name\"}[$interval]) or irate(mysql_global_status_innodb_data_fsyncs{service_name=~\"$service_name\"}[5m]))",
              "format": "time_series",
              "interval": "$interval",
              "intervalFactor": 1,
              "legendFormat": "Data Fsyncs",
              "metric": "",
              "refId": "A",
              "step": 300
            },
            {
              "expr": "avg by (service_name) (rate(mysql_global_status_innodb_os_log_fsyncs{service_name=~\"$service_name\"}[$interval]) or irate(mysql_global_status_innodb_os_log_fsyncs{service_name=~\"$service_name\"}[5m]))",
              "format": "time_series",
              "intervalFactor": 1,
              "legendFormat": "Log Fsyncs",
              "refId": "B"
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeRegions": [],
          "timeShift": null,
          "title": "InnoDB FSyncs",
          "tooltip": {
            "msResolution": false,
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "$$hashKey": "object:2019",
              "decimals": 2,
              "format": "ops",
              "logBase": 1,
              "max": null,
              "min": 0,
              "show": true
            },
            {
              "$$hashKey": "object:2020",
              "decimals": 2,
              "format": "short",
              "label": "",
              "logBase": 1,
              "max": null,
              "min": 0,
              "show": true
            }
          ],
          "yaxis": {
            "align": false,
            "alignLevel": null
          }
        },
        {
          "columns": [],
          "datasource": "${DS_CLICKHOUSE}",
          "fontSize": "100%",
          "gridPos": {
            "h": 10,
            "w": 24,
            "x": 0,
            "y": 20
          },
          "id": 1014,
          "links": [],
          "pageSize": null,
          "scroll": true,
          "showHeader": true,
          "sort": {
            "col": 2,
            "desc": true
          },
          "styles": [
            {
              "$$hashKey": "object:3008",
              "alias": "",
              "align": "auto",
              "colorMode": "value",
              "colors": [
                "rgba(255, 255, 255, 0.97)",
                "rgba(237, 129, 40, 0.89)",
                "rgba(245, 54, 54, 0.9)"
              ],
              "dateFormat": "YYYY-MM-DD HH:mm:ss",
              "decimals": 2,
              "link": false,
              "mappingType": 1,
              "pattern": "IOScore",
              "thresholds": [
                "1000",
                "10000"
              ],
              "type": "number",
              "unit": "short"
            },
            {
              "$$hashKey": "object:3730",
              "alias": "",
              "align": "auto",
              "colorMode": "value",
              "colors": [
                "rgba(255, 255, 255, 0.97)",
                "rgba(237, 129, 40, 0.89)",
                "rgba(245, 54, 54, 0.9)"
              ],
              "dateFormat": "YYYY-MM-DD HH:mm:ss",
              "decimals": 2,
              "mappingType": 1,
              "pattern": "Latency_ms",
              "thresholds": [
                "10",
                "30"
              ],
              "type": "number",
              "unit": "ms"
            },
            {
              "$$hashKey": "object:4973",
              "alias": "",
              "align": "auto",
              "colorMode": null,
              "colors": [
                "rgba(245, 54, 54, 0.9)",
                "rgba(237, 129, 40, 0.89)",
                "rgba(50, 172, 45, 0.97)"
              ],
              "dateFormat": "YYYY-MM-DD HH:mm:ss",
              "decimals": 2,
              "link": true,
              "linkTargetBlank": true,
              "linkTooltip": "Analyze Query",
              "linkUrl": "/graph/d/pmm-qan/pmm-query-analytics?var-service_name=$service_name&filter_by=${__cell}&from=$__from&to=$__to",
              "mappingType": 1,
              "pattern": "queryid",
              "thresholds": [],
              "type": "string",
              "unit": "short"
            },
            {
              "$$hashKey": "object:3292",
              "alias": "",
              "align": "auto",
              "colorMode": null,
              "colors": [
                "rgba(245, 54, 54, 0.9)",
                "rgba(237, 129, 40, 0.89)",
                "rgba(50, 172, 45, 0.97)"
              ],
              "dateFormat": "YYYY-MM-DD HH:mm:ss",
              "decimals": 2,
              "mappingType": 1,
              "pattern": "",
              "thresholds": [],
              "type": "number",
              "unit": "short"
            },
            {
              "$$hashKey": "object:2447",
              "alias": "",
              "align": "auto",
              "colorMode": "value",
              "colors": [
                "rgba(255, 255, 255, 0.97)",
                "rgba(237, 129, 40, 0.89)",
                "rgba(245, 54, 54, 0.9)"
              ],
              "decimals": 2,
              "pattern": "InnoDB_Reads",
              "thresholds": [
                "10000000",
                "100000000"
              ],
              "type": "number",
              "unit": "Bps"
            },
            {
              "$$hashKey": "object:3303",
              "alias": "",
              "align": "auto",
              "colorMode": "value",
              "colors": [
                "rgba(252, 252, 252, 0.97)",
                "rgba(237, 129, 40, 0.89)",
                "rgba(245, 54, 54, 0.9)"
              ],
              "dateFormat": "YYYY-MM-DD HH:mm:ss",
              "decimals": 2,
              "mappingType": 1,
              "pattern": "Read_IO_Load",
              "thresholds": [
                "1",
                "5"
              ],
              "type": "number",
              "unit": "short"
            },
            {
              "$$hashKey": "object:3314",
              "alias": "",
              "align": "auto",
              "colorMode": "value",
              "colors": [
                "rgba(255, 255, 255, 0.97)",
                "rgba(237, 129, 40, 0.89)",
                "rgba(245, 54, 54, 0.9)"
              ],
              "dateFormat": "YYYY-MM-DD HH:mm:ss",
              "decimals": 2,
              "mappingType": 1,
              "pattern": "Read_Wait_pct",
              "thresholds": [
                "0.5",
                "0.9"
              ],
              "type": "number",
              "unit": "percentunit"
            },
            {
              "$$hashKey": "object:3325",
              "alias": "",
              "align": "auto",
              "colorMode": null,
              "colors": [
                "rgba(245, 54, 54, 0.9)",
                "rgba(237, 129, 40, 0.89)",
                "rgba(50, 172, 45, 0.97)"
              ],
              "dateFormat": "YYYY-MM-DD HH:mm:ss",
              "decimals": 2,
              "mappingType": 1,
              "pattern": "QPS",
              "thresholds": [],
              "type": "number",
              "unit": "ops"
            }
          ],
          "targets": [
            {
              "database": "pmm",
              "dateLoading": false,
              "dateTimeColDataType": "period_start",
              "dateTimeType": "DATETIME",
              "datetimeLoading": false,
              "format": "table",
              "formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t",
              "interval": "1m",
              "intervalFactor": 1,
              "query": "SELECT\n    queryid,\n    any(fingerprint) Query,\n    (sum(m_innodb_io_r_wait_sum)*100000000+sum(m_innodb_io_r_bytes_sum)+sum(m_innodb_io_r_ops_sum)*16384)/($__to-$__from) IOScore,\n    sum(num_queries)/($__to-$__from)*1000 QPS,\n    sum(m_innodb_io_r_bytes_sum)/($__to-$__from)*1000 as InnoDB_Reads,\n    sum(m_innodb_io_r_wait_sum)/($__to-$__from)*1000 as Read_IO_Load,\n    sum(m_innodb_io_r_wait_sum)/sum(m_query_time_sum) as Read_Wait_pct,\n    sum(m_query_time_sum)/sum(m_query_time_cnt)*1000 as Latency_ms\nFROM $table\nWHERE $timeFilter and service_name='$service_name'\nGROUP BY queryid\nORDER BY IOScore desc limit 50",
              "rawQuery": "SELECT     queryid,     any(fingerprint) Query,     (sum(m_innodb_io_r_wait_sum)*100000000+sum(m_innodb_io_r_bytes_sum)+sum(m_innodb_io_r_ops_sum)*16384)/(1593037233284-1592950833284) IOScore,     sum(num_queries)/(1593037233284-1592950833284)*1000 QPS,     sum(m_innodb_io_r_bytes_sum)/(1593037233284-1592950833284)*1000 as InnoDB_Reads,     sum(m_innodb_io_r_wait_sum)/(1593037233284-1592950833284)*1000 as Read_IO_Load,     sum(m_innodb_io_r_wait_sum)/sum(m_query_time_sum) as Read_Wait_pct,     sum(m_query_time_sum)/sum(m_query_time_cnt)*1000 as Latency_ms FROM pmm.metrics WHERE period_start >= toDateTime(1592952901) and service_name='mysql1-mysql' GROUP BY queryid ORDER BY IOScore desc limit 50",
              "refId": "A",
              "round": "1m",
              "table": "metrics",
              "tableLoading": false
            }
          ],
          "timeFrom": null,
          "timeShift": null,
          "title": "IO Intensive Queries",
          "transform": "table",
          "type": "table"
        }
      ],
      "title": "Disk IO Analyses - $node_name",
      "type": "row"
    },
    {
      "collapsed": true,
      "datasource": "${DS_PROMETHEUS}",
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 8
      },
      "id": 1016,
      "panels": [
        {
          "aliasColors": {},
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "${DS_PROMETHEUS}",
          "decimals": 2,
          "description": "Network traffic refers to the amount of data moving across a network at a given point in time.",
          "editable": true,
          "error": false,
          "fill": 7,
          "fillGradient": 0,
          "grid": {},
          "gridPos": {
            "h": 6,
            "w": 8,
            "x": 0,
            "y": 9
          },
          "hiddenSeries": false,
          "id": 343,
          "legend": {
            "alignAsTable": false,
            "avg": false,
            "current": false,
            "hideEmpty": false,
            "max": false,
            "min": false,
            "rightSide": false,
            "show": true,
            "sort": "avg",
            "sortDesc": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 2,
          "links": [],
          "nullPointMode": "null",
          "options": {
            "dataLinks": []
          },
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [
            {
              "$$hashKey": "object:949",
              "alias": "Outbound",
              "transform": "negative-Y"
            }
          ],
          "spaceLength": 10,
          "stack": false,
          "steppedLine": true,
          "targets": [
            {
              "calculatedInterval": "2s",
              "datasourceErrors": {},
              "errors": {},
              "expr": "sum(rate(node_network_receive_bytes_total{node_name=\"$node_name\", device!=\"lo\"}[$interval])) or sum(irate(node_network_receive_bytes_total{node_name=\"$node_name\", device!=\"lo\"}[5m])) or sum(max_over_time(rdsosmetrics_network_rx{node_name=\"$node_name\"}[$interval])) or sum(max_over_time(rdsosmetrics_network_rx{node_name=\"$node_name\"}[5m])) ",
              "format": "time_series",
              "interval": "$interval",
              "intervalFactor": 1,
              "legendFormat": "Inbound",
              "metric": "",
              "refId": "B",
              "step": 300,
              "target": ""
            },
            {
              "calculatedInterval": "2s",
              "datasourceErrors": {},
              "errors": {},
              "expr": "sum(rate(node_network_transmit_bytes_total{node_name=\"$node_name\", device!=\"lo\"}[$interval])) or sum(irate(node_network_transmit_bytes_total{node_name=\"$node_name\", device!=\"lo\"}[5m])) or\nsum(max_over_time(rdsosmetrics_network_tx{node_name=\"$node_name\"}[$interval])) or sum(max_over_time(rdsosmetrics_network_tx{node_name=\"$node_name\"}[5m]))",
              "format": "time_series",
              "interval": "$interval",
              "intervalFactor": 1,
              "legendFormat": "Outbound",
              "metric": "",
              "refId": "A",
              "step": 300,
              "target": ""
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeRegions": [],
          "timeShift": null,
          "title": "Network Traffic",
          "tooltip": {
            "msResolution": false,
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "$$hashKey": "object:962",
              "decimals": 2,
              "format": "Bps",
              "label": "Outbound (-) / Inbound (+)",
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            },
            {
              "$$hashKey": "object:963",
              "format": "bytes",
              "logBase": 1,
              "max": null,
              "min": 0,
              "show": false
            }
          ],
          "yaxis": {
            "align": false,
            "alignLevel": null
          }
        },
        {
          "aliasColors": {
            "Receive Drop": "#ef843c",
            "Receive Errors": "#890f02",
            "Transmit Drop": "#c15c17",
            "Transmit Errors": "#e24d42"
          },
          "bars": true,
          "dashLength": 10,
          "dashes": false,
          "datasource": "${DS_PROMETHEUS}",
          "decimals": 2,
          "description": "Total Number of Local Network Interface Transmit Errors, Receive Errors and Drops.  Should be  Zero",
          "editable": true,
          "error": false,
          "fill": 6,
          "fillGradient": 0,
          "grid": {},
          "gridPos": {
            "h": 6,
            "w": 8,
            "x": 8,
            "y": 9
          },
          "hiddenSeries": false,
          "id": 1017,
          "legend": {
            "alignAsTable": false,
            "avg": false,
            "current": false,
            "hideEmpty": false,
            "max": false,
            "min": false,
            "rightSide": false,
            "show": true,
            "sort": "avg",
            "sortDesc": true,
            "total": false,
            "values": false
          },
          "lines": false,
          "linewidth": 2,
          "links": [],
          "nullPointMode": "null",
          "options": {
            "dataLinks": [
              {
                "targetBlank": true,
                "title": "Network Details - ${__series.labels.node_name}",
                "url": "/graph/d/node-network/network-details?var-node_name=${__field.labels.node_name}&$__url_time_range"
              }
            ]
          },
          "paceLength": 10,
          "percentage": false,
          "pointradius": 1,
          "points": true,
          "renderer": "flot",
          "seriesOverrides": [],
          "spaceLength": 10,
          "stack": true,
          "steppedLine": false,
          "targets": [
            {
              "calculatedInterval": "2s",
              "datasourceErrors": {},
              "errors": {},
              "expr": "sum(rate(node_network_receive_errs_total{node_name=~\"$node_name\", device!=\"lo\"}[$interval])) or \nsum(irate(node_network_receive_errs_total{node_name=~\"$node_name\", device!=\"lo\"}[5m]))",
              "format": "time_series",
              "hide": false,
              "interval": "$interval",
              "intervalFactor": 1,
              "legendFormat": "Receive Errors",
              "metric": "",
              "refId": "A",
              "step": 3600,
              "target": ""
            },
            {
              "expr": "sum(rate(node_network_transmit_errs_total{node_name=~\"$node_name\", device!=\"lo\"}[$interval])) or\nsum(irate(node_network_transmit_errs_total{node_name=~\"$node_name\", device!=\"lo\"}[5m]))",
              "format": "time_series",
              "interval": "$interval",
              "intervalFactor": 1,
              "legendFormat": "Transmit Errors",
              "refId": "B"
            },
            {
              "expr": "sum(rate(node_network_receive_drop_total{node_name=~\"$node_name\", device!=\"lo\"}[$interval])) or\nsum(irate(node_network_receive_drop_total{node_name=~\"$node_name\", device!=\"lo\"}[5m]))",
              "format": "time_series",
              "interval": "$interval",
              "intervalFactor": 1,
              "legendFormat": "Receive Drop",
              "refId": "C"
            },
            {
              "expr": "sum(rate(node_network_transmit_drop_total{node_name=~\"$node_name\", device!=\"lo\"}[$interval])) or \nsum(irate(node_network_transmit_drop_total{node_name=~\"$node_name\", device!=\"lo\"}[5m]))",
              "format": "time_series",
              "interval": "$interval",
              "intervalFactor": 1,
              "legendFormat": "Transmit Drop",
              "refId": "D"
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeRegions": [],
          "timeShift": null,
          "title": "Local Network Errors",
          "tooltip": {
            "msResolution": false,
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "$$hashKey": "object:1068",
              "decimals": 2,
              "format": "ops",
              "label": "",
              "logBase": 1,
              "max": null,
              "min": 0,
              "show": true
            },
            {
              "$$hashKey": "object:1069",
              "format": "bytes",
              "logBase": 1,
              "max": null,
              "min": 0,
              "show": false
            }
          ],
          "yaxis": {
            "align": false,
            "alignLevel": null
          }
        },
        {
          "aliasColors": {
            "Segments Retransmitted": "#bf1b00"
          },
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "${DS_PROMETHEUS}",
          "decimals": 2,
          "description": "Retransmission, essentially identical with Automatic repeat request (ARQ), is the resending of packets which have been either damaged or lost. Retransmission is one of the basic mechanisms used by protocols operating over a packet switched computer network to provide reliable communication (such as that provided by a reliable byte stream, for example TCP).",
          "editable": true,
          "error": false,
          "fill": 2,
          "fillGradient": 0,
          "grid": {},
          "gridPos": {
            "h": 6,
            "w": 8,
            "x": 16,
            "y": 9
          },
          "hiddenSeries": false,
          "id": 1018,
          "legend": {
            "alignAsTable": false,
            "avg": false,
            "current": false,
            "hideEmpty": false,
            "max": false,
            "min": false,
            "rightSide": false,
            "show": true,
            "sort": "avg",
            "sortDesc": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 2,
          "links": [],
          "nullPointMode": "null",
          "options": {
            "dataLinks": [
              {
                "targetBlank": true,
                "title": "Network Details - ${__series.labels.node_name}",
                "url": "/graph/d/node-network/network-details?var-node_name=${__field.labels.node_name}&$__url_time_range"
              }
            ]
          },
          "paceLength": 10,
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [
            {
              "$$hashKey": "object:1168",
              "alias": "Outbound",
              "transform": "negative-Y"
            },
            {
              "$$hashKey": "object:1169",
              "alias": "Retransmit Ratio",
              "lines": false,
              "pointradius": 1,
              "points": true,
              "yaxis": 2
            }
          ],
          "spaceLength": 10,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "calculatedInterval": "2s",
              "datasourceErrors": {},
              "errors": {},
              "expr": "avg by (node_name) (rate(node_netstat_Tcp_RetransSegs{node_name=~\"$node_name\"}[$interval]) or irate(node_netstat_Tcp_RetransSegs{node_name=~\"$node_name\"}[5m]))",
              "format": "time_series",
              "hide": false,
              "interval": "$interval",
              "intervalFactor": 1,
              "legendFormat": "Segments Retransmitted",
              "metric": "",
              "refId": "B",
              "step": 300,
              "target": ""
            },
            {
              "expr": "avg by (node_name) (rate(node_netstat_Tcp_RetransSegs{node_name=~\"$node_name\"}[$interval])/(rate(node_netstat_Tcp_OutSegs{node_name=~\"$node_name\"}[$interval]) > 0) or irate(node_netstat_Tcp_RetransSegs{node_name=~\"$node_name\"}[5m])/(irate(node_netstat_Tcp_OutSegsSegs{node_name=~\"$node_name\"}[5m]) > 0))",
              "format": "time_series",
              "hide": false,
              "interval": "$interval",
              "intervalFactor": 1,
              "legendFormat": "Retransmit Ratio",
              "refId": "A"
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeRegions": [],
          "timeShift": null,
          "title": "TCP Retransmission",
          "tooltip": {
            "msResolution": false,
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "$$hashKey": "object:1194",
              "decimals": 2,
              "format": "ops",
              "label": "",
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            },
            {
              "$$hashKey": "object:1195",
              "decimals": 2,
              "format": "percentunit",
              "logBase": 1,
              "max": null,
              "min": 0,
              "show": true
            }
          ],
          "yaxis": {
            "align": false,
            "alignLevel": null
          }
        },
        {
          "aliasColors": {},
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "${DS_PROMETHEUS}",
          "decimals": 2,
          "description": "**MySQL Network Traffic**\n\nHere we can see how much network traffic is generated by MySQL. Outbound is network traffic sent from MySQL and Inbound is network traffic MySQL has received.",
          "editable": true,
          "error": false,
          "fill": 6,
          "fillGradient": 0,
          "grid": {},
          "gridPos": {
            "h": 6,
            "w": 8,
            "x": 0,
            "y": 15
          },
          "hiddenSeries": false,
          "id": 9,
          "legend": {
            "alignAsTable": false,
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "rightSide": false,
            "show": true,
            "sort": "avg",
            "sortDesc": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 2,
          "links": [],
          "nullPointMode": "null",
          "options": {
            "dataLinks": []
          },
          "paceLength": 10,
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [
            {
              "$$hashKey": "object:1441",
              "alias": "Outbound",
              "transform": "negative-Y"
            }
          ],
          "spaceLength": 10,
          "stack": false,
          "steppedLine": true,
          "targets": [
            {
              "calculatedInterval": "2m",
              "datasourceErrors": {},
              "errors": {},
              "expr": "avg by (service_name) (rate(mysql_global_status_bytes_received{service_name=~\"$service_name\"}[$interval]) or \nirate(mysql_global_status_bytes_received{service_name=~\"$service_name\"}[5m]))",
              "format": "time_series",
              "interval": "$interval",
              "intervalFactor": 1,
              "legendFormat": "Inbound",
              "metric": "",
              "refId": "A",
              "step": 20
            },
            {
              "calculatedInterval": "2m",
              "datasourceErrors": {},
              "errors": {},
              "expr": "avg by (service_name) (rate(mysql_global_status_bytes_sent{service_name=~\"$service_name\"}[$interval]) or \nirate(mysql_global_status_bytes_sent{service_name=~\"$service_name\"}[5m]))",
              "format": "time_series",
              "interval": "$interval",
              "intervalFactor": 1,
              "legendFormat": "Outbound",
              "metric": "",
              "refId": "B",
              "step": 20
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeRegions": [],
          "timeShift": null,
          "title": "MySQL Network Traffic",
          "tooltip": {
            "msResolution": false,
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "$$hashKey": "object:1416",
              "decimals": 2,
              "format": "Bps",
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            },
            {
              "$$hashKey": "object:1417",
              "format": "none",
              "logBase": 1,
              "max": null,
              "min": 0,
              "show": false
            }
          ],
          "yaxis": {
            "align": false,
            "alignLevel": null
          }
        },
        {
          "aliasColors": {
            "Max Connections": "dark-red"
          },
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "${DS_PROMETHEUS}",
          "decimals": 0,
          "description": "**Max Connections** \n\nMax Connections is the maximum permitted number of simultaneous client connections. By default, this is 151. Increasing this value increases the number of file descriptors that mysqld requires. If the required number of descriptors are not available, the server reduces the value of Max Connections.\n\nmysqld actually permits Max Connections + 1 clients to connect. The extra connection is reserved for use by accounts that have the SUPER privilege, such as root.\n\nMax Used Connections is the maximum number of connections that have been in use simultaneously since the server started.\n\nConnections is the number of connection attempts (successful or not) to the MySQL server.",
          "editable": false,
          "error": false,
          "fill": 0,
          "fillGradient": 0,
          "grid": {},
          "gridPos": {
            "h": 6,
            "w": 8,
            "x": 8,
            "y": 15
          },
          "height": "250px",
          "hiddenSeries": false,
          "id": 92,
          "legend": {
            "alignAsTable": false,
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "show": true,
            "sort": "avg",
            "sortDesc": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 2,
          "links": [
            {
              "targetBlank": true,
              "title": "MySQL Server System Variables",
              "url": "https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_max_connections"
            }
          ],
          "nullPointMode": "null",
          "options": {
            "dataLinks": []
          },
          "paceLength": 10,
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [
            {
              "$$hashKey": "object:2365",
              "alias": "Max Connections",
              "fill": 0
            }
          ],
          "spaceLength": 10,
          "stack": false,
          "steppedLine": true,
          "targets": [
            {
              "calculatedInterval": "2m",
              "datasourceErrors": {},
              "errors": {},
              "expr": "avg by (service_name) (max(max_over_time(mysql_global_status_threads_connected{service_name=~\"$service_name\"}[$interval]) or \nmax_over_time(mysql_global_status_threads_connected{service_name=~\"$service_name\"}[5m])))",
              "format": "time_series",
              "interval": "$interval",
              "intervalFactor": 1,
              "legendFormat": "Current Connections",
              "metric": "",
              "refId": "A",
              "step": 20
            },
            {
              "calculatedInterval": "2m",
              "datasourceErrors": {},
              "errors": {},
              "expr": "avg by (service_name) (max_over_time(mysql_global_status_max_used_connections{service_name=~\"$service_name\"}[$interval]) or \nmax_over_time(mysql_global_status_max_used_connections{service_name=~\"$service_name\"}[5m]))",
              "format": "time_series",
              "hide": false,
              "interval": "$interval",
              "intervalFactor": 1,
              "legendFormat": "Max Used Connections",
              "metric": "",
              "refId": "C",
              "step": 20,
              "target": ""
            },
            {
              "calculatedInterval": "2m",
              "datasourceErrors": {},
              "errors": {},
              "expr": "avg by (service_name) (max_over_time(mysql_global_variables_max_connections{service_name=~\"$service_name\"}[$interval]) or\nmax_over_time(mysql_global_variables_max_connections{service_name=~\"$service_name\"}[5m]))",
              "format": "time_series",
              "hide": false,
              "interval": "$interval",
              "intervalFactor": 1,
              "legendFormat": "Max Connections",
              "metric": "",
              "refId": "B",
              "step": 20,
              "target": ""
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeRegions": [],
          "timeShift": null,
          "title": "MySQL Current Connections",
          "tooltip": {
            "msResolution": false,
            "shared": true,
            "sort": 0,
            "value_type": "cumulative"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "$$hashKey": "object:2378",
              "decimals": 0,
              "format": "short",
              "label": "",
              "logBase": 1,
              "max": null,
              "min": 0,
              "show": true
            },
            {
              "$$hashKey": "object:2379",
              "format": "short",
              "label": "",
              "logBase": 1,
              "max": null,
              "min": 0,
              "show": false
            }
          ],
          "yaxis": {
            "align": false,
            "alignLevel": null
          }
        },
        {
          "aliasColors": {
            "Aborted Connects": "dark-red"
          },
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "${DS_PROMETHEUS}",
          "decimals": 2,
          "description": "",
          "editable": true,
          "error": false,
          "fill": 0,
          "fillGradient": 0,
          "grid": {},
          "gridPos": {
            "h": 6,
            "w": 8,
            "x": 16,
            "y": 15
          },
          "hiddenSeries": false,
          "id": 1020,
          "legend": {
            "alignAsTable": false,
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "show": true,
            "sort": "avg",
            "sortDesc": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 2,
          "links": [],
          "nullPointMode": "null",
          "options": {
            "dataLinks": []
          },
          "paceLength": 10,
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "spaceLength": 10,
          "stack": false,
          "steppedLine": true,
          "targets": [
            {
              "calculatedInterval": "2m",
              "datasourceErrors": {},
              "errors": {},
              "expr": "avg by (service_name) (rate(mysql_global_status_connections{service_name=~\"$service_name\"}[$interval]) or \nirate(mysql_global_status_connections{service_name=~\"$service_name\"}[5m]))",
              "format": "time_series",
              "interval": "$interval",
              "intervalFactor": 1,
              "legendFormat": "New Connections ",
              "metric": "",
              "refId": "A",
              "step": 20
            },
            {
              "calculatedInterval": "2m",
              "datasourceErrors": {},
              "errors": {},
              "expr": "avg by (service_name) (rate(mysql_global_status_aborted_connects{service_name=~\"$service_name\"}[$interval]) or \nirate(mysql_global_status_aborted_connects{service_name=~\"$service_name\"}[5m]))",
              "format": "time_series",
              "interval": "$interval",
              "intervalFactor": 1,
              "legendFormat": "Aborted Connects",
              "metric": "",
              "refId": "B",
              "step": 20
            }
          ],
          "thresholds": [
            {
              "$$hashKey": "object:2058",
              "colorMode": "warning",
              "fill": true,
              "line": true,
              "op": "gt",
              "value": 1000,
              "yaxis": "left"
            }
          ],
          "timeFrom": null,
          "timeRegions": [],
          "timeShift": null,
          "title": "MySQL  Connections",
          "tooltip": {
            "msResolution": false,
            "shared": true,
            "sort": 0,
            "value_type": "cumulative"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "$$hashKey": "object:1876",
              "decimals": 2,
              "format": "ops",
              "label": "",
              "logBase": 1,
              "max": null,
              "min": 0,
              "show": true
            },
            {
              "$$hashKey": "object:1877",
              "format": "short",
              "label": "",
              "logBase": 1,
              "max": null,
              "min": 0,
              "show": false
            }
          ],
          "yaxis": {
            "align": false,
            "alignLevel": null
          }
        },
        {
          "columns": [],
          "datasource": "${DS_CLICKHOUSE}",
          "fontSize": "100%",
          "gridPos": {
            "h": 10,
            "w": 24,
            "x": 0,
            "y": 21
          },
          "id": 1019,
          "links": [],
          "pageSize": null,
          "scroll": true,
          "showHeader": true,
          "sort": {
            "col": 2,
            "desc": true
          },
          "styles": [
            {
              "$$hashKey": "object:3008",
              "alias": "",
              "align": "auto",
              "colorMode": "value",
              "colors": [
                "rgba(255, 255, 255, 0.97)",
                "rgba(237, 129, 40, 0.89)",
                "rgba(245, 54, 54, 0.9)"
              ],
              "dateFormat": "YYYY-MM-DD HH:mm:ss",
              "decimals": 2,
              "link": false,
              "mappingType": 1,
              "pattern": "NetScore",
              "thresholds": [
                "10000",
                "100000"
              ],
              "type": "number",
              "unit": "short"
            },
            {
              "$$hashKey": "object:3730",
              "alias": "",
              "align": "auto",
              "colorMode": "value",
              "colors": [
                "rgba(255, 255, 255, 0.97)",
                "rgba(237, 129, 40, 0.89)",
                "rgba(245, 54, 54, 0.9)"
              ],
              "dateFormat": "YYYY-MM-DD HH:mm:ss",
              "decimals": 2,
              "mappingType": 1,
              "pattern": "Latency_ms",
              "thresholds": [
                "10",
                "30"
              ],
              "type": "number",
              "unit": "ms"
            },
            {
              "$$hashKey": "object:4973",
              "alias": "",
              "align": "auto",
              "colorMode": null,
              "colors": [
                "rgba(245, 54, 54, 0.9)",
                "rgba(237, 129, 40, 0.89)",
                "rgba(50, 172, 45, 0.97)"
              ],
              "dateFormat": "YYYY-MM-DD HH:mm:ss",
              "decimals": 2,
              "link": true,
              "linkTargetBlank": true,
              "linkTooltip": "Analyze Query",
              "linkUrl": "/graph/d/pmm-qan/pmm-query-analytics?var-service_name=$service_name&filter_by=${__cell}&from=$__from&to=$__to",
              "mappingType": 1,
              "pattern": "queryid",
              "thresholds": [],
              "type": "string",
              "unit": "short"
            },
            {
              "$$hashKey": "object:2447",
              "alias": "",
              "align": "auto",
              "colorMode": "value",
              "colors": [
                "rgba(255, 255, 255, 0.97)",
                "rgba(237, 129, 40, 0.89)",
                "rgba(245, 54, 54, 0.9)"
              ],
              "decimals": 2,
              "pattern": "Bytes_Sent",
              "thresholds": [
                "10000000",
                "100000000"
              ],
              "type": "number",
              "unit": "Bps"
            },
            {
              "$$hashKey": "object:3303",
              "alias": "",
              "align": "auto",
              "colorMode": "value",
              "colors": [
                "rgba(252, 252, 252, 0.97)",
                "rgba(237, 129, 40, 0.89)",
                "rgba(245, 54, 54, 0.9)"
              ],
              "dateFormat": "YYYY-MM-DD HH:mm:ss",
              "decimals": 2,
              "mappingType": 1,
              "pattern": "Sent_Per_Query",
              "thresholds": [
                "100000",
                "1000000"
              ],
              "type": "number",
              "unit": "bytes"
            },
            {
              "$$hashKey": "object:3325",
              "alias": "",
              "align": "auto",
              "colorMode": null,
              "colors": [
                "rgba(245, 54, 54, 0.9)",
                "rgba(237, 129, 40, 0.89)",
                "rgba(50, 172, 45, 0.97)"
              ],
              "dateFormat": "YYYY-MM-DD HH:mm:ss",
              "decimals": 2,
              "mappingType": 1,
              "pattern": "QPS",
              "thresholds": [],
              "type": "number",
              "unit": "ops"
            }
          ],
          "targets": [
            {
              "database": "pmm",
              "dateLoading": false,
              "dateTimeColDataType": "period_start",
              "dateTimeType": "DATETIME",
              "datetimeLoading": false,
              "format": "table",
              "formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t",
              "interval": "1m",
              "intervalFactor": 1,
              "query": "SELECT\n    queryid,\n    any(fingerprint) Query,\n    (sum(m_bytes_sent_sum)+sum(num_queries*1024))/($__to-$__from) NetScore,\n    sum(num_queries)/($__to-$__from)*1000 QPS,\n    sum(m_bytes_sent_sum)/($__to-$__from)*1000 as Bytes_Sent,\n    sum(m_bytes_sent_sum)/sum(m_bytes_sent_cnt) as Sent_Per_Query,\n    sum(m_query_time_sum)/sum(m_query_time_cnt)*1000 as Latency_ms\nFROM $table\nWHERE $timeFilter and service_name='$service_name'\nGROUP BY queryid\nORDER BY NetScore desc limit 50",
              "rawQuery": "SELECT     queryid,     any(fingerprint) Query,     (sum(num_queries)*100+sum(m_rows_examined_sum)+sum(m_rows_affected_sum)*10)/(1594570998110-1594527798110) CPUScore,     sum(num_queries)/(1594570998110-1594527798110)*1000 QPS,     sum(m_rows_examined_sum)/(1594570998110-1594527798110)*1000 as Rows_examined,     sum(m_rows_affected_sum)/(1594570998110-1594527798110)*1000 as Rows_affected,     sum(m_query_time_sum)/sum(m_query_time_cnt)*1000 as Latency_ms FROM pmm.metrics WHERE period_start >= toDateTime(1594530121) and service_name='mysql1-mysql' GROUP BY queryid ORDER BY CPUScore desc limit 50",
              "refId": "A",
              "round": "1m",
              "table": "metrics",
              "tableLoading": false
            }
          ],
          "timeFrom": null,
          "timeShift": null,
          "title": "Network Intensive Queries",
          "transform": "table",
          "type": "table"
        }
      ],
      "title": "Network Analyses - $node_name",
      "type": "row"
    },
    {
      "collapsed": true,
      "datasource": "${DS_PROMETHEUS}",
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 9
      },
      "id": 1022,
      "panels": [
        {
          "aliasColors": {
            "Cached": "#1f78c1",
            "Free": "#508642",
            "Total": "#bf1b00",
            "Used": "#eab839"
          },
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "${DS_PROMETHEUS}",
          "decimals": 2,
          "editable": true,
          "error": false,
          "fill": 6,
          "fillGradient": 0,
          "grid": {},
          "gridPos": {
            "h": 6,
            "w": 8,
            "x": 0,
            "y": 10
          },
          "height": "",
          "hiddenSeries": false,
          "id": 1023,
          "legend": {
            "alignAsTable": false,
            "avg": false,
            "current": false,
            "hideEmpty": false,
            "max": false,
            "min": false,
            "rightSide": false,
            "show": true,
            "sort": "avg",
            "sortDesc": false,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 2,
          "links": [],
          "nullPointMode": "null",
          "options": {
            "dataLinks": [
              {
                "targetBlank": true,
                "title": "Memory Details - ${__series.labels.node_name}",
                "url": "/graph/d/node-memory/memory-details?var-node_name=${__field.labels.node_name}&$__url_time_range"
              }
            ]
          },
          "paceLength": 10,
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [
            {
              "$$hashKey": "object:539",
              "alias": "Total",
              "color": "#C4162A",
              "fill": 0,
              "legend": false,
              "stack": false
            },
            {
              "$$hashKey": "object:540",
              "alias": "Free",
              "color": "#508642"
            },
            {
              "$$hashKey": "object:541",
              "alias": "Cache",
              "color": "#1f78c1"
            },
            {
              "$$hashKey": "object:542",
              "alias": "Used",
              "color": "#eab839"
            },
            {
              "$$hashKey": "object:543",
              "alias": "Buffers",
              "color": "#A352CC"
            }
          ],
          "spaceLength": 10,
          "stack": true,
          "steppedLine": true,
          "targets": [
            {
              "calculatedInterval": "2s",
              "datasourceErrors": {},
              "errors": {},
              "expr": "avg by (node_name) (max_over_time(node_memory_MemFree_bytes{node_name=~\"$node_name\"}[$interval]) or max_over_time(node_memory_MemFree_bytes{node_name=~\"$node_name\"}[5m]))",
              "format": "time_series",
              "interval": "$interval",
              "intervalFactor": 1,
              "legendFormat": "Free",
              "metric": "",
              "refId": "B",
              "step": 300,
              "target": ""
            },
            {
              "calculatedInterval": "2s",
              "datasourceErrors": {},
              "errors": {},
              "expr": "avg by (node_name) (max_over_time(node_memory_Buffers_bytes{node_name=~\"$node_name\"}[$interval]) or max_over_time(node_memory_Buffers_bytes{node_name=~\"$node_name\"}[5m]))",
              "format": "time_series",
              "interval": "$interval",
              "intervalFactor": 1,
              "legendFormat": "Buffers",
              "metric": "",
              "refId": "D",
              "step": 300,
              "target": ""
            },
            {
              "calculatedInterval": "2s",
              "datasourceErrors": {},
              "errors": {},
              "expr": "clamp_min(avg by (node_name) (((max_over_time(node_memory_MemTotal_bytes{node_name=~\"$node_name\"}[$interval]) or max_over_time(node_memory_MemTotal_bytes{node_name=~\"$node_name\"}[5m])) - ((max_over_time(node_memory_MemFree_bytes{node_name=~\"$node_name\"}[$interval]) or max_over_time(node_memory_MemFree_bytes{node_name=~\"$node_name\"}[5m]))+ \n(max_over_time(node_memory_Buffers_bytes{node_name=~\"$node_name\"}[$interval]) or max_over_time(node_memory_Buffers_bytes{node_name=~\"$node_name\"}[5m])) + \n(max_over_time(node_memory_Cached_bytes{node_name=~\"$node_name\"}[$interval]) or max_over_time(node_memory_Cached_bytes{node_name=~\"$node_name\"}[5m]))))),0)",
              "format": "time_series",
              "hide": false,
              "interval": "$interval",
              "intervalFactor": 1,
              "legendFormat": "Used",
              "metric": "",
              "refId": "A",
              "step": 300,
              "target": ""
            },
            {
              "expr": "avg by (node_name) (max(max_over_time(node_memory_Cached_bytes{node_name=~\"$node_name\",job=~\"rds.*|node.*\"}[$interval]) or max_over_time(node_memory_Cached_bytes{node_name=~\"$node_name\",job=~\"rds.*|node.*\"}[5m])) without (job))",
              "interval": "$interval",
              "legendFormat": "Cache",
              "refId": "F"
            },
            {
              "expr": "avg by (node_name) (max_over_time(node_memory_MemTotal_bytes{node_name=~\"$node_name\"}[$interval]) or max_over_time(node_memory_MemTotal_bytes{node_name=~\"$node_name\"}[5m]))",
              "format": "time_series",
              "interval": "$interval",
              "intervalFactor": 1,
              "legendFormat": "Total",
              "refId": "C"
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeRegions": [],
          "timeShift": null,
          "title": "Memory Utilization",
          "tooltip": {
            "msResolution": false,
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "$$hashKey": "object:586",
              "decimals": 2,
              "format": "bytes",
              "label": "",
              "logBase": 1,
              "max": null,
              "min": 0,
              "show": true
            },
            {
              "$$hashKey": "object:587",
              "format": "bytes",
              "logBase": 1,
              "max": null,
              "min": 0,
              "show": false
            }
          ],
          "yaxis": {
            "align": false,
            "alignLevel": null
          }
        },
        {
          "aliasColors": {
            "Available": "#629e51",
            "Total": "#bf1b00",
            "Used": "#eab839"
          },
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "${DS_PROMETHEUS}",
          "decimals": 2,
          "editable": true,
          "error": false,
          "fill": 6,
          "fillGradient": 0,
          "grid": {},
          "gridPos": {
            "h": 6,
            "w": 8,
            "x": 8,
            "y": 10
          },
          "height": "",
          "hiddenSeries": false,
          "id": 1024,
          "legend": {
            "alignAsTable": false,
            "avg": false,
            "current": false,
            "hideEmpty": false,
            "max": false,
            "min": false,
            "rightSide": false,
            "show": true,
            "sort": "avg",
            "sortDesc": false,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 2,
          "links": [
            {
              "targetBlank": true,
              "title": "Memory Overview",
              "url": "/graph/d/node-memory/memory-details?$__url_time_range&$__all_variables"
            }
          ],
          "nullPointMode": "null",
          "options": {
            "dataLinks": [
              {
                "targetBlank": true,
                "title": "Memory Details - ${__series.labels.node_name}",
                "url": "/graph/d/node-memory/memory-details?var-node_name=${__field.labels.node_name}&$__url_time_range"
              }
            ]
          },
          "paceLength": 10,
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [
            {
              "$$hashKey": "object:661",
              "alias": "Total",
              "color": "#bf1b00",
              "fill": 0,
              "legend": false,
              "stack": false
            },
            {
              "$$hashKey": "object:662",
              "alias": "Used",
              "color": "#eab839"
            },
            {
              "$$hashKey": "object:663",
              "alias": "Available",
              "color": "#508642"
            }
          ],
          "spaceLength": 10,
          "stack": true,
          "steppedLine": true,
          "targets": [
            {
              "calculatedInterval": "2s",
              "datasourceErrors": {},
              "errors": {},
              "expr": "avg by (node_name) ((max_over_time(node_memory_MemTotal_bytes{node_name=~\"$node_name\"}[$interval]) or max_over_time(node_memory_MemTotal_bytes{node_name=~\"$node_name\"}[5m])) + \n(max_over_time(node_memory_SwapTotal_bytes{node_name=~\"$node_name\"}[$interval]) or max_over_time(node_memory_SwapTotal_bytes{node_name=~\"$node_name\"}[5m])))",
              "format": "time_series",
              "hide": false,
              "interval": "$interval",
              "intervalFactor": 1,
              "legendFormat": "Total",
              "metric": "",
              "refId": "C",
              "step": 300,
              "target": ""
            },
            {
              "calculatedInterval": "2s",
              "datasourceErrors": {},
              "errors": {},
              "expr": "avg by (node_name) (\n(max_over_time(node_memory_MemAvailable_bytes{node_name=~\"$node_name\"}[$interval]) or max_over_time(node_memory_MemAvailable_bytes{node_name=~\"$node_name\"}[5m])) or \n((max_over_time(node_memory_MemFree_bytes{node_name=~\"$node_name\"}[$interval]) or max_over_time(node_memory_MemFree_bytes{node_name=~\"$node_name\"}[5m]))+ \n(max_over_time(node_memory_Buffers_bytes{node_name=~\"$node_name\"}[$interval]) or max_over_time(node_memory_Buffers_bytes{node_name=~\"$node_name\"}[5m]))+ \n(max_over_time(node_memory_Cached_bytes{node_name=~\"$node_name\"}[$interval]) or max_over_time(node_memory_Cached_bytes{node_name=~\"$node_name\"}[5m])) + \n(max_over_time(node_memory_SwapFree_bytes{node_name=~\"$node_name\"}[$interval]) or max_over_time(node_memory_SwapFree_bytes{node_name=~\"$node_name\"}[5m]))))",
              "format": "time_series",
              "hide": false,
              "interval": "$interval",
              "intervalFactor": 1,
              "legendFormat": "Available",
              "metric": "",
              "refId": "B",
              "step": 300,
              "target": ""
            },
            {
              "expr": "avg by (node_name) (((max_over_time(node_memory_MemTotal_bytes{node_name=~\"$node_name\"}[$interval]) or max_over_time(node_memory_MemTotal_bytes{node_name=~\"$node_name\"}[5m])) + \n(max_over_time(node_memory_SwapTotal_bytes{node_name=~\"$node_name\"}[$interval]) or max_over_time(node_memory_SwapTotal_bytes{node_name=~\"$node_name\"}[5m]))) - \n((max_over_time(node_memory_MemAvailable_bytes{node_name=~\"$node_name\"}[$interval]) or max_over_time(node_memory_MemAvailable_bytes{node_name=~\"$node_name\"}[5m])) or \n(((max_over_time(node_memory_MemFree_bytes{node_name=~\"$node_name\"}[$interval]) or max_over_time(node_memory_MemFree_bytes{node_name=~\"$node_name\"}[5m]))+ \n(max_over_time(node_memory_Buffers_bytes{node_name=~\"$node_name\"}[$interval]) or max_over_time(node_memory_Buffers_bytes{node_name=~\"$node_name\"}[5m]))+ \n(max_over_time(node_memory_Cached_bytes{node_name=~\"$node_name\"}[$interval]) or max_over_time(node_memory_Cached_bytes{node_name=~\"$node_name\"}[5m]))) + \n(max_over_time(node_memory_SwapFree_bytes{node_name=~\"$node_name\"}[$interval]) or max_over_time(node_memory_SwapFree_bytes{node_name=~\"$node_name\"}[5m]))))\n)",
              "interval": "$interval",
              "legendFormat": "Used",
              "refId": "D"
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeRegions": [],
          "timeShift": null,
          "title": "Virtual Memory Utilization",
          "tooltip": {
            "msResolution": false,
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "$$hashKey": "object:694",
              "decimals": 2,
              "format": "bytes",
              "label": "",
              "logBase": 1,
              "max": null,
              "min": 0,
              "show": true
            },
            {
              "$$hashKey": "object:695",
              "format": "bytes",
              "logBase": 1,
              "max": null,
              "min": 0,
              "show": false
            }
          ],
          "yaxis": {
            "align": false,
            "alignLevel": null
          }
        },
        {
          "aliasColors": {
            "Total": "#bf1b00",
            "Total ": "#bf1b00"
          },
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "${DS_PROMETHEUS}",
          "decimals": 2,
          "description": "Swap Activity is memory management that involves swapping sections of memory to and from physical storage.",
          "editable": true,
          "error": false,
          "fill": 6,
          "fillGradient": 0,
          "grid": {},
          "gridPos": {
            "h": 6,
            "w": 8,
            "x": 16,
            "y": 10
          },
          "hiddenSeries": false,
          "id": 1025,
          "legend": {
            "alignAsTable": false,
            "avg": false,
            "current": false,
            "hideEmpty": false,
            "max": false,
            "min": false,
            "rightSide": false,
            "show": true,
            "sort": "avg",
            "sortDesc": false,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 2,
          "links": [],
          "nullPointMode": "null",
          "options": {
            "dataLinks": [
              {
                "targetBlank": true,
                "title": "Memory Details - ${__series.labels.node_name}",
                "url": "/graph/d/node-memory/memory-details?var-node_name=${__field.labels.node_name}&$__url_time_range"
              }
            ]
          },
          "paceLength": 10,
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [
            {
              "$$hashKey": "object:765",
              "alias": "Swap Out (Writes)",
              "transform": "negative-Y"
            },
            {
              "$$hashKey": "object:766",
              "alias": "Total",
              "legend": false,
              "lines": false
            }
          ],
          "spaceLength": 10,
          "stack": false,
          "steppedLine": true,
          "targets": [
            {
              "calculatedInterval": "2s",
              "datasourceErrors": {},
              "errors": {},
              "expr": "avg by (node_name) (rate(node_vmstat_pswpin{node_name=~\"$node_name\"}[$interval]) * 4096 or irate(node_vmstat_pswpin{node_name=~\"$node_name\"}[5m]) * 4096)",
              "format": "time_series",
              "interval": "$interval",
              "intervalFactor": 1,
              "legendFormat": "Swap In (Reads)",
              "metric": "",
              "refId": "A",
              "step": 300,
              "target": ""
            },
            {
              "calculatedInterval": "2s",
              "datasourceErrors": {},
              "errors": {},
              "expr": "avg by (node_name) (rate(node_vmstat_pswpout{node_name=~\"$node_name\"}[$interval]) * 4096 or irate(node_vmstat_pswpout{node_name=~\"$node_name\"}[5m]) * 4096)",
              "format": "time_series",
              "interval": "$interval",
              "intervalFactor": 1,
              "legendFormat": "Swap Out (Writes)",
              "metric": "",
              "refId": "B",
              "step": 300,
              "target": ""
            },
            {
              "expr": "avg by (node_name) ((rate(node_vmstat_pswpin{node_name=~\"$node_name\"}[$interval]) * 4096 or irate(node_vmstat_pswpin{node_name=~\"$node_name\"}[5m]) * 4096) + (rate(node_vmstat_pswpout{node_name=~\"$node_name\"}[$interval]) * 4096 or irate(node_vmstat_pswpout{node_name=~\"$node_name\"}[5m]) * 4096))",
              "format": "time_series",
              "interval": "$interval",
              "intervalFactor": 1,
              "legendFormat": "Total",
              "refId": "C"
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeRegions": [],
          "timeShift": null,
          "title": "Swap Activity",
          "tooltip": {
            "msResolution": false,
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "$$hashKey": "object:787",
              "decimals": 2,
              "format": "Bps",
              "label": "Swap out (-) / Swap in (+)",
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            },
            {
              "$$hashKey": "object:788",
              "format": "bytes",
              "logBase": 1,
              "max": null,
              "min": 0,
              "show": false
            }
          ],
          "yaxis": {
            "align": false,
            "alignLevel": null
          }
        },
        {
          "aliasColors": {},
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "${DS_PROMETHEUS}",
          "decimals": 0,
          "description": "***System Memory***: Total Memory for the system.\\\n***InnoDB Buffer Pool Data***: InnoDB maintains a storage area called the buffer pool for caching data and indexes in memory.\\\n***TokuDB Cache Size***: Similar in function to the InnoDB Buffer Pool,  TokuDB will allocate 50% of the installed RAM for its own cache.\\\n***Key Buffer Size***: Index blocks for MYISAM tables are buffered and are shared by all threads. key_buffer_size is the size of the buffer used for index blocks.\\\n***Adaptive Hash Index Size***: When InnoDB notices that some index values are being accessed very frequently, it builds a hash index for them in memory on top of B-Tree indexes.\\\n ***Query Cache Size***: The query cache stores the text of a SELECT statement together with the corresponding result that was sent to the client. The query cache has huge scalability problems in that only one thread can do an operation in the query cache at the same time.\\\n***InnoDB Dictionary Size***: The data dictionary is InnoDB ‘s internal catalog of tables. InnoDB stores the data dictionary on disk, and loads entries into memory while the server is running.\\\n***InnoDB Log Buffer Size***: The MySQL InnoDB log buffer allows transactions to run without having to write the log to disk before the transactions commit.",
          "editable": true,
          "error": false,
          "fill": 6,
          "fillGradient": 0,
          "grid": {},
          "gridPos": {
            "h": 8,
            "w": 24,
            "x": 0,
            "y": 16
          },
          "hiddenSeries": false,
          "id": 50,
          "interval": "",
          "legend": {
            "alignAsTable": true,
            "avg": true,
            "current": false,
            "hideEmpty": true,
            "hideZero": true,
            "max": true,
            "min": true,
            "rightSide": true,
            "show": true,
            "sort": "avg",
            "sortDesc": true,
            "total": false,
            "values": true
          },
          "lines": true,
          "linewidth": 2,
          "links": [
            {
              "title": "Detailed descriptions about metrics",
              "url": "https://www.percona.com/doc/percona-monitoring-and-management/dashboard.mysql-overview.html#mysql-internal-memory-overview"
            }
          ],
          "nullPointMode": "null",
          "options": {
            "dataLinks": []
          },
          "paceLength": 10,
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [
            {
              "$$hashKey": "object:853",
              "alias": "System Memory",
              "fill": 0,
              "stack": false
            }
          ],
          "spaceLength": 10,
          "stack": true,
          "steppedLine": true,
          "targets": [
            {
              "expr": "avg by (service_name) (max_over_time(node_memory_MemTotal_bytes{node_name=\"$node_name\"}[$interval]) or \nmax_over_time(node_memory_MemTotal_bytes{node_name=\"$node_name\"}[5m]))",
              "format": "time_series",
              "interval": "$interval",
              "intervalFactor": 1,
              "legendFormat": "System Memory",
              "refId": "G",
              "step": 4
            },
            {
              "expr": "avg by (service_name) (max_over_time(mysql_global_status_innodb_page_size{service_name=~\"$service_name\"}[$interval]) or\nmax_over_time(mysql_global_status_innodb_page_size{service_name=~\"$service_name\"}[5m])) * on (service_name) \navg by (service_name) (max_over_time(mysql_global_status_buffer_pool_pages{service_name=~\"$service_name\",state=\"data\"}[$interval]) or\nmax_over_time(mysql_global_status_buffer_pool_pages{service_name=~\"$service_name\",state=\"data\"}[5m]))",
              "format": "time_series",
              "hide": false,
              "interval": "$interval",
              "intervalFactor": 1,
              "legendFormat": "InnoDB Buffer Pool Data",
              "refId": "A",
              "step": 20
            },
            {
              "expr": "avg by (service_name) (max_over_time(mysql_global_variables_innodb_log_buffer_size{service_name=~\"$service_name\"}[$interval]) or \nmax_over_time(mysql_global_variables_innodb_log_buffer_size{service_name=~\"$service_name\"}[5m]))",
              "format": "time_series",
              "interval": "$interval",
              "intervalFactor": 1,
              "legendFormat": "InnoDB Log Buffer Size",
              "refId": "D",
              "step": 20
            },
            {
              "expr": "avg by (service_name) (max_over_time(mysql_global_variables_innodb_additional_mem_pool_size{service_name=~\"$service_name\"}[$interval]) or \nmax_over_time(mysql_global_variables_innodb_additional_mem_pool_size{service_name=~\"$service_name\"}[5m]))",
              "format": "time_series",
              "interval": "$interval",
              "intervalFactor": 1,
              "legendFormat": "InnoDB Additional Memory Pool Size",
              "refId": "H",
              "step": 40
            },
            {
              "expr": "avg by (service_name) (max_over_time(mysql_global_status_innodb_mem_dictionary{service_name=~\"$service_name\"}[$interval]) or\nmax_over_time(mysql_global_status_innodb_mem_dictionary{service_name=~\"$service_name\"}[5m]))",
              "format": "time_series",
              "interval": "$interval",
              "intervalFactor": 1,
              "legendFormat": "InnoDB Dictionary Size",
              "refId": "F",
              "step": 20
            },
            {
              "expr": "avg by (service_name) (max_over_time(mysql_global_variables_key_buffer_size{service_name=~\"$service_name\"}[$interval]) or \nmax_over_time(mysql_global_variables_key_buffer_size{service_name=~\"$service_name\"}[5m]))",
              "format": "time_series",
              "interval": "$interval",
              "intervalFactor": 1,
              "legendFormat": "Key Buffer Size",
              "refId": "B",
              "step": 20
            },
            {
              "expr": "avg by (service_name) (max_over_time(mysql_global_variables_query_cache_size{service_name=~\"$service_name\"}[$interval]) or\nmax_over_time(mysql_global_variables_query_cache_size{service_name=~\"$service_name\"}[5m]))",
              "format": "time_series",
              "interval": "$interval",
              "intervalFactor": 1,
              "legendFormat": "Query Cache Size",
              "refId": "C",
              "step": 20
            },
            {
              "expr": "avg by (service_name) (max_over_time(mysql_global_status_innodb_mem_adaptive_hash{service_name=~\"$service_name\"}[$interval]) or\nmax_over_time(mysql_global_status_innodb_mem_adaptive_hash{service_name=~\"$service_name\"}[5m]))",
              "format": "time_series",
              "interval": "$interval",
              "intervalFactor": 1,
              "legendFormat": "Adaptive Hash Index Size",
              "refId": "E",
              "step": 20
            },
            {
              "expr": "avg by (service_name) (max_over_time(mysql_global_variables_tokudb_cache_size{service_name=~\"$service_name\"}[$interval]) or\nmax_over_time(mysql_global_variables_tokudb_cache_size{service_name=~\"$service_name\"}[5m]))",
              "format": "time_series",
              "hide": false,
              "interval": "$interval",
              "intervalFactor": 1,
              "legendFormat": "TokuDB Cache Size",
              "refId": "I",
              "step": 20
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeRegions": [],
          "timeShift": null,
          "title": "MySQL Internal Memory Overview",
          "tooltip": {
            "msResolution": false,
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "$$hashKey": "object:868",
              "decimals": 2,
              "format": "bytes",
              "label": "",
              "logBase": 1,
              "max": null,
              "min": 0,
              "show": true
            },
            {
              "$$hashKey": "object:869",
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": false
            }
          ],
          "yaxis": {
            "align": false,
            "alignLevel": null
          }
        },
        {
          "columns": [],
          "datasource": "${DS_CLICKHOUSE}",
          "fontSize": "100%",
          "gridPos": {
            "h": 10,
            "w": 24,
            "x": 0,
            "y": 24
          },
          "id": 1026,
          "links": [],
          "pageSize": null,
          "scroll": true,
          "showHeader": true,
          "sort": {
            "col": 2,
            "desc": true
          },
          "styles": [
            {
              "$$hashKey": "object:3008",
              "alias": "",
              "align": "auto",
              "colorMode": "value",
              "colors": [
                "rgba(255, 255, 255, 0.97)",
                "rgba(237, 129, 40, 0.89)",
                "rgba(245, 54, 54, 0.9)"
              ],
              "dateFormat": "YYYY-MM-DD HH:mm:ss",
              "decimals": 2,
              "link": false,
              "mappingType": 1,
              "pattern": "MemScore",
              "thresholds": [
                "10000",
                "100000"
              ],
              "type": "number",
              "unit": "short"
            },
            {
              "$$hashKey": "object:3730",
              "alias": "",
              "align": "auto",
              "colorMode": "value",
              "colors": [
                "rgba(255, 255, 255, 0.97)",
                "rgba(237, 129, 40, 0.89)",
                "rgba(245, 54, 54, 0.9)"
              ],
              "dateFormat": "YYYY-MM-DD HH:mm:ss",
              "decimals": 2,
              "mappingType": 1,
              "pattern": "Latency_ms",
              "thresholds": [
                "10",
                "30"
              ],
              "type": "number",
              "unit": "ms"
            },
            {
              "$$hashKey": "object:4973",
              "alias": "",
              "align": "auto",
              "colorMode": null,
              "colors": [
                "rgba(245, 54, 54, 0.9)",
                "rgba(237, 129, 40, 0.89)",
                "rgba(50, 172, 45, 0.97)"
              ],
              "dateFormat": "YYYY-MM-DD HH:mm:ss",
              "decimals": 2,
              "link": true,
              "linkTargetBlank": true,
              "linkTooltip": "Analyze Query",
              "linkUrl": "/graph/d/pmm-qan/pmm-query-analytics?var-service_name=$service_name&filter_by=${__cell}&from=$__from&to=$__to",
              "mappingType": 1,
              "pattern": "queryid",
              "thresholds": [],
              "type": "string",
              "unit": "short"
            },
            {
              "$$hashKey": "object:2447",
              "alias": "",
              "align": "auto",
              "colorMode": "value",
              "colors": [
                "rgba(255, 255, 255, 0.97)",
                "rgba(237, 129, 40, 0.89)",
                "rgba(245, 54, 54, 0.9)"
              ],
              "decimals": 2,
              "pattern": "Filesort_required",
              "thresholds": [
                "10000000",
                "100000000"
              ],
              "type": "number",
              "unit": "ops"
            },
            {
              "$$hashKey": "object:3303",
              "alias": "",
              "align": "auto",
              "colorMode": "value",
              "colors": [
                "rgba(252, 252, 252, 0.97)",
                "rgba(237, 129, 40, 0.89)",
                "rgba(245, 54, 54, 0.9)"
              ],
              "dateFormat": "YYYY-MM-DD HH:mm:ss",
              "decimals": 2,
              "mappingType": 1,
              "pattern": "Temp_Tables_Created",
              "thresholds": [
                "100000",
                "1000000"
              ],
              "type": "number",
              "unit": "ops"
            },
            {
              "$$hashKey": "object:3325",
              "alias": "",
              "align": "auto",
              "colorMode": null,
              "colors": [
                "rgba(245, 54, 54, 0.9)",
                "rgba(237, 129, 40, 0.89)",
                "rgba(50, 172, 45, 0.97)"
              ],
              "dateFormat": "YYYY-MM-DD HH:mm:ss",
              "decimals": 2,
              "mappingType": 1,
              "pattern": "QPS",
              "thresholds": [],
              "type": "number",
              "unit": "ops"
            }
          ],
          "targets": [
            {
              "database": "pmm",
              "dateLoading": false,
              "dateTimeColDataType": "period_start",
              "dateTimeType": "DATETIME",
              "datetimeLoading": false,
              "format": "table",
              "formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t",
              "interval": "1m",
              "intervalFactor": 1,
              "query": "SELECT\n    queryid,\n    any(fingerprint) Query,\n    (sum(m_filesort_sum*100)+sum(m_sort_rows_sum*10)+sum(m_innodb_pages_distinct_sum*100)+sum(m_tmp_tables_sum*10000)+sum(m_tmp_table_sizes_sum))/($__to-$__from) MemScore,\n    sum(num_queries)/($__to-$__from)*1000 QPS,\n    sum(m_filesort_sum)/($__to-$__from)*1000 as Filesort_required,\n    sum(m_tmp_table_sum)/($__to-$__from)*1000 as Temp_Tables_Created,\n    sum(m_query_time_sum)/sum(m_query_time_cnt)*1000 as Latency_ms\nFROM $table\nWHERE $timeFilter and service_name='$service_name'\nGROUP BY queryid\nORDER BY MemScore desc limit 50",
              "rawQuery": "SELECT     queryid,     any(fingerprint) Query,     (sum(m_filesort_sum*100)+sum(m_sort_rows_sum*10)+sum(m_innodb_pages_distinct_sum*100)+sum(m_tmp_tables_sum*10000)+sum(m_tmp_table_sizes_sum))/(1594575020159-1594531820158) MemScore,     sum(num_queries)/(1594575020159-1594531820158)*1000 QPS,     sum(m_filesort_sum)/(1594575020159-1594531820158)*1000 as Filesort_required,     sum(m_tmp_table_sum)/(1594575020159-1594531820158)*1000 as Temp_Tables_Created,     sum(m_query_time_sum)/sum(m_query_time_cnt)*1000 as Latency_ms FROM pmm.metrics WHERE period_start >= toDateTime(1594533301) and service_name='mysql1-mysql' GROUP BY queryid ORDER BY MemScore desc limit 50",
              "refId": "A",
              "round": "1m",
              "table": "metrics",
              "tableLoading": false
            }
          ],
          "timeFrom": null,
          "timeShift": null,
          "title": "Memory Intensive Queries",
          "transform": "table",
          "type": "table"
        }
      ],
      "title": "Memory Analyses - $node_name",
      "type": "row"
    },
    {
      "collapsed": true,
      "datasource": "${DS_PROMETHEUS}",
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 10
      },
      "id": 382,
      "panels": [
        {
          "aliasColors": {
            "Context Switches": "semi-dark-orange"
          },
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "${DS_PROMETHEUS}",
          "decimals": 2,
          "description": "\nContext switch is the process of storing the state of a process or thread, so that it can be restored and resume execution at a later point. This allows multiple processes to share a single CPU, and is an essential feature of a multitasking operating system.",
          "editable": true,
          "error": false,
          "fill": 0,
          "fillGradient": 0,
          "grid": {},
          "gridPos": {
            "h": 6,
            "w": 8,
            "x": 0,
            "y": 35
          },
          "hiddenSeries": false,
          "id": 1029,
          "legend": {
            "alignAsTable": false,
            "avg": false,
            "current": false,
            "hideEmpty": false,
            "max": false,
            "min": false,
            "rightSide": false,
            "show": true,
            "sort": "avg",
            "sortDesc": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 2,
          "links": [],
          "nullPointMode": "null",
          "options": {
            "dataLinks": [
              {
                "targetBlank": true,
                "title": "CPU Utilization Details - ${__series.labels.node_name}",
                "url": "/graph/d/node-cpu/cpu-utilization-details?var-node_name=${__field.labels.node_name}&$__url_time_range"
              }
            ]
          },
          "paceLength": 10,
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [
            {
              "$$hashKey": "object:636",
              "alias": "Context Switches per Virtual CPU",
              "legend": false,
              "lines": false
            }
          ],
          "spaceLength": 10,
          "stack": false,
          "steppedLine": true,
          "targets": [
            {
              "calculatedInterval": "2m",
              "datasourceErrors": {},
              "errors": {},
              "expr": "avg by (node_name) (rate(node_context_switches_total{node_name=~\"$node_name\"}[$interval]) or irate(node_context_switches_total{node_name=~\"$node_name\"}[5m]))",
              "format": "time_series",
              "interval": "$interval",
              "intervalFactor": 1,
              "legendFormat": "Context Switches",
              "metric": "",
              "refId": "A",
              "step": 300,
              "target": ""
            },
            {
              "expr": "avg by (node_name) ((rate(node_context_switches_total{node_name=~\"$node_name\"}[$interval]) or irate(node_context_switches_total{node_name=~\"$node_name\"}[5m])) / scalar(count(node_cpu_seconds_total{mode=\"user\", node_name=~\"$node_name\"})))",
              "format": "time_series",
              "interval": "$interval",
              "intervalFactor": 1,
              "legendFormat": "Context Switches per Virtual CPU",
              "refId": "B",
              "step": 60
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeRegions": [],
          "timeShift": null,
          "title": " Context Switches",
          "tooltip": {
            "msResolution": false,
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "$$hashKey": "object:649",
              "decimals": 2,
              "format": "short",
              "label": "",
              "logBase": 1,
              "max": null,
              "min": 0,
              "show": true
            },
            {
              "$$hashKey": "object:650",
              "format": "short",
              "logBase": 1,
              "max": null,
              "min": 0,
              "show": false
            }
          ],
          "yaxis": {
            "align": false,
            "alignLevel": null
          }
        },
        {
          "aliasColors": {
            "Avg Row Lock Wait Time": "dark-blue",
            "Deadlocks": "dark-red",
            "MySQL Threads Active": "dark-purple",
            "Row Lock Wait Load": "dark-red",
            "{agent_id=\"/agent_id/95fda7c0-2dcb-411e-9234-188e21d48cf8\",agent_type=\"mysqld_exporter\",az=\"myaz\",environment=\"mytest\",instance=\"/agent_id/95fda7c0-2dcb-411e-9234-188e21d48cf8\",job=\"mysqld_exporter_agent_id_95fda7c0-2dcb-411e-9234-188e21d48cf8_hr\",machine_id=\"/machine_id/612892249edc4cf7b40cdfd1534feded\n\",node_id=\"/node_id/de9fbe04-9d61-41f5-945b-fdef6faa48b1\",node_model=\"linode1024\",node_name=\"mysql2\",node_type=\"generic\",region=\"datacenter4\",service_id=\"/service_id/31b436ad-06f3-449b-94ad-ebee4f900dbc\",service_name=\"mysql2-mysql\",service_type=\"mysql\"}": "dark-orange",
            "{agent_id=\"/agent_id/a6b0fd4d-d64b-493c-a86d-56393238a74b\",agent_type=\"mysqld_exporter\",az=\"myaz\",environment=\"mytest\",instance=\"/agent_id/a6b0fd4d-d64b-493c-a86d-56393238a74b\",job=\"mysqld_exporter_agent_id_a6b0fd4d-d64b-493c-a86d-56393238a74b_hr\",machine_id=\"/machine_id/612892249edc4cf7b40cdfd1534feded\n\",node_id=\"/node_id/1f984570-e740-4bf1-ad30-33bd48344ba6\",node_model=\"linode1024\",node_name=\"mysql3\",node_type=\"generic\",region=\"datacenter4\",service_id=\"/service_id/bf0cce40-c19b-4b37-b5c0-d69f8514ac97\",service_name=\"mysql3-mysql\",service_type=\"mysql\"}": "dark-purple"
          },
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": "${DS_PROMETHEUS}",
          "decimals": 2,
          "description": "Average Number of Sessions blocked from proceeding due to waiting on row level lock",
          "editable": true,
          "error": false,
          "fill": 2,
          "fillGradient": 0,
          "grid": {},
          "gridPos": {
            "h": 6,
            "w": 8,
            "x": 8,
            "y": 35
          },
          "hiddenSeries": false,
          "id": 1030,
          "legend": {
            "alignAsTable": false,
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "rightSide": false,
            "show": true,
            "sort": "avg",
            "sortDesc": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 2,
          "links": [],
          "nullPointMode": "null",
          "options": {
            "dataLinks": []
          },
          "paceLength": 10,
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [
            {
              "$$hashKey": "object:1699",
              "alias": "MySQL Threads Active",
              "fill": 0
            }
          ],
          "spaceLength": 10,
          "stack": false,
          "steppedLine": true,
          "targets": [
            {
              "calculatedInterval": "2m",
              "datasourceErrors": {},
              "errors": {},
              "expr": "avg by (service_name) (rate(mysql_global_status_innodb_row_lock_time{service_name=~\"$service_name\"}[$interval])/1000 or irate(mysql_global_status_innodb_row_lock_time{service_name=~\"$service_name\"}[5m])/1000)",
              "format": "time_series",
              "interval": "$interval",
              "intervalFactor": 1,
              "legendFormat": "Row Lock Wait Load",
              "metric": "",
              "refId": "B",
              "step": 300
            },
            {
              "expr": "avg by (service_name) (((avg_over_time(mysql_global_status_threads_running{service_name=~\"$service_name\"}[$interval]))or (avg_over_time(mysql_global_status_threads_running{service_name=~\"$service_name\"}[5m]))))",
              "interval": "$interval",
              "legendFormat": "MySQL Threads Active",
              "refId": "A"
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeRegions": [],
          "timeShift": null,
          "title": "Innodb Row Lock Wait Load",
          "tooltip": {
            "msResolution": false,
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "$$hashKey": "object:1712",
              "decimals": 2,
              "format": "none",
              "logBase": 1,
              "max": null,
              "min": 0,
              "show": true
            },
            {
              "$$hashKey": "object:1713",
              "format": "short",
              "logBase": 1,
              "max": null,
              "min": 0,
              "show": false
            }
          ],
          "yaxis": {
            "align": false,
            "alignLevel": null
          }
        },
        {
          "aliasColors": {
            "Blocked Sessions Percent": "semi-dark-blue"
          },
          "bars": false,
          "cacheTimeout": null,
          "dashLength": 10,
          "dashes": false,
          "datasource": "${DS_PROMETHEUS}",
          "description": "Percent of Active Sections which are blocked due to waiting on Innodb Row Locks",
          "fill": 0,
          "fillGradient": 0,
          "gridPos": {
            "h": 6,
            "w": 8,
            "x": 16,
            "y": 35
          },
          "hiddenSeries": false,
          "id": 1031,
          "legend": {
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "show": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 1,
          "links": [],
          "nullPointMode": "null",
          "options": {
            "dataLinks": []
          },
          "percentage": false,
          "pointradius": 2,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "spaceLength": 10,
          "stack": false,
          "steppedLine": true,
          "targets": [
            {
              "calculatedInterval": "10m",
              "datasourceErrors": {},
              "errors": {},
              "expr": "avg by (service_name) ((rate(mysql_global_status_innodb_row_lock_time{service_name=~\"$service_name\"}[$interval])/1000 or irate(mysql_global_status_innodb_row_lock_time{service_name=~\"$service_name\"}[5m])/1000)/((avg_over_time(mysql_global_status_threads_running{service_name=~\"$service_name\"}[$interval]))or (avg_over_time(mysql_global_status_threads_running{service_name=~\"$service_name\"}[5m]))))",
              "format": "time_series",
              "interval": "$interval",
              "intervalFactor": 1,
              "legendFormat": "Blocked Sessions Percent",
              "metric": "",
              "refId": "A",
              "step": 300
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeRegions": [],
          "timeShift": null,
          "title": "Row Lock Blocking",
          "tooltip": {
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "buckets": null,
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "$$hashKey": "object:1540",
              "decimals": 2,
              "format": "percentunit",
              "label": "",
              "logBase": 1,
              "max": "1",
              "min": null,
              "show": true
            },
            {
              "$$hashKey": "object:1541",
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": false
            }
          ],
          "yaxis": {
            "align": false,
            "alignLevel": null
          }
        },
        {
          "columns": [],
          "datasource": "${DS_CLICKHOUSE}",
          "fontSize": "100%",
          "gridPos": {
            "h": 10,
            "w": 24,
            "x": 0,
            "y": 41
          },
          "id": 1032,
          "links": [],
          "pageSize": null,
          "scroll": true,
          "showHeader": true,
          "sort": {
            "col": 2,
            "desc": true
          },
          "styles": [
            {
              "$$hashKey": "object:3008",
              "alias": "",
              "align": "auto",
              "colorMode": "value",
              "colors": [
                "rgba(255, 255, 255, 0.97)",
                "rgba(237, 129, 40, 0.89)",
                "rgba(245, 54, 54, 0.9)"
              ],
              "dateFormat": "YYYY-MM-DD HH:mm:ss",
              "decimals": 2,
              "link": false,
              "mappingType": 1,
              "pattern": "LockScore",
              "thresholds": [
                "1000",
                "10000"
              ],
              "type": "number",
              "unit": "short"
            },
            {
              "$$hashKey": "object:3730",
              "alias": "",
              "align": "auto",
              "colorMode": "value",
              "colors": [
                "rgba(255, 255, 255, 0.97)",
                "rgba(237, 129, 40, 0.89)",
                "rgba(245, 54, 54, 0.9)"
              ],
              "dateFormat": "YYYY-MM-DD HH:mm:ss",
              "decimals": 2,
              "mappingType": 1,
              "pattern": "Latency_ms",
              "thresholds": [
                "10",
                "30"
              ],
              "type": "number",
              "unit": "ms"
            },
            {
              "$$hashKey": "object:4973",
              "alias": "",
              "align": "auto",
              "colorMode": null,
              "colors": [
                "rgba(245, 54, 54, 0.9)",
                "rgba(237, 129, 40, 0.89)",
                "rgba(50, 172, 45, 0.97)"
              ],
              "dateFormat": "YYYY-MM-DD HH:mm:ss",
              "decimals": 2,
              "link": true,
              "linkTargetBlank": true,
              "linkTooltip": "Analyze Query",
              "linkUrl": "/graph/d/pmm-qan/pmm-query-analytics?var-service_name=$service_name&filter_by=${__cell}&from=$__from&to=$__to",
              "mappingType": 1,
              "pattern": "queryid",
              "thresholds": [],
              "type": "string",
              "unit": "short"
            },
            {
              "$$hashKey": "object:2447",
              "alias": "",
              "align": "auto",
              "colorMode": "value",
              "colors": [
                "rgba(255, 255, 255, 0.97)",
                "rgba(237, 129, 40, 0.89)",
                "rgba(245, 54, 54, 0.9)"
              ],
              "decimals": 2,
              "pattern": "Row_Lock_Load",
              "thresholds": [
                "10000000",
                "100000000"
              ],
              "type": "number",
              "unit": "short"
            },
            {
              "$$hashKey": "object:3303",
              "alias": "",
              "align": "auto",
              "colorMode": "value",
              "colors": [
                "rgba(252, 252, 252, 0.97)",
                "rgba(237, 129, 40, 0.89)",
                "rgba(245, 54, 54, 0.9)"
              ],
              "dateFormat": "YYYY-MM-DD HH:mm:ss",
              "decimals": 2,
              "mappingType": 1,
              "pattern": "Other_Lock_Load",
              "thresholds": [
                "100000",
                "1000000"
              ],
              "type": "number",
              "unit": "short"
            },
            {
              "$$hashKey": "object:3325",
              "alias": "",
              "align": "auto",
              "colorMode": null,
              "colors": [
                "rgba(245, 54, 54, 0.9)",
                "rgba(237, 129, 40, 0.89)",
                "rgba(50, 172, 45, 0.97)"
              ],
              "dateFormat": "YYYY-MM-DD HH:mm:ss",
              "decimals": 2,
              "mappingType": 1,
              "pattern": "QPS",
              "thresholds": [],
              "type": "number",
              "unit": "ops"
            },
            {
              "$$hashKey": "object:2701",
              "alias": "",
              "align": "auto",
              "colorMode": "value",
              "colors": [
                "rgba(247, 247, 247, 0.97)",
                "rgba(237, 129, 40, 0.89)",
                "rgba(245, 54, 54, 0.9)"
              ],
              "dateFormat": "YYYY-MM-DD HH:mm:ss",
              "decimals": 2,
              "mappingType": 1,
              "pattern": "Lock_wait_pct",
              "thresholds": [
                "0.2",
                "0.5"
              ],
              "type": "number",
              "unit": "percentunit"
            }
          ],
          "targets": [
            {
              "database": "pmm",
              "dateLoading": false,
              "dateTimeColDataType": "period_start",
              "dateTimeType": "DATETIME",
              "datetimeLoading": false,
              "format": "table",
              "formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t",
              "interval": "1m",
              "intervalFactor": 1,
              "query": "SELECT\n    queryid,\n    any(fingerprint) Query,\n    (sum(m_lock_time_sum*1000000)+sum(m_rows_affected_sum)+sum(m_innodb_rec_lock_wait_sum*1000000))/($__to-$__from) LockScore,\n    sum(num_queries)/($__to-$__from)*1000 QPS,\n    sum(m_innodb_rec_lock_wait_sum)/($__to-$__from)*1000 as Row_Lock_Load,\n    sum(m_lock_time_sum-m_innodb_rec_lock_wait_sum)/($__to-$__from)*1000 as Other_Lock_Load,\n    sum(m_lock_time_sum)/sum(m_query_time_sum) as Lock_wait_pct,\n    sum(m_query_time_sum)/sum(m_query_time_cnt)*1000 as Latency_ms\nFROM $table\nWHERE $timeFilter and service_name='$service_name'\nGROUP BY queryid\nORDER BY LockScore desc limit 50",
              "rawQuery": "SELECT     queryid,     any(fingerprint) Query,     (sum(m_lock_time_sum*1000000)+sum(m_rows_affected_sum)+sum(m_innodb_rec_lock_wait_sum*1000000))/(1594588615821-1594545415821) LockScore,     sum(num_queries)/(1594588615821-1594545415821)*1000 QPS,     sum(m_innodb_rec_lock_wait_sum)/(1594588615821-1594545415821)*1000 as Row_Lock_Load,     sum(m_lock_time_sum-m_innodb_rec_lock_wait_sum)/(1594588615821-1594545415821)*1000 as Other_Lock_Load,     sum(m_lock_time_sum)/sum(m_query_time_sum) as Lock_wait_pct,     sum(m_query_time_sum)/sum(m_query_time_cnt)*1000 as Latency_ms FROM pmm.metrics WHERE period_start >= toDateTime(1594545241) and service_name='mysql1-mysql' GROUP BY queryid ORDER BY LockScore desc limit 50",
              "refId": "A",
              "round": "1m",
              "table": "metrics",
              "tableLoading": false
            }
          ],
          "timeFrom": null,
          "timeShift": null,
          "title": "Locking Intensive Queries",
          "transform": "table",
          "type": "table"
        }
      ],
      "repeat": null,
      "title": "Locking Analyses - $node_name",
      "type": "row"
    }
  ],
  "refresh": false,
  "schemaVersion": 22,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": [
      {
        "allFormat": "glob",
        "auto": true,
        "auto_count": 200,
        "auto_min": "1s",
        "current": {
          "selected": false,
          "text": "auto",
          "value": "$__auto_interval_interval"
        },
        "datasource": "Prometheus",
        "hide": 0,
        "includeAll": false,
        "label": "Interval",
        "multi": false,
        "multiFormat": "glob",
        "name": "interval",
        "options": [
          {
            "selected": true,
            "text": "auto",
            "value": "$__auto_interval_interval"
          },
          {
            "selected": false,
            "text": "1s",
            "value": "1s"
          },
          {
            "selected": false,
            "text": "5s",
            "value": "5s"
          },
          {
            "selected": false,
            "text": "1m",
            "value": "1m"
          },
          {
            "selected": false,
            "text": "5m",
            "value": "5m"
          },
          {
            "selected": false,
            "text": "1h",
            "value": "1h"
          },
          {
            "selected": false,
            "text": "6h",
            "value": "6h"
          },
          {
            "selected": false,
            "text": "1d",
            "value": "1d"
          }
        ],
        "query": "1s,5s,1m,5m,1h,6h,1d",
        "refresh": 2,
        "skipUrlSync": false,
        "type": "interval"
      },
      {
        "allValue": ".*",
        "current": {},
        "datasource": "${DS_PROMETHEUS}",
        "definition": "label_values(mysql_up, environment)",
        "hide": 0,
        "includeAll": true,
        "index": -1,
        "label": "Environment",
        "multi": true,
        "name": "environment",
        "options": [],
        "query": "label_values(mysql_up, environment)",
        "refresh": 2,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allFormat": "glob",
        "allValue": null,
        "current": {},
        "datasource": "${DS_PROMETHEUS}",
        "definition": "label_values(mysql_up{environment=~\"$environment\",service_name=~\"$service_name\"}, node_name)",
        "hide": 2,
        "includeAll": false,
        "index": -1,
        "label": "Node Name",
        "multi": false,
        "multiFormat": "regex values",
        "name": "node_name",
        "options": [],
        "query": "label_values(mysql_up{environment=~\"$environment\",service_name=~\"$service_name\"}, node_name)",
        "refresh": 2,
        "refresh_on_load": false,
        "regex": "",
        "skipUrlSync": false,
        "sort": 1,
        "tagValuesQuery": null,
        "tags": [],
        "tagsQuery": null,
        "type": "query",
        "useTags": false
      },
      {
        "allFormat": "glob",
        "allValue": null,
        "current": {},
        "datasource": "${DS_PROMETHEUS}",
        "definition": "label_values(mysql_up{node_name=~\"$node_name\"}, node_name)",
        "hide": 2,
        "includeAll": false,
        "index": -1,
        "label": "Node Name",
        "multi": false,
        "multiFormat": "regex values",
        "name": "crop_host",
        "options": [],
        "query": "label_values(mysql_up{node_name=~\"$node_name\"}, node_name)",
        "refresh": 2,
        "refresh_on_load": false,
        "regex": "/(.?.?.?.?.?.?.?.?.?.?.?.?.?).*/",
        "skipUrlSync": false,
        "sort": 1,
        "tagValuesQuery": null,
        "tags": [],
        "tagsQuery": null,
        "type": "query",
        "useTags": false
      },
      {
        "allFormat": "glob",
        "allValue": null,
        "current": {},
        "datasource": "${DS_PROMETHEUS}",
        "definition": "label_values(mysql_up{environment=~\"$environment\"}, service_name)",
        "hide": 0,
        "includeAll": false,
        "index": -1,
        "label": "Service Name",
        "multi": false,
        "multiFormat": "regex values",
        "name": "service_name",
        "options": [],
        "query": "label_values(mysql_up{environment=~\"$environment\"}, service_name)",
        "refresh": 2,
        "refresh_on_load": false,
        "regex": "",
        "skipUrlSync": false,
        "sort": 1,
        "tagValuesQuery": null,
        "tags": [],
        "tagsQuery": null,
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_PROMETHEUS}",
        "definition": "label_values(mysql_up{node_name=~\"$node_name\"}, region)",
        "hide": 2,
        "includeAll": false,
        "index": -1,
        "label": "Region",
        "multi": false,
        "name": "region",
        "options": [],
        "query": "label_values(mysql_up{node_name=~\"$node_name\"}, region)",
        "refresh": 2,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_PROMETHEUS}",
        "definition": "label_values(mysql_up{service_name=~\"$service_name\"}, cluster)",
        "hide": 2,
        "includeAll": false,
        "index": -1,
        "label": "Cluster",
        "multi": false,
        "name": "cluster",
        "options": [],
        "query": "label_values(mysql_up{service_name=~\"$service_name\"}, cluster)",
        "refresh": 2,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_PROMETHEUS}",
        "definition": "label_values(mysql_up{node_name=\"$node_name\"}, node_id)",
        "hide": 2,
        "includeAll": false,
        "index": -1,
        "label": "Node_ID",
        "multi": false,
        "name": "node_id",
        "options": [],
        "query": "label_values(mysql_up{node_name=\"$node_name\"}, node_id)",
        "refresh": 2,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_PROMETHEUS}",
        "definition": "label_values(mysql_up{node_name=\"$node_name\"}, instance)",
        "hide": 2,
        "includeAll": false,
        "index": -1,
        "label": "Agent_ID",
        "multi": false,
        "name": "agent_id",
        "options": [],
        "query": "label_values(mysql_up{node_name=\"$node_name\"}, instance)",
        "refresh": 2,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_PROMETHEUS}",
        "definition": "label_values(mysql_up{service_name=~\"$service_name\"}, service_id)",
        "hide": 2,
        "includeAll": false,
        "index": -1,
        "label": "Service_ID",
        "multi": false,
        "name": "service_id",
        "options": [],
        "query": "label_values(mysql_up{service_name=~\"$service_name\"}, service_id)",
        "refresh": 2,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_PROMETHEUS}",
        "definition": "label_values(mysql_up{node_name=\"$node_name\"}, az)",
        "hide": 2,
        "includeAll": false,
        "index": -1,
        "label": "Az",
        "multi": false,
        "name": "az",
        "options": [],
        "query": "label_values(mysql_up{node_name=\"$node_name\"}, az)",
        "refresh": 2,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_PROMETHEUS}",
        "definition": "label_values(mysql_up{node_name=\"$node_name\"}, node_type)",
        "hide": 2,
        "includeAll": false,
        "index": -1,
        "label": "Node_type",
        "multi": false,
        "name": "node_type",
        "options": [],
        "query": "label_values(mysql_up{node_name=\"$node_name\"}, node_type)",
        "refresh": 2,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_PROMETHEUS}",
        "definition": "label_values(mysql_up{node_name=\"$node_name\"}, node_model)",
        "hide": 2,
        "includeAll": false,
        "index": -1,
        "label": "Node_model",
        "multi": false,
        "name": "node_model",
        "options": [],
        "query": "label_values(mysql_up{node_name=\"$node_name\"}, node_model)",
        "refresh": 2,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_PROMETHEUS}",
        "definition": "label_values(mysql_up{service_name=~\"$service_name\"}, replication_set)",
        "hide": 2,
        "includeAll": false,
        "index": -1,
        "label": "Replication Set",
        "multi": false,
        "name": "replication_set",
        "options": [],
        "query": "label_values(mysql_up{service_name=~\"$service_name\"}, replication_set)",
        "refresh": 2,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_PROMETHEUS}",
        "definition": "query_result(mysql_version_info{service_name=~\"$service_name\"})",
        "hide": 2,
        "includeAll": false,
        "index": -1,
        "label": null,
        "multi": false,
        "name": "version",
        "options": [],
        "query": "query_result(mysql_version_info{service_name=~\"$service_name\"})",
        "refresh": 2,
        "regex": "/(([0-9\\.]+)\\.([0-9\\.]+)\\.([0-9\\.]+)-?([0-9?]+))/",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_PROMETHEUS}",
        "definition": "label_values({__name__=~\"pg_up|mysql_up|mongodb_up|proxysql_mysql_status_active_transactions\"}, service_type)",
        "hide": 2,
        "includeAll": true,
        "index": -1,
        "label": "Type",
        "multi": true,
        "name": "service_type",
        "options": [],
        "query": "label_values({__name__=~\"pg_up|mysql_up|mongodb_up|proxysql_mysql_status_active_transactions\"}, service_type)",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_PROMETHEUS}",
        "definition": "label_values(pg_stat_database_tup_fetched{service_name=~\"$service_name\",datname!~\"template.*|postgres\"},datname)",
        "hide": 2,
        "includeAll": true,
        "index": -1,
        "label": "Database",
        "multi": true,
        "name": "database",
        "options": [],
        "query": "label_values(pg_stat_database_tup_fetched{service_name=~\"$service_name\",datname!~\"template.*|postgres\"},datname)",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_PROMETHEUS}",
        "definition": "label_values({__name__=~\"pg_up|mysql_up|mongodb_up|proxysql_mysql_status_active_transactions\"}, schema)",
        "hide": 2,
        "includeAll": true,
        "index": -1,
        "label": "Schema",
        "multi": true,
        "name": "schema",
        "options": [],
        "query": "label_values({__name__=~\"pg_up|mysql_up|mongodb_up|proxysql_mysql_status_active_transactions\"}, schema)",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      }
    ]
  },
  "time": {
    "from": "now-12h",
    "to": "now"
  },
  "timepicker": {
    "collapse": false,
    "enable": true,
    "hidden": false,
    "notice": false,
    "now": true,
    "refresh_intervals": [
      "5s",
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ],
    "status": "Stable",
    "time_options": [
      "5m",
      "15m",
      "1h",
      "6h",
      "12h",
      "24h",
      "2d",
      "7d",
      "30d"
    ],
    "type": "timepicker"
  },
  "timezone": "browser",
  "title": "MySQL Query Performance Troubleshooting (Designed for PMM2)",
  "uid": "RUKBlJZGz",
  "variables": {
    "list": []
  },
  "version": 33,
  "description": "This dashboards allows you to troubleshoot queries which are heavy on system resources CPU,  Disk, Network, Memory or which cause extensive Locking on the database level"
}