Grafana dashboard: VPA Recommendations
Description: A dashboard for Vertical Pod Autoscaler metrics.

Dashboard for [Kubernetes Vertical Pod Autoscaler](https://github.com/kubernetes/autoscaler/tree/master/vertical-pod-autoscaler).

Uses Prometheus datasource to get VPA metrics (`lowerBound`, `upperBound`, `target`, `minAllowed`, `maxAllowed`, `update_mode`) and average pod resources usage (cpu, memory).

Also uses Elasticsearch datasource to show `Eviction` and `too few replicas` events.

Remember: Enable `verticalpodautoscalers` collector on `kube-state-metrics` (described [here](https://github.com/kubernetes/kube-state-metrics/blob/master/docs/verticalpodautoscaler-metrics.md#Configuration)).

Credits: Based on vpa-dashboard from [gardener](https://github.com/gardener/gardener).


{
  "__inputs": [
    {
      "name": "DS_PROMETHEUS",
      "label": "Prometheus",
      "description": "",
      "type": "datasource",
      "pluginId": "prometheus",
      "pluginName": "Prometheus"
    },
    {
      "name": "DS_ELASTICSEARCH",
      "label": "Elasticsearch",
      "description": "",
      "type": "datasource",
      "pluginId": "elasticsearch",
      "pluginName": "Elasticsearch"
    }
  ],
  "__requires": [
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "6.5.2"
    },
    {
      "type": "panel",
      "id": "graph",
      "name": "Graph",
      "version": ""
    },
    {
      "type": "datasource",
      "id": "prometheus",
      "name": "Prometheus",
      "version": "1.0.0"
    },
    {
      "type": "datasource",
      "id": "elasticsearch",
      "name": "ElasticSearch",
      "version": "1.0.0"
    }
  ],
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      }
    ]
  },
  "editable": true,
  "gnetId": 14568,
  "graphTooltip": 0,
  "id": 88,
  "iteration": 1623652173505,
  "links": [],
  "panels": [
    {
      "datasource": "${DS_PROMETHEUS}",
      "description": "The update mode of the VPA.",
      "fieldConfig": {
        "defaults": {
          "custom": {},
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 2,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "id": 8,
      "options": {
        "colorMode": "value",
        "graphMode": "none",
        "justifyMode": "center",
        "orientation": "auto",
        "reduceOptions": {
          "calcs": [
            "last"
          ],
          "fields": "",
          "values": false
        },
        "textMode": "name"
      },
      "pluginVersion": "7.3.5",
      "targets": [
        {
          "expr": "kube_verticalpodautoscaler_spec_updatepolicy_updatemode{namespace=\"$namespace\", target_kind=\"$targetKind\", target_name=\"$targetName\"} > 0",
          "instant": true,
          "interval": "",
          "legendFormat": "{{ update_mode }}",
          "refId": "A"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Update Mode",
      "transparent": true,
      "type": "stat"
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_PROMETHEUS}",
      "description": "Shows the memory recommendation (target). \nThe graph also shows the actual average usage of each container, the lower and upper bounds of the VPA, and the min and max allowed values. ",
      "fieldConfig": {
        "defaults": {
          "custom": {}
        },
        "overrides": []
      },
      "fill": 0,
      "fillGradient": 0,
      "gridPos": {
        "h": 7,
        "w": 12,
        "x": 0,
        "y": 2
      },
      "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": "7.3.5",
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [
        {
          "alias": "Recommendation",
          "color": "#8F3BB8"
        },
        {
          "alias": "UpperBound",
          "color": "#C4162A"
        },
        {
          "alias": "LowerBound",
          "color": "#1F60C4"
        }
      ],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "expr": "sum(container_memory_working_set_bytes{namespace=\"$namespace\", pod=~\"$targetName(.+)\", container!=\"POD\"}) / count(count(container_memory_working_set_bytes{namespace=\"$namespace\", pod=~\"$targetName(.+)\", container!=\"POD\"}) by(pod))",
          "format": "time_series",
          "hide": false,
          "interval": "",
          "intervalFactor": 1,
          "legendFormat": "Avg Usage",
          "refId": "D"
        },
        {
          "expr": "sum(kube_verticalpodautoscaler_status_recommendation_containerrecommendations_target{namespace=\"$namespace\", target_kind=\"$targetKind\", target_name=\"$targetName\", resource=\"memory\"}) by (pod)",
          "format": "time_series",
          "interval": "",
          "intervalFactor": 1,
          "legendFormat": "Recommendation",
          "refId": "C"
        },
        {
          "expr": "kube_verticalpodautoscaler_spec_resourcepolicy_container_policies_minallowed{namespace=\"$namespace\", target_kind=\"$targetKind\", target_name=\"$targetName\", resource=\"memory\"}",
          "hide": true,
          "interval": "",
          "legendFormat": "MinAllowed",
          "refId": "E"
        },
        {
          "expr": "kube_verticalpodautoscaler_spec_resourcepolicy_container_policies_maxallowed{namespace=\"$namespace\", target_kind=\"$targetKind\", target_name=\"$targetName\", resource=\"memory\"}",
          "hide": true,
          "interval": "",
          "legendFormat": "MaxAllowed",
          "refId": "F"
        },
        {
          "expr": "kube_verticalpodautoscaler_status_recommendation_containerrecommendations_lowerbound{namespace=\"$namespace\", target_kind=\"$targetKind\", target_name=\"$targetName\", resource=\"memory\"}",
          "interval": "",
          "legendFormat": "LowerBound",
          "refId": "A"
        },
        {
          "expr": "kube_verticalpodautoscaler_status_recommendation_containerrecommendations_upperbound{namespace=\"$namespace\", target_kind=\"$targetKind\", target_name=\"$targetName\", resource=\"memory\"}",
          "interval": "",
          "legendFormat": "UpperBound",
          "refId": "B"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "Memory Recommendation vs Memory Usage",
      "tooltip": {
        "shared": true,
        "sort": 2,
        "value_type": "individual"
      },
      "transparent": true,
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "bytes",
          "label": "Bytes",
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_PROMETHEUS}",
      "description": "Shows the memory recommendation (target), and the current request and limit of the container.",
      "fieldConfig": {
        "defaults": {
          "custom": {}
        },
        "overrides": []
      },
      "fill": 0,
      "fillGradient": 0,
      "gridPos": {
        "h": 7,
        "w": 12,
        "x": 12,
        "y": 2
      },
      "hiddenSeries": false,
      "id": 6,
      "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": "7.3.5",
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [
        {
          "alias": "Recommendation",
          "color": "#8F3BB8"
        },
        {
          "alias": "MinAllowed",
          "color": "#1F60C4"
        },
        {
          "alias": "MaxAllowed",
          "color": "#C4162A"
        },
        {
          "alias": "Requests",
          "color": "#37872D"
        },
        {
          "alias": "Limits",
          "color": "#96D98D"
        }
      ],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "expr": "sum(kube_verticalpodautoscaler_status_recommendation_containerrecommendations_target{namespace=\"$namespace\", target_kind=\"$targetKind\", target_name=\"$targetName\", resource=\"memory\"})",
          "format": "time_series",
          "hide": false,
          "interval": "",
          "intervalFactor": 1,
          "legendFormat": "Recommendation",
          "refId": "A"
        },
        {
          "expr": "sum(kube_pod_container_resource_requests{namespace=\"$namespace\", pod=~\"$targetName(.+)\", resource=\"memory\"}) / count(count(kube_pod_container_resource_requests{namespace=\"$namespace\", pod=~\"$targetName(.+)\", resource=\"memory\"}) by(pod))",
          "format": "time_series",
          "hide": false,
          "interval": "",
          "intervalFactor": 1,
          "legendFormat": "Requests",
          "refId": "B"
        },
        {
          "expr": "sum(container_spec_memory_limit_bytes{namespace=\"$namespace\", pod=~\"$targetName(.+)\"}) / count(count(container_spec_memory_limit_bytes{namespace=\"$namespace\", pod=~\"$targetName(.+)\"}) by(pod))",
          "format": "time_series",
          "hide": false,
          "interval": "",
          "intervalFactor": 1,
          "legendFormat": "Limits",
          "refId": "C"
        },
        {
          "expr": "kube_verticalpodautoscaler_status_recommendation_containerrecommendations_lowerbound{namespace=\"$namespace\", target_kind=\"$targetKind\", target_name=\"$targetName\", resource=\"memory\"}",
          "hide": true,
          "interval": "",
          "legendFormat": "LowerBound",
          "refId": "D"
        },
        {
          "expr": "kube_verticalpodautoscaler_status_recommendation_containerrecommendations_upperbound{namespace=\"$namespace\", target_kind=\"$targetKind\", target_name=\"$targetName\", resource=\"memory\"}",
          "hide": true,
          "interval": "",
          "legendFormat": "UpperBound",
          "refId": "E"
        },
        {
          "expr": "kube_verticalpodautoscaler_spec_resourcepolicy_container_policies_minallowed{namespace=\"$namespace\", target_kind=\"$targetKind\", target_name=\"$targetName\", resource=\"memory\"}",
          "interval": "",
          "legendFormat": "MinAllowed",
          "refId": "F"
        },
        {
          "expr": "kube_verticalpodautoscaler_spec_resourcepolicy_container_policies_maxallowed{namespace=\"$namespace\", target_kind=\"$targetKind\", target_name=\"$targetName\", resource=\"memory\"}",
          "interval": "",
          "legendFormat": "MaxAllowed",
          "refId": "G"
        },
        {
          "expr": "sum(container_memory_working_set_bytes{namespace=\"$namespace\", pod=~\"$targetName(.+)\", container!=\"POD\"}) / count(count(container_memory_working_set_bytes{namespace=\"$namespace\", pod=~\"$targetName(.+)\", container!=\"POD\"}) by(pod))",
          "hide": true,
          "interval": "",
          "legendFormat": "AvgUsage",
          "refId": "H"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "VPA Memory Recommendations vs Requests and Limits",
      "tooltip": {
        "shared": true,
        "sort": 2,
        "value_type": "individual"
      },
      "transparent": true,
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "bytes",
          "label": "Bytes",
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_PROMETHEUS}",
      "decimals": 3,
      "description": "Shows the cpu recommendation (target). \nThe graph also shows the actual average usage of each container, the lower and upper bounds of the VPA, and the min and max allowed values. ",
      "fieldConfig": {
        "defaults": {
          "custom": {}
        },
        "overrides": []
      },
      "fill": 0,
      "fillGradient": 0,
      "gridPos": {
        "h": 7,
        "w": 12,
        "x": 0,
        "y": 9
      },
      "hiddenSeries": false,
      "id": 2,
      "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": "7.3.5",
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [
        {
          "alias": "Recommendation",
          "color": "#8F3BB8"
        },
        {
          "alias": "LowerBound",
          "color": "#1F60C4"
        },
        {
          "alias": "UpperBound",
          "color": "#C4162A"
        }
      ],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "expr": "sum(rate(container_cpu_usage_seconds_total{namespace=\"$namespace\", pod=~\"$targetName-(.+)\", container!=\"POD\"}[2m])) / count(count(container_cpu_usage_seconds_total{namespace=\"$namespace\", pod=~\"$targetName(.+)\", container!=\"POD\"}) by(pod))",
          "format": "time_series",
          "hide": false,
          "interval": "",
          "intervalFactor": 1,
          "legendFormat": "Avg Usage",
          "refId": "D"
        },
        {
          "expr": "sum(kube_verticalpodautoscaler_status_recommendation_containerrecommendations_target{namespace=\"$namespace\", target_kind=\"$targetKind\", target_name=\"$targetName\", resource=\"cpu\"}) by (pod)",
          "format": "time_series",
          "interval": "",
          "intervalFactor": 1,
          "legendFormat": "Recommendation",
          "refId": "C"
        },
        {
          "expr": "kube_verticalpodautoscaler_spec_resourcepolicy_container_policies_minallowed{namespace=\"$namespace\", target_kind=\"$targetKind\", target_name=\"$targetName\", resource=\"cpu\"}",
          "hide": true,
          "interval": "",
          "legendFormat": "MinAllowed",
          "refId": "E"
        },
        {
          "expr": "kube_verticalpodautoscaler_spec_resourcepolicy_container_policies_maxallowed{namespace=\"$namespace\", target_kind=\"$targetKind\", target_name=\"$targetName\", resource=\"cpu\"}",
          "hide": true,
          "interval": "",
          "legendFormat": "MaxAllowed",
          "refId": "F"
        },
        {
          "expr": "kube_verticalpodautoscaler_status_recommendation_containerrecommendations_lowerbound{namespace=\"$namespace\", target_kind=\"$targetKind\", target_name=\"$targetName\", resource=\"cpu\"}",
          "interval": "",
          "legendFormat": "LowerBound",
          "refId": "A"
        },
        {
          "expr": "kube_verticalpodautoscaler_status_recommendation_containerrecommendations_upperbound{namespace=\"$namespace\", target_kind=\"$targetKind\", target_name=\"$targetName\", resource=\"cpu\"}",
          "interval": "",
          "legendFormat": "UpperBound",
          "refId": "B"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "CPU Recommendation vs CPU Usage",
      "tooltip": {
        "shared": true,
        "sort": 2,
        "value_type": "individual"
      },
      "transparent": true,
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "decimals": null,
          "format": "short",
          "label": "Millicores",
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_PROMETHEUS}",
      "description": "Shows the cpu recommendation (target), and the current request and limit of the container.\n\n**Requests and/or limits may not reflect useful values if they are not defined for each container in a pod.",
      "fieldConfig": {
        "defaults": {
          "custom": {}
        },
        "overrides": []
      },
      "fill": 0,
      "fillGradient": 0,
      "gridPos": {
        "h": 7,
        "w": 12,
        "x": 12,
        "y": 9
      },
      "hiddenSeries": false,
      "id": 5,
      "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": "7.3.5",
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [
        {
          "alias": "Recommendation",
          "color": "#8F3BB8"
        },
        {
          "alias": "MinAllowed",
          "color": "#1F60C4"
        },
        {
          "alias": "MaxAllowed",
          "color": "#C4162A"
        },
        {
          "alias": "Requests",
          "color": "#37872D"
        },
        {
          "alias": "Limits",
          "color": "#96D98D"
        }
      ],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "expr": "sum(kube_verticalpodautoscaler_status_recommendation_containerrecommendations_target{namespace=\"$namespace\", target_kind=\"$targetKind\", target_name=\"$targetName\", resource=\"cpu\"}) ",
          "format": "time_series",
          "interval": "",
          "intervalFactor": 1,
          "legendFormat": "Recommendation",
          "refId": "A"
        },
        {
          "expr": "sum(kube_pod_container_resource_requests{namespace=\"$namespace\", pod=~\"$targetName(.+)\", resource=\"cpu\"}) / count(count(kube_pod_container_resource_requests{namespace=\"$namespace\", pod=~\"$targetName(.+)\", resource=\"cpu\"}) by(pod))",
          "format": "time_series",
          "interval": "",
          "intervalFactor": 1,
          "legendFormat": "Requests",
          "refId": "B"
        },
        {
          "expr": "sum(kube_pod_container_resource_limits{namespace=\"$namespace\", pod=~\"$targetName(.+)\", resource=\"cpu\"}) / count(count(kube_pod_container_resource_limits{namespace=\"$namespace\", pod=~\"$targetName(.+)\", resource=\"cpu\"}) by(pod))",
          "format": "time_series",
          "interval": "",
          "intervalFactor": 1,
          "legendFormat": "Limits",
          "refId": "C"
        },
        {
          "expr": "kube_verticalpodautoscaler_status_recommendation_containerrecommendations_lowerbound{namespace=\"$namespace\", target_kind=\"$targetKind\", target_name=\"$targetName\", resource=\"cpu\"}",
          "hide": true,
          "interval": "",
          "legendFormat": "LowerBound",
          "refId": "D"
        },
        {
          "expr": "kube_verticalpodautoscaler_status_recommendation_containerrecommendations_upperbound{namespace=\"$namespace\", target_kind=\"$targetKind\", target_name=\"$targetName\", resource=\"cpu\"}",
          "hide": true,
          "interval": "",
          "legendFormat": "UpperBound",
          "refId": "E"
        },
        {
          "expr": "kube_verticalpodautoscaler_spec_resourcepolicy_container_policies_minallowed{namespace=\"$namespace\", target_kind=\"$targetKind\", target_name=\"$targetName\", resource=\"cpu\"}",
          "interval": "",
          "legendFormat": "MinAllowed",
          "refId": "F"
        },
        {
          "expr": "kube_verticalpodautoscaler_spec_resourcepolicy_container_policies_maxallowed{namespace=\"$namespace\", target_kind=\"$targetKind\", target_name=\"$targetName\", resource=\"cpu\"}",
          "interval": "",
          "legendFormat": "MaxAllowed",
          "refId": "G"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "VPA CPU Recommendations vs Requests and Limits",
      "tooltip": {
        "shared": true,
        "sort": 2,
        "value_type": "individual"
      },
      "transparent": true,
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "decimals": 2,
          "format": "short",
          "label": "Millicores",
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "datasource": "${DS_ELASTICSEARCH}",
      "description": "vpa-updater too-few-replicas logs from elasticsearch",
      "fieldConfig": {
        "defaults": {
          "custom": {
            "align": null,
            "filterable": false
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "@timestamp"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 149
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "log"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 1500
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 0,
        "y": 16
      },
      "id": 11,
      "options": {
        "showHeader": true,
        "sortBy": [
          {
            "desc": false,
            "displayName": "@timestamp"
          }
        ]
      },
      "pluginVersion": "7.3.5",
      "targets": [
        {
          "bucketAggs": [
            {
              "field": "log",
              "id": "2",
              "settings": {
                "min_doc_count": 0,
                "order": "desc",
                "orderBy": "_term",
                "size": "10"
              },
              "type": "terms"
            }
          ],
          "metrics": [
            {
              "field": "select field",
              "id": "1",
              "meta": {},
              "settings": {},
              "type": "logs"
            }
          ],
          "query": "kubernetes.pod_name:\"vpa-updater\" AND (log:\"too few replicas\")",
          "refId": "A",
          "timeField": "@timestamp"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Too few replicas",
      "transformations": [
        {
          "id": "organize",
          "options": {
            "excludeByName": {
              "_id": true,
              "_index": true,
              "_source": true,
              "_type": true,
              "kubernetes.annotations.kubernetes_io/psp": true,
              "kubernetes.container_hash": true,
              "kubernetes.container_image": true,
              "kubernetes.container_name": true,
              "kubernetes.docker_id": true,
              "kubernetes.host": true,
              "kubernetes.labels.app_kubernetes_io/component": true,
              "kubernetes.labels.app_kubernetes_io/instance": true,
              "kubernetes.labels.app_kubernetes_io/name": true,
              "kubernetes.labels.pod-template-hash": true,
              "kubernetes.namespace_name": true,
              "kubernetes.pod_id": true,
              "kubernetes.pod_name": true,
              "stream": true,
              "time": true
            },
            "indexByName": {},
            "renameByName": {}
          }
        }
      ],
      "type": "table"
    },
    {
      "datasource": "${DS_ELASTICSEARCH}",
      "description": "vpa-updater eviction logs from elasticsearch",
      "fieldConfig": {
        "defaults": {
          "custom": {
            "align": null,
            "displayMode": "auto",
            "filterable": false
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "@timestamp"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 149
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "log"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 2500
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 12,
        "y": 16
      },
      "id": 10,
      "options": {
        "showHeader": true,
        "sortBy": [
          {
            "desc": false,
            "displayName": "@timestamp"
          }
        ]
      },
      "pluginVersion": "7.3.5",
      "targets": [
        {
          "bucketAggs": [
            {
              "field": "log",
              "id": "2",
              "settings": {
                "min_doc_count": 0,
                "order": "desc",
                "orderBy": "_term",
                "size": "10"
              },
              "type": "terms"
            }
          ],
          "metrics": [
            {
              "field": "select field",
              "id": "1",
              "meta": {},
              "settings": {},
              "type": "logs"
            }
          ],
          "query": "kubernetes.pod_name:\"vpa-updater\" AND (log:\"evicting\" OR log:\"evicted\") AND (log:\"$targetName\" AND log:\"$namespace\")",
          "refId": "A",
          "timeField": "@timestamp"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Evictions",
      "transformations": [
        {
          "id": "organize",
          "options": {
            "excludeByName": {
              "_id": true,
              "_index": true,
              "_source": true,
              "_type": true,
              "kubernetes.annotations.kubernetes_io/psp": true,
              "kubernetes.container_hash": true,
              "kubernetes.container_image": true,
              "kubernetes.container_name": true,
              "kubernetes.docker_id": true,
              "kubernetes.host": true,
              "kubernetes.labels.app_kubernetes_io/component": true,
              "kubernetes.labels.app_kubernetes_io/instance": true,
              "kubernetes.labels.app_kubernetes_io/name": true,
              "kubernetes.labels.pod-template-hash": true,
              "kubernetes.namespace_name": true,
              "kubernetes.pod_id": true,
              "kubernetes.pod_name": true,
              "stream": true,
              "time": true
            },
            "indexByName": {},
            "renameByName": {
              "log": ""
            }
          }
        }
      ],
      "type": "table"
    },
    {
      "datasource": "${DS_ELASTICSEARCH}",
      "description": "vpa-updater eviction logs from elasticsearch",
      "fieldConfig": {
        "defaults": {
          "custom": {
            "align": null,
            "filterable": false
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "@timestamp"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 149
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "log"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 3000
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 10,
        "w": 24,
        "x": 0,
        "y": 24
      },
      "id": 12,
      "options": {
        "showHeader": true,
        "sortBy": [
          {
            "desc": false,
            "displayName": "@timestamp"
          }
        ]
      },
      "pluginVersion": "7.3.5",
      "targets": [
        {
          "bucketAggs": [
            {
              "field": "log",
              "id": "2",
              "settings": {
                "min_doc_count": 0,
                "order": "desc",
                "orderBy": "_term",
                "size": "10"
              },
              "type": "terms"
            }
          ],
          "metrics": [
            {
              "field": "select field",
              "id": "1",
              "meta": {},
              "settings": {},
              "type": "logs"
            }
          ],
          "query": "kubernetes.pod_name:\"vpa-updater\" AND (log:\"evicting\" OR log:\"evicted\")",
          "refId": "A",
          "timeField": "@timestamp"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "All Evictions",
      "transformations": [
        {
          "id": "organize",
          "options": {
            "excludeByName": {
              "_id": true,
              "_index": true,
              "_source": true,
              "_type": true,
              "kubernetes.annotations.kubernetes_io/psp": true,
              "kubernetes.container_hash": true,
              "kubernetes.container_image": true,
              "kubernetes.container_name": true,
              "kubernetes.docker_id": true,
              "kubernetes.host": true,
              "kubernetes.labels.app_kubernetes_io/component": true,
              "kubernetes.labels.app_kubernetes_io/instance": true,
              "kubernetes.labels.app_kubernetes_io/name": true,
              "kubernetes.labels.pod-template-hash": true,
              "kubernetes.namespace_name": true,
              "kubernetes.pod_id": true,
              "kubernetes.pod_name": true,
              "stream": true,
              "time": true
            },
            "indexByName": {},
            "renameByName": {}
          }
        }
      ],
      "type": "table"
    }
  ],
  "refresh": "",
  "schemaVersion": 26,
  "style": "dark",
  "tags": [
    "Autoscaling"
  ],
  "templating": {
    "list": [
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_PROMETHEUS}",
        "definition": "label_values(kube_verticalpodautoscaler_spec_updatepolicy_updatemode, target_kind)",
        "error": null,
        "hide": 0,
        "includeAll": false,
        "label": "Kind",
        "multi": false,
        "name": "targetKind",
        "options": [],
        "query": "label_values(kube_verticalpodautoscaler_spec_updatepolicy_updatemode, target_kind)",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_PROMETHEUS}",
        "definition": "label_values(kube_verticalpodautoscaler_spec_updatepolicy_updatemode{target_kind=~\"$targetKind\"}, namespace)",
        "error": null,
        "hide": 0,
        "includeAll": false,
        "label": null,
        "multi": false,
        "name": "namespace",
        "options": [],
        "query": "label_values(kube_verticalpodautoscaler_spec_updatepolicy_updatemode{target_kind=~\"$targetKind\"}, namespace)",
        "refresh": 0,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_PROMETHEUS}",
        "definition": "label_values(kube_verticalpodautoscaler_spec_updatepolicy_updatemode{target_kind=~\"$targetKind\", namespace=\"$namespace\"}, target_name)",
        "error": null,
        "hide": 0,
        "includeAll": false,
        "label": "Target",
        "multi": false,
        "name": "targetName",
        "options": [],
        "query": "label_values(kube_verticalpodautoscaler_spec_updatepolicy_updatemode{target_kind=~\"$targetKind\", namespace=\"$namespace\"}, target_name)",
        "refresh": 0,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      }
    ]
  },
  "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": "vpa-recommendations",
  "version": 81,
  "description": "A dashboard for Vertical Pod Autoscaler metrics."
}