VPA Recommendations
Vertical Pod Autoscalar Recommendations vs. Utilization vs. Requests & Limits
# Vertical Pod Autoscaler Recommendation

Dashboard to view Vertical Pod Autoscaler recommendations, scraping Prometheus metrics.

## Prerequisites

You need to activate VPA, and exposed metrics from kube-state-metrics.

**Note** that it is designed to work o a multicluster environment, with a `cluster` label.

## Metrics configuration

See blog post here for more implementation details : [Medium Article](https://medium.com/linkbynet/request-limits-recommendations-using-vpa-goldilocks-and-grafana-2239b19bfd1)

## Sources

This dashboard is based from [sherifkayad](https://grafana.com/grafana/dashboards/14588) one. 

Vertical Pod Autoscalar Recommendations vs. Utilization vs. Requests & Limits
{
  "__inputs": [
    {
      "name": "DS_PROMETHEUS",
      "label": "Prometheus",
      "description": "",
      "type": "datasource",
      "pluginId": "prometheus",
      "pluginName": "Prometheus"
    }
  ],
  "__elements": [],
  "__requires": [
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "8.3.4"
    },
    {
      "type": "datasource",
      "id": "prometheus",
      "name": "Prometheus",
      "version": "1.0.0"
    },
    {
      "type": "panel",
      "id": "stat",
      "name": "Stat",
      "version": ""
    },
    {
      "type": "panel",
      "id": "timeseries",
      "name": "Time series",
      "version": ""
    }
  ],
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "target": {
          "limit": 100,
          "matchAny": false,
          "tags": [],
          "type": "dashboard"
        },
        "type": "dashboard"
      }
    ]
  },
  "description": "Vertical Pod Autoscalar Recommendations vs. Utilization vs. Requests & Limits",
  "editable": true,
  "fiscalYearStartMonth": 0,
  "gnetId": 16294,
  "graphTooltip": 0,
  "id": null,
  "iteration": 1652877016443,
  "links": [],
  "liveNow": false,
  "panels": [
    {
      "collapsed": false,
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "id": 8,
      "panels": [],
      "repeat": "container",
      "title": "$container",
      "type": "row"
    },
    {
      "description": "",
      "fieldConfig": {
        "defaults": {
          "color": {
            "fixedColor": "transparent",
            "mode": "fixed"
          },
          "mappings": [],
          "noValue": "None",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "unit": "short"
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "CPU Requests"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "super-light-green",
                  "mode": "fixed"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "CPU Limits"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "super-light-red",
                  "mode": "fixed"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "CPU usage"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "dark-blue",
                  "mode": "fixed"
                }
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 5,
        "w": 8,
        "x": 0,
        "y": 1
      },
      "id": 11,
      "options": {
        "colorMode": "background",
        "graphMode": "area",
        "justifyMode": "center",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "text": {},
        "textMode": "value_and_name"
      },
      "pluginVersion": "8.3.4",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "exemplar": true,
          "expr": "avg(node_namespace_pod_container:container_cpu_usage_seconds_total:sum_irate{cluster=\"$cluster\",namespace=\"$namespace\", pod=~\"$targetName-(.+)\", container=\"$container\"}) by (container)",
          "format": "time_series",
          "instant": false,
          "interval": "",
          "intervalFactor": 2,
          "legendFormat": "CPU usage",
          "refId": "A"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "exemplar": true,
          "expr": "avg(kube_pod_container_resource_requests{cluster=\"$cluster\",resource=\"cpu\", namespace=\"$namespace\", pod=~\"$targetName(.+)\", container=\"$container\"}) by (container)",
          "hide": false,
          "interval": "",
          "intervalFactor": 2,
          "legendFormat": "CPU Requests",
          "refId": "B"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "exemplar": true,
          "expr": "avg(kube_pod_container_resource_limits{cluster=\"$cluster\",resource=\"cpu\", namespace=\"$namespace\", pod=~\"$targetName(.+)\", container=\"$container\"}) by (container)",
          "hide": false,
          "interval": "",
          "intervalFactor": 2,
          "legendFormat": "CPU Limits",
          "refId": "C"
        }
      ],
      "title": "$container CPU Usage",
      "type": "stat"
    },
    {
      "description": "",
      "fieldConfig": {
        "defaults": {
          "color": {
            "fixedColor": "dark-yellow",
            "mode": "fixed"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "unit": "short"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 5,
        "w": 8,
        "x": 8,
        "y": 1
      },
      "id": 12,
      "options": {
        "colorMode": "background",
        "graphMode": "area",
        "justifyMode": "center",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "text": {},
        "textMode": "value_and_name"
      },
      "pluginVersion": "8.3.4",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "exemplar": true,
          "expr": "sum(kube_verticalpodautoscaler_status_recommendation_containerrecommendations_target{cluster=\"$cluster\",resource=\"cpu\", namespace=\"$namespace\", target_name=\"$targetName\", container=\"$container\"}) by (container)",
          "interval": "",
          "legendFormat": "CPU Requests",
          "refId": "A"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "exemplar": true,
          "expr": "sum(kube_verticalpodautoscaler_status_recommendation_containerrecommendations_target{cluster=\"$cluster\",resource=\"cpu\", namespace=\"$namespace\", target_name=\"$targetName\", container=\"$container\"}) by (container)",
          "hide": false,
          "interval": "",
          "legendFormat": "CPU Limits",
          "refId": "B"
        }
      ],
      "title": "$container CPU Guaranteed QoS",
      "type": "stat"
    },
    {
      "description": "",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "fixed"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "unit": "short"
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "CPU Requests"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "dark-green",
                  "mode": "fixed"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "CPU Limits"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "dark-red",
                  "mode": "fixed"
                }
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 5,
        "w": 8,
        "x": 16,
        "y": 1
      },
      "id": 13,
      "options": {
        "colorMode": "background",
        "graphMode": "area",
        "justifyMode": "center",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "text": {},
        "textMode": "value_and_name"
      },
      "pluginVersion": "8.3.4",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "exemplar": true,
          "expr": "sum(kube_verticalpodautoscaler_status_recommendation_containerrecommendations_lowerbound{cluster=\"$cluster\",resource=\"cpu\", namespace=\"$namespace\", target_name=\"$targetName\", container=\"$container\"}) by (container)",
          "interval": "",
          "legendFormat": "CPU Requests",
          "refId": "A"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "exemplar": true,
          "expr": "sum(kube_verticalpodautoscaler_status_recommendation_containerrecommendations_upperbound{cluster=\"$cluster\",resource=\"cpu\", namespace=\"$namespace\", target_name=\"$targetName\", container=\"$container\"}) by (container)",
          "hide": false,
          "interval": "",
          "legendFormat": "CPU Limits",
          "refId": "B"
        }
      ],
      "title": "$container CPU Burstable QoS",
      "type": "stat"
    },
    {
      "description": "",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "fixed"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "unit": "decbytes"
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "Memory usage"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "dark-blue",
                  "mode": "fixed"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Memory Requests"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "super-light-green",
                  "mode": "fixed"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Memory Limits"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "super-light-red",
                  "mode": "fixed"
                }
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 5,
        "w": 8,
        "x": 0,
        "y": 6
      },
      "id": 14,
      "options": {
        "colorMode": "background",
        "graphMode": "area",
        "justifyMode": "center",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "text": {},
        "textMode": "value_and_name"
      },
      "pluginVersion": "8.3.4",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "exemplar": true,
          "expr": "avg(container_memory_working_set_bytes{cluster=\"$cluster\", namespace=\"$namespace\", pod=~\"$targetName(.+)\", container=\"$container\"}) by (container)",
          "interval": "",
          "legendFormat": "Memory usage",
          "refId": "A"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "exemplar": true,
          "expr": "avg(kube_pod_container_resource_requests{cluster=\"$cluster\", resource=\"memory\", namespace=\"$namespace\", pod=~\"$targetName(.+)\", container=\"$container\"}) by (container)",
          "hide": false,
          "interval": "",
          "legendFormat": "Memory Requests",
          "refId": "B"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "exemplar": true,
          "expr": "avg(kube_pod_container_resource_limits{cluster=\"$cluster\", resource=\"memory\", namespace=\"$namespace\", pod=~\"$targetName(.+)\", container=\"$container\"}) by (container)",
          "hide": false,
          "interval": "",
          "legendFormat": "Memory Limits",
          "refId": "C"
        }
      ],
      "title": "$container Memory Usage",
      "type": "stat"
    },
    {
      "description": "",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "dark-blue",
                "value": null
              }
            ]
          },
          "unit": "decbytes"
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "Memory Requests"
            },
            "properties": [
              {
                "id": "thresholds",
                "value": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "dark-yellow",
                      "value": null
                    }
                  ]
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Memory Limits"
            },
            "properties": [
              {
                "id": "thresholds",
                "value": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "dark-yellow",
                      "value": null
                    }
                  ]
                }
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 5,
        "w": 8,
        "x": 8,
        "y": 6
      },
      "id": 15,
      "options": {
        "colorMode": "background",
        "graphMode": "area",
        "justifyMode": "center",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "text": {},
        "textMode": "value_and_name"
      },
      "pluginVersion": "8.3.4",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "exemplar": true,
          "expr": "avg(kube_verticalpodautoscaler_status_recommendation_containerrecommendations_target{cluster=\"$cluster\", resource=\"memory\", namespace=\"$namespace\", target_name=\"$targetName\", container=\"$container\"}) by (container)",
          "interval": "",
          "legendFormat": "Memory Requests",
          "refId": "A"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "exemplar": true,
          "expr": "avg(kube_verticalpodautoscaler_status_recommendation_containerrecommendations_target{cluster=\"$cluster\", resource=\"memory\", namespace=\"$namespace\", target_name=\"$targetName\", container=\"$container\"}) by (container)",
          "hide": false,
          "interval": "",
          "legendFormat": "Memory Limits",
          "refId": "B"
        }
      ],
      "title": "$container Memory Guaranteed QoS",
      "type": "stat"
    },
    {
      "description": "",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "fixed"
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "unit": "decbytes"
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "Memory Requests"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "dark-green",
                  "mode": "fixed"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Memory Limits"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "dark-red",
                  "mode": "fixed"
                }
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 5,
        "w": 8,
        "x": 16,
        "y": 6
      },
      "id": 16,
      "options": {
        "colorMode": "background",
        "graphMode": "area",
        "justifyMode": "center",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "lastNotNull"
          ],
          "fields": "",
          "values": false
        },
        "text": {},
        "textMode": "value_and_name"
      },
      "pluginVersion": "8.3.4",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "exemplar": true,
          "expr": "avg(kube_verticalpodautoscaler_status_recommendation_containerrecommendations_lowerbound{cluster=\"$cluster\", resource=\"memory\", namespace=\"$namespace\", target_name=\"$targetName\", container=\"$container\"}) by (container)",
          "interval": "",
          "legendFormat": "Memory Requests",
          "refId": "A"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "exemplar": true,
          "expr": "avg(kube_verticalpodautoscaler_status_recommendation_containerrecommendations_upperbound{cluster=\"$cluster\", resource=\"memory\", namespace=\"$namespace\", target_name=\"$targetName\", container=\"$container\"}) by (container)",
          "hide": false,
          "interval": "",
          "legendFormat": "Memory Limits",
          "refId": "B"
        }
      ],
      "title": "$container Memory Burstable QoS",
      "type": "stat"
    },
    {
      "description": "",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisLabel": "Cores",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 0,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "lineInterpolation": "linear",
            "lineWidth": 1,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "never",
            "spanNulls": true,
            "stacking": {
              "group": "A",
              "mode": "none"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "unit": "short"
        },
        "overrides": [
          {
            "matcher": {
              "id": "byRegexp",
              "options": ".*usage$"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "dark-blue",
                  "mode": "fixed"
                }
              },
              {
                "id": "custom.fillOpacity",
                "value": 50
              }
            ]
          },
          {
            "matcher": {
              "id": "byRegexp",
              "options": ".*requests$"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "super-light-green",
                  "mode": "fixed"
                }
              },
              {
                "id": "custom.lineStyle",
                "value": {
                  "dash": [
                    10,
                    10
                  ],
                  "fill": "dash"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byRegexp",
              "options": ".*limits$"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "super-light-red",
                  "mode": "fixed"
                }
              },
              {
                "id": "custom.lineStyle",
                "value": {
                  "dash": [
                    10,
                    10
                  ],
                  "fill": "dash"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byRegexp",
              "options": ".*target$"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "dark-yellow",
                  "mode": "fixed"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byRegexp",
              "options": ".*lowerbound$"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "dark-green",
                  "mode": "fixed"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byRegexp",
              "options": ".*upperbound$"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "dark-red",
                  "mode": "fixed"
                }
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 10,
        "w": 12,
        "x": 0,
        "y": 11
      },
      "id": 2,
      "links": [],
      "options": {
        "legend": {
          "calcs": [],
          "displayMode": "list",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "single"
        }
      },
      "pluginVersion": "8.3.4",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "exemplar": true,
          "expr": "avg(node_namespace_pod_container:container_cpu_usage_seconds_total:sum_irate{cluster=\"$cluster\",namespace=\"$namespace\", pod=~\"$targetName-(.+)\", container=\"$container\"}) by (container)",
          "format": "time_series",
          "hide": false,
          "interval": "",
          "intervalFactor": 2,
          "legendFormat": "{{container}} actual usage",
          "refId": "D"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "exemplar": true,
          "expr": "avg(kube_pod_container_resource_requests{cluster=\"$cluster\",resource=\"cpu\", namespace=\"$namespace\", pod=~\"$targetName(.+)\", container=\"$container\"}) by (container)",
          "hide": false,
          "interval": "",
          "intervalFactor": 2,
          "legendFormat": "{{container}} requests",
          "refId": "E"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "exemplar": true,
          "expr": "avg(kube_pod_container_resource_limits{cluster=\"$cluster\",resource=\"cpu\", namespace=\"$namespace\", pod=~\"$targetName(.+)\", container=\"$container\"}) by (container)",
          "hide": false,
          "interval": "",
          "intervalFactor": 2,
          "legendFormat": "{{container}} limits",
          "refId": "F"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "exemplar": true,
          "expr": "sum(kube_verticalpodautoscaler_status_recommendation_containerrecommendations_target{cluster=\"$cluster\",resource=\"cpu\", namespace=\"$namespace\", target_name=\"$targetName\", container=\"$container\"}) by (container)",
          "format": "time_series",
          "hide": false,
          "interval": "",
          "intervalFactor": 2,
          "legendFormat": "{{container}} recommendation target",
          "refId": "C"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "exemplar": true,
          "expr": "sum(kube_verticalpodautoscaler_status_recommendation_containerrecommendations_lowerbound{cluster=\"$cluster\",resource=\"cpu\", namespace=\"$namespace\", target_name=\"$targetName\", container=\"$container\"}) by (container)",
          "hide": false,
          "interval": "",
          "intervalFactor": 2,
          "legendFormat": "{{container}} recommendation lowerbound",
          "refId": "A"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "exemplar": true,
          "expr": "sum(kube_verticalpodautoscaler_status_recommendation_containerrecommendations_upperbound{cluster=\"$cluster\",resource=\"cpu\", namespace=\"$namespace\", target_name=\"$targetName\", container=\"$container\"}) by (container)",
          "hide": false,
          "interval": "",
          "intervalFactor": 2,
          "legendFormat": "{{container}} recommendation upperbound",
          "refId": "B"
        }
      ],
      "title": "CPU Usage, Requests, Limits vs Recommendations",
      "type": "timeseries"
    },
    {
      "description": "",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisLabel": "Bytes",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 0,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "lineInterpolation": "linear",
            "lineWidth": 1,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "never",
            "spanNulls": true,
            "stacking": {
              "group": "A",
              "mode": "none"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "unit": "decbytes"
        },
        "overrides": [
          {
            "matcher": {
              "id": "byRegexp",
              "options": ".*usage$"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "dark-blue",
                  "mode": "fixed"
                }
              },
              {
                "id": "custom.fillOpacity",
                "value": 50
              }
            ]
          },
          {
            "matcher": {
              "id": "byRegexp",
              "options": ".*requests$"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "super-light-green",
                  "mode": "fixed"
                }
              },
              {
                "id": "custom.lineStyle",
                "value": {
                  "dash": [
                    10,
                    10
                  ],
                  "fill": "dash"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byRegexp",
              "options": ".*limits$"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "super-light-red",
                  "mode": "fixed"
                }
              },
              {
                "id": "custom.lineStyle",
                "value": {
                  "dash": [
                    10,
                    10
                  ],
                  "fill": "dash"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byRegexp",
              "options": ".*target$"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "dark-yellow",
                  "mode": "fixed"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byRegexp",
              "options": ".*lowerbound$"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "dark-green",
                  "mode": "fixed"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byRegexp",
              "options": ".*upperbound$"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "dark-red",
                  "mode": "fixed"
                }
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 10,
        "w": 12,
        "x": 12,
        "y": 11
      },
      "id": 9,
      "links": [],
      "options": {
        "legend": {
          "calcs": [],
          "displayMode": "list",
          "placement": "bottom"
        },
        "tooltip": {
          "mode": "single"
        }
      },
      "pluginVersion": "8.3.4",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "exemplar": false,
          "expr": "avg(container_memory_working_set_bytes{cluster=\"$cluster\", namespace=\"$namespace\", pod=~\"$targetName(.+)\", container=\"$container\"}) by (container)",
          "format": "time_series",
          "interval": "",
          "intervalFactor": 1,
          "legendFormat": "{{container}} actual usage",
          "refId": "D"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "exemplar": true,
          "expr": "avg(kube_pod_container_resource_requests{cluster=\"$cluster\", resource=\"memory\", namespace=\"$namespace\", pod=~\"$targetName(.+)\", container=\"$container\"}) by (container)",
          "hide": false,
          "interval": "",
          "legendFormat": "{{container}} requests",
          "refId": "E"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "exemplar": true,
          "expr": "avg(kube_pod_container_resource_limits{cluster=\"$cluster\", resource=\"memory\", namespace=\"$namespace\", pod=~\"$targetName(.+)\", container=\"$container\"}) by (container)",
          "hide": false,
          "interval": "",
          "legendFormat": "{{container}} limits",
          "refId": "F"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "exemplar": false,
          "expr": "avg(kube_verticalpodautoscaler_status_recommendation_containerrecommendations_target{cluster=\"$cluster\", resource=\"memory\", namespace=\"$namespace\", target_name=\"$targetName\", container=\"$container\"}) by (container)",
          "format": "time_series",
          "interval": "",
          "intervalFactor": 1,
          "legendFormat": "{{container}} recommendation target",
          "refId": "C"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "exemplar": true,
          "expr": "avg(kube_verticalpodautoscaler_status_recommendation_containerrecommendations_lowerbound{cluster=\"$cluster\", resource=\"memory\", namespace=\"$namespace\", target_name=\"$targetName\", container=\"$container\"}) by (container)",
          "hide": false,
          "interval": "",
          "legendFormat": "{{container}} recommendation lowerbound",
          "refId": "A"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "exemplar": true,
          "expr": "avg(kube_verticalpodautoscaler_status_recommendation_containerrecommendations_upperbound{cluster=\"$cluster\", resource=\"memory\", namespace=\"$namespace\", target_name=\"$targetName\", container=\"$container\"}) by (container)",
          "hide": false,
          "interval": "",
          "legendFormat": "{{container}} recommendation upperbound",
          "refId": "B"
        }
      ],
      "title": "Memory Usage, Requests, Limits vs Recommendations",
      "type": "timeseries"
    }
  ],
  "refresh": "1m",
  "schemaVersion": 34,
  "style": "dark",
  "tags": [
    "Autoscaling",
    "VPA"
  ],
  "templating": {
    "list": [
      {
        "current": {},
        "definition": "label_values(kube_verticalpodautoscaler_labels,cluster)",
        "hide": 0,
        "includeAll": true,
        "label": "cluster",
        "multi": true,
        "name": "cluster",
        "options": [],
        "query": {
          "query": "label_values(kube_verticalpodautoscaler_labels,cluster)",
          "refId": "StandardVariableQuery"
        },
        "refresh": 2,
        "regex": "",
        "skipUrlSync": false,
        "sort": 1,
        "type": "query",
        "datasource": "${DS_PROMETHEUS}"
      },
      {
        "current": {},
        "datasource": {
          "type": "prometheus",
          "uid": "${DS_PROMETHEUS}"
        },
        "definition": "label_values(kube_verticalpodautoscaler_labels, namespace)",
        "hide": 0,
        "includeAll": false,
        "label": "Namespace",
        "multi": false,
        "name": "namespace",
        "options": [],
        "query": {
          "query": "label_values(kube_verticalpodautoscaler_labels, namespace)",
          "refId": "StandardVariableQuery"
        },
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "current": {},
        "datasource": {
          "type": "prometheus",
          "uid": "${DS_PROMETHEUS}"
        },
        "definition": "label_values(kube_verticalpodautoscaler_labels{namespace=\"$namespace\"}, target_name)",
        "hide": 0,
        "includeAll": false,
        "label": "Target",
        "multi": false,
        "name": "targetName",
        "options": [],
        "query": {
          "query": "label_values(kube_verticalpodautoscaler_labels{namespace=\"$namespace\"}, target_name)",
          "refId": "StandardVariableQuery"
        },
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "current": {},
        "definition": "label_values(kube_verticalpodautoscaler_status_recommendation_containerrecommendations_target{cluster=\"$cluster\", namespace=\"$namespace\", target_name=\"$targetName\"},container)",
        "hide": 0,
        "includeAll": true,
        "multi": true,
        "name": "container",
        "options": [],
        "query": {
          "query": "label_values(kube_verticalpodautoscaler_status_recommendation_containerrecommendations_target{cluster=\"$cluster\", namespace=\"$namespace\", target_name=\"$targetName\"},container)",
          "refId": "StandardVariableQuery"
        },
        "refresh": 2,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "type": "query",
        "datasource": "${DS_PROMETHEUS}"
      }
    ]
  },
  "time": {
    "from": "now-30m",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "5s",
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h"
    ],
    "time_options": [
      "5m",
      "15m",
      "1h",
      "3h",
      "6h",
      "12h",
      "24h",
      "2d",
      "7d",
      "14d"
    ]
  },
  "timezone": "browser",
  "title": "VPA Recommendations",
  "uid": "_BFbbSg7k",
  "version": 24,
  "weekStart": ""
}