Grafana dashboard: Used | Wasted Resources
Description: Dashboard to show the resource requests vs allocatable in the cluster


{
  "__inputs": [
    {
      "name": "DS_PROMETHEUS",
      "label": "Prometheus",
      "description": "",
      "type": "datasource",
      "pluginId": "prometheus",
      "pluginName": "Prometheus"
    }
  ],
  "__elements": [],
  "__requires": [
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "8.5.2"
    },
    {
      "type": "panel",
      "id": "graph",
      "name": "Graph (old)",
      "version": ""
    },
    {
      "type": "datasource",
      "id": "prometheus",
      "name": "Prometheus",
      "version": "1.0.0"
    },
    {
      "type": "panel",
      "id": "stat",
      "name": "Stat",
      "version": ""
    },
    {
      "type": "panel",
      "id": "table-old",
      "name": "Table (old)",
      "version": ""
    }
  ],
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": {
          "type": "datasource",
          "uid": "grafana"
        },
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "target": {
          "limit": 100,
          "matchAny": false,
          "tags": [],
          "type": "dashboard"
        },
        "type": "dashboard"
      }
    ]
  },
  "description": "Dashboard to show the resource requests vs allocatable in the cluster",
  "editable": true,
  "fiscalYearStartMonth": 0,
  "gnetId": 16379,
  "graphTooltip": 0,
  "id": null,
  "iteration": 1654157028819,
  "links": [],
  "liveNow": false,
  "panels": [
    {
      "collapsed": false,
      "datasource": {
        "type": "datasource",
        "uid": "grafana"
      },
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "id": 31,
      "panels": [],
      "title": "Cluster Wide",
      "type": "row"
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "description": "This represents the total [memory resource requests](https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#meaning-of-memory) in the cluster.\nFor comparison the total [allocatable memory](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/node-allocatable.md) is also shown.",
      "fieldConfig": {
        "defaults": {
          "links": []
        },
        "overrides": []
      },
      "fill": 1,
      "fillGradient": 0,
      "gridPos": {
        "h": 10,
        "w": 7,
        "x": 0,
        "y": 1
      },
      "hiddenSeries": false,
      "id": 3,
      "legend": {
        "avg": false,
        "current": false,
        "max": false,
        "min": false,
        "show": true,
        "total": false,
        "values": false
      },
      "lines": true,
      "linewidth": 1,
      "links": [],
      "nullPointMode": "null",
      "options": {
        "alertThreshold": true
      },
      "percentage": false,
      "pluginVersion": "8.5.2",
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "expr": "min(sum(kube_node_status_allocatable{resource=\"memory\"} / 1024 ) by (instance))",
          "format": "time_series",
          "hide": false,
          "intervalFactor": 2,
          "legendFormat": "Allocatable Memory",
          "refId": "A",
          "step": 10
        },
        {
          "expr": "sum(\nsum(kube_pod_container_resource_requests{resource=\"memory\"} / 1024 ) by (exported_pod)\n * on (exported_pod) group_left()  (sum(kube_pod_status_phase{phase=\"Running\"}) by (exported_pod) == 1)\n )",
          "format": "time_series",
          "intervalFactor": 1,
          "legendFormat": "Requested Memory",
          "refId": "C"
        },
        {
          "expr": "min(sum(kube_node_status_capacity_memory_bytes / 1024 ) by (instance))",
          "format": "time_series",
          "intervalFactor": 1,
          "legendFormat": "Total Memory",
          "refId": "B"
        },
        {
          "expr": "sum(kube_metrics_server_pods_mem)",
          "format": "time_series",
          "intervalFactor": 1,
          "legendFormat": "Used Memory",
          "refId": "D"
        }
      ],
      "thresholds": [],
      "timeRegions": [],
      "title": "Memory",
      "tooltip": {
        "shared": true,
        "sort": 2,
        "value_type": "individual"
      },
      "transparent": true,
      "type": "graph",
      "xaxis": {
        "mode": "time",
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "kbytes",
          "label": "Memory",
          "logBase": 1,
          "show": true
        },
        {
          "format": "short",
          "logBase": 1,
          "show": true
        }
      ],
      "yaxis": {
        "align": false
      }
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "fixedColor": "rgb(31, 120, 193)",
            "mode": "fixed"
          },
          "mappings": [
            {
              "options": {
                "match": "null",
                "result": {
                  "text": "N/A"
                }
              },
              "type": "special"
            }
          ],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "decbytes"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 5,
        "w": 4,
        "x": 7,
        "y": 1
      },
      "id": 20,
      "links": [],
      "maxDataPoints": 100,
      "options": {
        "colorMode": "none",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "horizontal",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "textMode": "auto"
      },
      "pluginVersion": "8.5.2",
      "targets": [
        {
          "expr": "sum(kube_node_status_allocatable{resource=\"memory\"})",
          "format": "time_series",
          "intervalFactor": 1,
          "legendFormat": "",
          "refId": "A"
        }
      ],
      "title": "Allocatable Memory",
      "transparent": true,
      "type": "stat"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "fixedColor": "rgb(31, 120, 193)",
            "mode": "fixed"
          },
          "mappings": [
            {
              "options": {
                "match": "null",
                "result": {
                  "text": "N/A"
                }
              },
              "type": "special"
            }
          ],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "decbytes"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 5,
        "w": 4,
        "x": 12,
        "y": 1
      },
      "id": 51,
      "links": [],
      "maxDataPoints": 100,
      "options": {
        "colorMode": "none",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "horizontal",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "textMode": "auto"
      },
      "pluginVersion": "8.5.2",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "expr": "sum(kube_pod_container_resource_requests{resource=\"memory\"}) by (exported_pod)\n",
          "format": "time_series",
          "intervalFactor": 1,
          "legendFormat": "",
          "refId": "A"
        }
      ],
      "title": "Requested Memory",
      "transparent": true,
      "type": "stat"
    },
    {
      "columns": [],
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "fontSize": "150%",
      "gridPos": {
        "h": 7,
        "w": 22,
        "x": 0,
        "y": 11
      },
      "id": 49,
      "links": [],
      "scroll": true,
      "showHeader": true,
      "sort": {
        "col": 7,
        "desc": true
      },
      "styles": [
        {
          "alias": "Time",
          "align": "auto",
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "pattern": "Time",
          "type": "hidden"
        },
        {
          "alias": "Namespace",
          "align": "auto",
          "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": "namespace",
          "thresholds": [],
          "type": "string",
          "unit": "deckbytes"
        },
        {
          "alias": "Requested Memory",
          "align": "auto",
          "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": "Value #A",
          "thresholds": [],
          "type": "number",
          "unit": "decbytes"
        },
        {
          "alias": "Limit Memory",
          "align": "auto",
          "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": "Value #B",
          "thresholds": [],
          "type": "number",
          "unit": "decbytes"
        },
        {
          "alias": "",
          "align": "auto",
          "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": "pod_namespace",
          "thresholds": [],
          "type": "hidden",
          "unit": "short"
        },
        {
          "alias": "Live Memory",
          "align": "auto",
          "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": "Value #C",
          "thresholds": [],
          "type": "number",
          "unit": "deckbytes"
        },
        {
          "alias": "Wasted Memory",
          "align": "auto",
          "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": "Value #D",
          "thresholds": [],
          "type": "number",
          "unit": "decbytes"
        },
        {
          "alias": "Wasted Memory %",
          "align": "auto",
          "colorMode": "cell",
          "colors": [
            "rgba(50, 172, 45, 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": "Value #E",
          "thresholds": [
            "30",
            "50"
          ],
          "type": "number",
          "unit": "percent"
        },
        {
          "alias": "Wasted Memory % AVG",
          "align": "auto",
          "colorMode": "cell",
          "colors": [
            "rgba(50, 172, 45, 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": "Value #F",
          "thresholds": [
            "30",
            "50"
          ],
          "type": "number",
          "unit": "percent"
        },
        {
          "alias": "Requested CPU",
          "align": "auto",
          "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": "Value #G",
          "thresholds": [],
          "type": "number",
          "unit": "short"
        },
        {
          "alias": "Limit CPU",
          "align": "auto",
          "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": "Value #H",
          "thresholds": [],
          "type": "number",
          "unit": "short"
        },
        {
          "alias": "Live CPU",
          "align": "auto",
          "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": "Value #I",
          "thresholds": [],
          "type": "number",
          "unit": "short"
        },
        {
          "alias": "Wasted CPU",
          "align": "auto",
          "colors": [
            "rgba(50, 172, 45, 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": "Value #J",
          "thresholds": [
            "30",
            "50"
          ],
          "type": "number",
          "unit": "short"
        },
        {
          "alias": "Wasted CPU %",
          "align": "auto",
          "colorMode": "cell",
          "colors": [
            "rgba(50, 172, 45, 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": "Value #K",
          "thresholds": [
            "30",
            "50"
          ],
          "type": "number",
          "unit": "percent"
        },
        {
          "alias": "Wasted CPU % AVG",
          "align": "auto",
          "colorMode": "cell",
          "colors": [
            "rgba(50, 172, 45, 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": "Value #L",
          "thresholds": [
            "30",
            "50"
          ],
          "type": "number",
          "unit": "short"
        },
        {
          "alias": "",
          "align": "auto",
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "decimals": 2,
          "pattern": "/.*/",
          "thresholds": [],
          "type": "number",
          "unit": "short"
        }
      ],
      "targets": [
        {
          "expr": "sum(\nsum(kube_pod_container_resource_requests{namespace=~\".*\", resource=\"memory\"}) by (namespace, exported_pod)\n * on (namespace, exported_pod) group_left()  (sum(kube_pod_status_phase{phase=\"Running\", namespace=~\".*\"}) by (namespace, exported_pod) == 1)\n ) by (namespace)",
          "format": "table",
          "instant": true,
          "intervalFactor": 1,
          "legendFormat": "Requested Memory",
          "refId": "A"
        },
        {
          "expr": "sum(\nsum(kube_pod_container_resource_limits{namespace=~\".*\", resource=\"memory\"}) by (namespace, exported_pod)\n * on (namespace, exported_pod) group_left()  (sum(kube_pod_status_phase{phase=\"Running\", namespace=~\".*\"}) by (namespace, exported_pod) == 1)\n ) by (namespace)",
          "format": "table",
          "instant": true,
          "intervalFactor": 1,
          "legendFormat": "Limit Memory",
          "refId": "B"
        },
        {
          "expr": "label_replace(sum(kube_metrics_server_pods_mem) by (pod_namespace), \"namespace\", \"$1\", \"pod_namespace\", \"(.*)\")",
          "format": "table",
          "instant": true,
          "intervalFactor": 1,
          "legendFormat": "Used Memory",
          "refId": "C"
        },
        {
          "expr": "(sum(sum(kube_pod_container_resource_requests{resource=\"memory\"}) by (namespace, exported_pod)* on (namespace, exported_pod) group_left()  (sum(kube_pod_status_phase{phase=\"Running\"}) by (namespace, exported_pod) == 1)) by (namespace))\n-\n(sum(label_replace(sum(kube_metrics_server_pods_mem) by (pod_namespace), \"namespace\", \"$1\", \"pod_namespace\", \"(.*)\")) by (namespace) * 1024)",
          "format": "table",
          "hide": false,
          "instant": true,
          "intervalFactor": 1,
          "legendFormat": "Wasted Memory",
          "refId": "D"
        },
        {
          "expr": "((100 * \n(sum(label_replace(sum(kube_metrics_server_pods_mem) by (pod_namespace), \"namespace\", \"$1\", \"pod_namespace\", \"(.*)\")) by (namespace) * 1024)\n/ \nsum(sum(kube_pod_container_resource_requests{resource=\"memory\"}) by (namespace, exported_pod)* on (namespace, exported_pod) group_left()  (sum(kube_pod_status_phase{phase=\"Running\"}) by (namespace, exported_pod) == 1)) by (namespace)\n- 100) * -1)",
          "format": "table",
          "hide": false,
          "instant": true,
          "intervalFactor": 1,
          "legendFormat": "Wasted Memory %",
          "refId": "E"
        },
        {
          "expr": "((100 * \n(sum(label_replace(sum(avg_over_time(kube_metrics_server_pods_mem[5d])) by (pod_namespace), \"namespace\", \"$1\", \"pod_namespace\", \"(.*)\")) by (namespace) * 1024)\n/ \nsum(sum(kube_pod_container_resource_requests{resource=\"memory\"}) by (namespace, exported_pod)* on (namespace, exported_pod) group_left()  (sum(kube_pod_status_phase{phase=\"Running\"}) by (namespace, exported_pod) == 1)) by (namespace)\n- 100) * -1)",
          "format": "table",
          "hide": true,
          "instant": true,
          "intervalFactor": 1,
          "legendFormat": "Wasted Memory % AVG",
          "refId": "F"
        },
        {
          "expr": "sum(\nsum(kube_pod_container_resource_requests{namespace=~\".*\", resource=\"cpu\"}) by (namespace, exported_pod)\n * on (namespace, exported_pod) group_left()  (sum(kube_pod_status_phase{phase=\"Running\", namespace=~\".*\"}) by (namespace, exported_pod) == 1)\n ) by (namespace)",
          "format": "table",
          "hide": false,
          "instant": true,
          "intervalFactor": 1,
          "legendFormat": "Requested CPU",
          "refId": "G"
        },
        {
          "expr": "sum(\nsum(kube_pod_container_resource_limits{namespace=~\".*\", resource=\"cpu\"}) by (namespace, exported_pod)\n * on (namespace, exported_pod) group_left()  (sum(kube_pod_status_phase{phase=\"Running\"}) by (namespace, exported_pod) == 1)\n ) by (namespace)",
          "format": "table",
          "instant": true,
          "intervalFactor": 1,
          "legendFormat": "Limit CPU",
          "refId": "H"
        },
        {
          "expr": "label_replace(sum(kube_metrics_server_pods_cpu) by (pod_namespace) / 1000000000 , \"namespace\", \"$1\", \"pod_namespace\", \"(.*)\")",
          "format": "table",
          "hide": false,
          "instant": true,
          "intervalFactor": 1,
          "legendFormat": "Used CPU",
          "refId": "I"
        },
        {
          "expr": "(sum(sum(kube_pod_container_resource_requests{resource=\"cpu\"}) by (namespace, exported_pod)* on (namespace, exported_pod) group_left()  (sum(kube_pod_status_phase{phase=\"Running\"}) by (namespace, exported_pod) == 1)) by (namespace))\n-\n(sum(label_replace(sum(kube_metrics_server_pods_cpu) by (pod_namespace) / 1000000000 , \"namespace\", \"$1\", \"pod_namespace\", \"(.*)\")) by (namespace))",
          "format": "table",
          "instant": true,
          "intervalFactor": 1,
          "legendFormat": "Wasted CPU",
          "refId": "J"
        },
        {
          "expr": "((100 * \n(sum(label_replace(sum(kube_metrics_server_pods_cpu) by (pod_namespace) / 1000000000 , \"namespace\", \"$1\", \"pod_namespace\", \"(.*)\")) by (namespace))\n/ \nsum(sum(kube_pod_container_resource_requests{resource=\"cpu\"}) by (namespace, exported_pod)* on (namespace, exported_pod) group_left()  (sum(kube_pod_status_phase{phase=\"Running\"}) by (namespace, exported_pod) == 1)) by (namespace)\n- 100) * -1)",
          "format": "table",
          "instant": true,
          "intervalFactor": 1,
          "legendFormat": "Wasted CPU %",
          "refId": "K"
        },
        {
          "expr": "((100 * \n(sum(label_replace(sum(avg_over_time(kube_metrics_server_pods_cpu[1d])) by (pod_namespace) / 1000000000, \"namespace\", \"$1\", \"pod_namespace\", \"(.*)\")) by (namespace))\n/ \nsum(sum(kube_pod_container_resource_requests{resource=\"cpu\"}) by (namespace, exported_pod)* on (namespace, exported_pod) group_left()  (sum(kube_pod_status_phase{phase=\"Running\"}) by (namespace, exported_pod) == 1)) by (namespace)\n- 100) * -1) > 0\n",
          "format": "table",
          "hide": true,
          "instant": true,
          "intervalFactor": 1,
          "legendFormat": "Wasted CPU % AVG",
          "refId": "L"
        }
      ],
      "title": "Requests/Limit/Usage by Namespace",
      "transform": "table",
      "type": "table-old"
    },
    {
      "collapsed": false,
      "datasource": {
        "type": "datasource",
        "uid": "grafana"
      },
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 18
      },
      "id": 42,
      "panels": [],
      "title": "Resource by Node",
      "type": "row"
    },
    {
      "columns": [],
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "fontSize": "100%",
      "gridPos": {
        "h": 11,
        "w": 12,
        "x": 0,
        "y": 19
      },
      "id": 46,
      "links": [],
      "scroll": true,
      "showHeader": true,
      "sort": {
        "desc": false
      },
      "styles": [
        {
          "alias": "Time",
          "align": "auto",
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "pattern": "Time",
          "type": "hidden"
        },
        {
          "alias": "Node",
          "align": "auto",
          "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": "node",
          "sanitize": false,
          "thresholds": [],
          "type": "string",
          "unit": "short"
        },
        {
          "alias": "Allocatable Memory",
          "align": "auto",
          "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": "Value #A",
          "thresholds": [],
          "type": "number",
          "unit": "decbytes"
        },
        {
          "alias": "Live Memory",
          "align": "auto",
          "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": "Value #B",
          "thresholds": [],
          "type": "number",
          "unit": "kbytes"
        },
        {
          "alias": "",
          "align": "auto",
          "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": "exported_instance",
          "thresholds": [],
          "type": "hidden",
          "unit": "short"
        },
        {
          "alias": "",
          "align": "auto",
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "decimals": 2,
          "pattern": "/.*/",
          "thresholds": [],
          "type": "number",
          "unit": "short"
        }
      ],
      "targets": [
        {
          "expr": "sum(kube_node_status_allocatable{resource=\"memory\"}) by (node)",
          "format": "table",
          "instant": true,
          "intervalFactor": 1,
          "refId": "A"
        },
        {
          "expr": "label_replace(sum(kube_metrics_server_nodes_mem) by (exported_instance), \"node\", \"$1\", \"exported_instance\", \"(.*)\") ",
          "format": "table",
          "instant": true,
          "intervalFactor": 1,
          "refId": "B"
        }
      ],
      "title": "Nodes Allocatable vs Usage",
      "transform": "table",
      "type": "table-old"
    },
    {
      "columns": [],
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "fontSize": "100%",
      "gridPos": {
        "h": 11,
        "w": 12,
        "x": 12,
        "y": 19
      },
      "id": 47,
      "links": [],
      "scroll": true,
      "showHeader": true,
      "sort": {
        "col": 4,
        "desc": true
      },
      "styles": [
        {
          "alias": "Time",
          "align": "auto",
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "pattern": "Time",
          "type": "hidden"
        },
        {
          "alias": "Node",
          "align": "auto",
          "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": "node",
          "sanitize": false,
          "thresholds": [],
          "type": "string",
          "unit": "short"
        },
        {
          "alias": "Allocatable CPU",
          "align": "auto",
          "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": "Value #A",
          "thresholds": [],
          "type": "number",
          "unit": "short"
        },
        {
          "alias": "Live CPU",
          "align": "auto",
          "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": "Value #B",
          "thresholds": [],
          "type": "number",
          "unit": "short"
        },
        {
          "alias": "",
          "align": "auto",
          "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": "exported_instance",
          "thresholds": [],
          "type": "hidden",
          "unit": "short"
        },
        {
          "alias": "",
          "align": "auto",
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "decimals": 2,
          "pattern": "/.*/",
          "thresholds": [],
          "type": "number",
          "unit": "short"
        }
      ],
      "targets": [
        {
          "expr": "sum(kube_node_status_allocatable{resource=\"cpu\"}) by (node)",
          "format": "table",
          "instant": true,
          "intervalFactor": 1,
          "refId": "A"
        },
        {
          "expr": "label_replace(sum(kube_metrics_server_nodes_cpu) by (exported_instance) / 1000000000 , \"node\", \"$1\", \"exported_instance\", \"(.*)\") ",
          "format": "table",
          "instant": true,
          "intervalFactor": 1,
          "refId": "B"
        }
      ],
      "title": "CPU Allocatable vs Usage",
      "transform": "table",
      "type": "table-old"
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": {
        "type": "prometheus",
        "uid": "${DS_PROMETHEUS}"
      },
      "decimals": 1,
      "description": "",
      "fill": 1,
      "fillGradient": 0,
      "gridPos": {
        "h": 10,
        "w": 24,
        "x": 0,
        "y": 30
      },
      "hiddenSeries": false,
      "id": 40,
      "legend": {
        "alignAsTable": true,
        "avg": false,
        "current": true,
        "max": false,
        "min": false,
        "rightSide": true,
        "show": true,
        "sort": "current",
        "sortDesc": true,
        "total": false,
        "values": true
      },
      "lines": true,
      "linewidth": 1,
      "links": [],
      "nullPointMode": "null",
      "options": {
        "alertThreshold": true
      },
      "percentage": false,
      "pluginVersion": "8.5.2",
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [
        {
          "alias": "CPU Allocatable: ip-10-164-25-139.ec2.internal",
          "yaxis": 2
        },
        {
          "alias": "CPU Utilization: ip-10-164-25-139.ec2.internal",
          "yaxis": 2
        }
      ],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "expr": "sum(kube_node_status_allocatable{resource=\"memory\", node=~\"$instance\"}) by (node)",
          "format": "time_series",
          "hide": false,
          "intervalFactor": 2,
          "legendFormat": "Memory Allocatable: {{node}}",
          "refId": "A",
          "step": 10
        },
        {
          "expr": "sum(kube_metrics_server_nodes_mem{exported_instance=~\"$instance\"}) by (exported_instance) * 1024",
          "format": "time_series",
          "intervalFactor": 1,
          "legendFormat": "Memory Utilization: {{exported_instance}}",
          "refId": "B"
        },
        {
          "expr": "sum(kube_node_status_allocatable{resource=\"cpu\", node=~\"$instance\"}) by (node)",
          "format": "time_series",
          "intervalFactor": 1,
          "legendFormat": "CPU Allocatable: {{node}}",
          "refId": "C"
        },
        {
          "expr": "sum(kube_metrics_server_nodes_cpu{exported_instance=~\"$instance\"}) by (exported_instance) / 1000000000 ",
          "format": "time_series",
          "intervalFactor": 1,
          "legendFormat": "CPU Utilization: {{exported_instance}}",
          "refId": "D"
        }
      ],
      "thresholds": [],
      "timeRegions": [],
      "title": "CPU / Memory Allocatable vs Utilization",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "mode": "time",
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "decbytes",
          "label": "Memory",
          "logBase": 1,
          "show": true
        },
        {
          "decimals": 1,
          "format": "short",
          "label": "CPU",
          "logBase": 1,
          "show": true
        }
      ],
      "yaxis": {
        "align": false
      }
    }
  ],
  "refresh": "30s",
  "schemaVersion": 36,
  "style": "dark",
  "tags": [
    "kubernetes",
    "k8s",
    "prometheus"
  ],
  "templating": {
    "list": [
      {
        "current": {},
        "datasource": {
          "type": "prometheus",
          "uid": "${DS_PROMETHEUS}"
        },
        "definition": "label_values(kube_namespace_labels, namespace)",
        "hide": 0,
        "includeAll": false,
        "label": "namespace",
        "multi": false,
        "name": "namespace",
        "options": [],
        "query": {
          "query": "label_values(kube_namespace_labels, namespace)",
          "refId": "Prometheus-namespace-Variable-Query"
        },
        "refresh": 2,
        "regex": "",
        "skipUrlSync": false,
        "sort": 2,
        "tagValuesQuery": "",
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "current": {},
        "datasource": {
          "type": "prometheus",
          "uid": "${DS_PROMETHEUS}"
        },
        "definition": "label_values(kube_pod_labels{namespace=\"$namespace\"}, label_app)",
        "hide": 0,
        "includeAll": false,
        "label": "app",
        "multi": false,
        "name": "app",
        "options": [],
        "query": {
          "query": "label_values(kube_pod_labels{namespace=\"$namespace\"}, label_app)",
          "refId": "Prometheus-app-Variable-Query"
        },
        "refresh": 2,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "current": {},
        "datasource": {
          "type": "prometheus",
          "uid": "${DS_PROMETHEUS}"
        },
        "definition": "label_values(kube_node_info, node)",
        "hide": 0,
        "includeAll": false,
        "label": "instance",
        "multi": true,
        "name": "instance",
        "options": [],
        "query": {
          "query": "label_values(kube_node_info, node)",
          "refId": "Prometheus-instance-Variable-Query"
        },
        "refresh": 2,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      }
    ]
  },
  "time": {
    "from": "now-1h",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "5s",
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ],
    "time_options": [
      "5m",
      "15m",
      "1h",
      "6h",
      "12h",
      "24h",
      "2d",
      "7d",
      "30d"
    ]
  },
  "timezone": "browser",
  "title": "Used | Wasted Resources",
  "uid": "12141241231232",
  "version": 1,
  "weekStart": ""
}