apiVersion: v1
kind: ConfigMap
metadata:
  labels:
    grafana_dashboard: "1"
    heritage: cli
    prometheus: monitoring
  name: kubecost
  namespace: monitoring
data:
  kubecost.json: |-
    {
        "annotations": {
            "list": [
                {
                    "builtIn": 1,
                    "datasource": "-- Grafana --",
                    "enable": true,
                    "hide": true,
                    "iconColor": "rgba(0, 211, 255, 1)",
                    "name": "Annotations & Alerts",
                    "type": "dashboard"
                }
            ]
        },
        "description": "A dashboard to help with cost and utilisation",
        "editable": true,
        "gnetId": 6876,
        "graphTooltip": 0,
        "id": 6,
        "iteration": 1540777037303,
        "links": [],
        "panels": [
            {
                "columns": [
                    {
                        "text": "Avg",
                        "value": "avg"
                    }
                ],
                "datasource": "Prometheus",
                "fontSize": "100%",
                "gridPos": {
                    "h": 9,
                    "w": 16,
                    "x": 0,
                    "y": 0
                },
                "hideTimeOverride": true,
                "id": 73,
                "links": [],
                "pageSize": 8,
                "repeat": null,
                "repeatDirection": "v",
                "scroll": true,
                "showHeader": true,
                "sort": {
                    "col": null,
                    "desc": false
                },
                "styles": [
                    {
                        "alias": "Pod",
                        "colorMode": null,
                        "colors": [
                            "rgba(245, 54, 54, 0.9)",
                            "rgba(50, 172, 45, 0.97)",
                            "#c15c17"
                        ],
                        "dateFormat": "YYYY-MM-DD HH:mm:ss",
                        "decimals": 2,
                        "link": false,
                        "linkTooltip": "",
                        "linkUrl": "",
                        "pattern": "pod_name",
                        "thresholds": [
                            "30",
                            "80"
                        ],
                        "type": "string",
                        "unit": "currencyUSD"
                    },
                    {
                        "alias": "RAM",
                        "colorMode": null,
                        "colors": [
                            "rgba(245, 54, 54, 0.9)",
                            "rgba(237, 129, 40, 0.89)",
                            "rgba(50, 172, 45, 0.97)"
                        ],
                        "dateFormat": "YYYY-MM-DD HH:mm:ss",
                        "decimals": 2,
                        "pattern": "Value #B",
                        "thresholds": [],
                        "type": "number",
                        "unit": "currencyUSD"
                    },
                    {
                        "alias": "CPU",
                        "colorMode": null,
                        "colors": [
                            "rgba(245, 54, 54, 0.9)",
                            "rgba(237, 129, 40, 0.89)",
                            "rgba(50, 172, 45, 0.97)"
                        ],
                        "dateFormat": "YYYY-MM-DD HH:mm:ss",
                        "decimals": 2,
                        "mappingType": 1,
                        "pattern": "Value #A",
                        "thresholds": [],
                        "type": "number",
                        "unit": "currencyUSD"
                    },
                    {
                        "alias": "",
                        "colorMode": null,
                        "colors": [
                            "rgba(245, 54, 54, 0.9)",
                            "rgba(237, 129, 40, 0.89)",
                            "rgba(50, 172, 45, 0.97)"
                        ],
                        "dateFormat": "YYYY-MM-DD HH:mm:ss",
                        "decimals": 2,
                        "mappingType": 1,
                        "pattern": "Time",
                        "thresholds": [],
                        "type": "hidden",
                        "unit": "short"
                    },
                    {
                        "alias": "Storage",
                        "colorMode": null,
                        "colors": [
                            "rgba(245, 54, 54, 0.9)",
                            "rgba(237, 129, 40, 0.89)",
                            "rgba(50, 172, 45, 0.97)"
                        ],
                        "dateFormat": "YYYY-MM-DD HH:mm:ss",
                        "decimals": 2,
                        "mappingType": 1,
                        "pattern": "Value #C",
                        "thresholds": [],
                        "type": "number",
                        "unit": "currencyUSD"
                    },
                    {
                        "alias": "Total",
                        "colorMode": null,
                        "colors": [
                            "rgba(245, 54, 54, 0.9)",
                            "rgba(237, 129, 40, 0.89)",
                            "rgba(50, 172, 45, 0.97)"
                        ],
                        "dateFormat": "YYYY-MM-DD HH:mm:ss",
                        "decimals": 2,
                        "mappingType": 1,
                        "pattern": "Value #D",
                        "thresholds": [],
                        "type": "number",
                        "unit": "currencyUSD"
                    },
                    {
                        "alias": "CPU Utilisation",
                        "colorMode": "value",
                        "colors": [
                            "#bf1b00",
                            "rgba(50, 172, 45, 0.97)",
                            "#ef843c"
                        ],
                        "dateFormat": "YYYY-MM-DD HH:mm:ss",
                        "decimals": 2,
                        "mappingType": 1,
                        "pattern": "Value #E",
                        "thresholds": [
                            "30",
                            "80"
                        ],
                        "type": "number",
                        "unit": "percent"
                    },
                    {
                        "alias": "RAM Utilisation",
                        "colorMode": "value",
                        "colors": [
                            "rgba(245, 54, 54, 0.9)",
                            "rgba(50, 172, 45, 0.97)",
                            "#ef843c"
                        ],
                        "dateFormat": "YYYY-MM-DD HH:mm:ss",
                        "decimals": 2,
                        "mappingType": 1,
                        "pattern": "Value #F",
                        "thresholds": [
                            "30",
                            "80"
                        ],
                        "type": "number",
                        "unit": "percent"
                    }
                ],
                "targets": [
                    {
                        "expr": "(\n sum(container_spec_cpu_shares{namespace=\"$namespace\",cloud_google_com_gke_preemptible!=\"true\"}/1000*($costcpu - ($costcpu / 100 * $costDiscount))) by(pod_name)\n or\n count(\n count(container_spec_cpu_shares{namespace=\"$namespace\"}) by(pod_name)\n ) by(pod_name) -1\n)\n\n+\n\n(\n sum(container_spec_cpu_shares{namespace=\"$namespace\",cloud_google_com_gke_preemptible=\"true\"}/1000*$costpcpu) by(pod_name)\n or\n count(\n count(container_spec_cpu_shares{namespace=\"$namespace\"}) by(pod_name)\n ) by(pod_name) -1\n)",
                        "format": "table",
                        "hide": false,
                        "instant": true,
                        "interval": "",
                        "intervalFactor": 1,
                        "legendFormat": "{{ pod_name }}",
                        "refId": "A"
                    },
                    {
                        "expr": "sum(\n count(count(container_spec_cpu_shares{namespace=\"$namespace\"}) by (pod_name)) by (pod_name) \n * on (pod_name) \n sum(irate(container_cpu_usage_seconds_total{namespace=\"$namespace\"}[1m])) by (pod_name)\n) by (pod_name) * 1000\n/\nsum(container_spec_cpu_shares{namespace=\"$namespace\"}) by (pod_name) * 100",
                        "format": "table",
                        "hide": false,
                        "instant": true,
                        "intervalFactor": 1,
                        "legendFormat": "{{ pod_name }}",
                        "refId": "E"
                    },
                    {
                        "expr": "(\n sum(container_spec_memory_limit_bytes{namespace=\"$namespace\",cloud_google_com_gke_preemptible!=\"true\"}/1024/1024/1024*($costram- ($costram / 100 * $costDiscount))) by(pod_name)\n or\n count(\n count(container_spec_memory_limit_bytes{namespace=\"$namespace\"}) by(pod_name)\n ) by(pod_name) -1\n)\n\n+\n\n(\n sum(container_spec_memory_limit_bytes{namespace=\"$namespace\",cloud_google_com_gke_preemptible=\"true\"}/1024/1024/1024*$costpram) by(pod_name)\n or\n count(\n count(container_spec_memory_limit_bytes{namespace=\"$namespace\"}) by(pod_name)\n ) by(pod_name) -1\n)",
                        "format": "table",
                        "hide": false,
                        "instant": true,
                        "intervalFactor": 1,
                        "legendFormat": "{{ namespace }}",
                        "refId": "B"
                    },
                    {
                        "expr": "sum(\n count(count(container_memory_working_set_bytes{namespace=\"$namespace\"}) by (pod_name)) by (pod_name) \n * on (pod_name) \n sum(avg_over_time(container_memory_working_set_bytes{namespace=\"$namespace\"}[1m])) by (pod_name)\n) by (pod_name)\n/\nsum(container_spec_memory_limit_bytes{namespace=\"$namespace\"}) by (pod_name) * 100",
                        "format": "table",
                        "hide": false,
                        "instant": true,
                        "intervalFactor": 1,
                        "legendFormat": "{{ namespace }}",
                        "refId": "F"
                    },
                    {
                        "expr": "(\n sum(container_spec_cpu_shares{namespace=\"$namespace\",cloud_google_com_gke_preemptible!=\"true\"}/1000*($costcpu - ($costcpu / 100 * $costDiscount))) by(pod_name)\n or\n count(\n count(container_spec_cpu_shares{namespace=\"$namespace\"}) by(pod_name)\n ) by(pod_name) -1\n)\n\n+\n\n(\n sum(container_spec_cpu_shares{namespace=\"$namespace\",cloud_google_com_gke_preemptible=\"true\"}/1000*$costpcpu) by(pod_name)\n or\n count(\n count(container_spec_cpu_shares{namespace=\"$namespace\"}) by(pod_name)\n ) by(pod_name) -1\n)\n\n# Now ram\n\n+ \n(\n sum(container_spec_memory_limit_bytes{namespace=\"$namespace\",cloud_google_com_gke_preemptible!=\"true\"}/1024/1024/1024*($costram- ($costram / 100 * $costDiscount))) by(pod_name)\n or\n count(\n count(container_spec_memory_limit_bytes{namespace=\"$namespace\"}) by(pod_name)\n ) by(pod_name) -1\n)\n\n+\n\n(\n sum(container_spec_memory_limit_bytes{namespace=\"$namespace\",cloud_google_com_gke_preemptible=\"true\"}/1024/1024/1024*$costpram) by(pod_name)\n or\n count(\n count(container_spec_memory_limit_bytes{namespace=\"$namespace\"}) by(pod_name)\n ) by(pod_name) -1\n)\n\n",
                        "format": "table",
                        "hide": false,
                        "instant": true,
                        "intervalFactor": 1,
                        "refId": "D"
                    }
                ],
                "timeFrom": "1M",
                "timeShift": null,
                "title": "Pod cost and utilisation analysis",
                "transform": "table",
                "transparent": false,
                "type": "table"
            },
            {
                "columns": [
                    {
                        "text": "Avg",
                        "value": "avg"
                    }
                ],
                "datasource": "Prometheus",
                "fontSize": "100%",
                "gridPos": {
                    "h": 9,
                    "w": 8,
                    "x": 16,
                    "y": 0
                },
                "hideTimeOverride": true,
                "id": 90,
                "links": [],
                "pageSize": 8,
                "repeatDirection": "v",
                "scroll": true,
                "showHeader": true,
                "sort": {
                    "col": 4,
                    "desc": true
                },
                "styles": [
                    {
                        "alias": "Namespace",
                        "colorMode": null,
                        "colors": [
                            "rgba(245, 54, 54, 0.9)",
                            "rgba(237, 129, 40, 0.89)",
                            "rgba(50, 172, 45, 0.97)"
                        ],
                        "dateFormat": "YYYY-MM-DD HH:mm:ss",
                        "decimals": 2,
                        "mappingType": 1,
                        "pattern": "namespace",
                        "thresholds": [],
                        "type": "hidden",
                        "unit": "short"
                    },
                    {
                        "alias": "PVC Name",
                        "colorMode": null,
                        "colors": [
                            "rgba(245, 54, 54, 0.9)",
                            "rgba(237, 129, 40, 0.89)",
                            "rgba(50, 172, 45, 0.97)"
                        ],
                        "dateFormat": "YYYY-MM-DD HH:mm:ss",
                        "decimals": 2,
                        "mappingType": 1,
                        "pattern": "persistentvolumeclaim",
                        "thresholds": [],
                        "type": "number",
                        "unit": "short"
                    },
                    {
                        "alias": "Storage Class",
                        "colorMode": null,
                        "colors": [
                            "rgba(245, 54, 54, 0.9)",
                            "rgba(237, 129, 40, 0.89)",
                            "rgba(50, 172, 45, 0.97)"
                        ],
                        "dateFormat": "YYYY-MM-DD HH:mm:ss",
                        "decimals": 2,
                        "mappingType": 1,
                        "pattern": "storageclass",
                        "thresholds": [],
                        "type": "number",
                        "unit": "short"
                    },
                    {
                        "alias": "Cost",
                        "colorMode": null,
                        "colors": [
                            "rgba(245, 54, 54, 0.9)",
                            "rgba(237, 129, 40, 0.89)",
                            "rgba(50, 172, 45, 0.97)"
                        ],
                        "dateFormat": "YYYY-MM-DD HH:mm:ss",
                        "decimals": 2,
                        "mappingType": 1,
                        "pattern": "Value",
                        "thresholds": [],
                        "type": "number",
                        "unit": "currencyUSD"
                    },
                    {
                        "alias": "",
                        "colorMode": null,
                        "colors": [
                            "rgba(245, 54, 54, 0.9)",
                            "rgba(237, 129, 40, 0.89)",
                            "rgba(50, 172, 45, 0.97)"
                        ],
                        "dateFormat": "YYYY-MM-DD HH:mm:ss",
                        "decimals": 2,
                        "mappingType": 1,
                        "pattern": "Time",
                        "thresholds": [],
                        "type": "hidden",
                        "unit": "short"
                    }
                ],
                "targets": [
                    {
                        "expr": "sum (\n sum(kube_persistentvolumeclaim_info{storageclass=~\".*ssd.*\"}) by (persistentvolumeclaim, namespace, storageclass)\n + on (persistentvolumeclaim, namespace) group_right(storageclass)\n sum(kube_persistentvolumeclaim_resource_requests_storage_bytes{namespace=~\"$namespace\"}) by (persistentvolumeclaim, namespace)\n) by (namespace,persistentvolumeclaim,storageclass) / 1024 / 1024 /1024 * $costStorageSSD\n\nor\n\nsum (\n sum(kube_persistentvolumeclaim_info{storageclass!~\".*ssd.*\"}) by (persistentvolumeclaim, namespace, storageclass)\n + on (persistentvolumeclaim, namespace) group_right(storageclass)\n sum(kube_persistentvolumeclaim_resource_requests_storage_bytes{namespace=~\"$namespace\"}) by (persistentvolumeclaim, namespace)\n) by (namespace,persistentvolumeclaim,storageclass) / 1024 / 1024 /1024 * $costStorageStandard\n",
                        "format": "table",
                        "hide": false,
                        "instant": true,
                        "interval": "",
                        "intervalFactor": 1,
                        "legendFormat": "{{ persistentvolumeclaim }}",
                        "refId": "A"
                    }
                ],
                "timeFrom": null,
                "timeShift": null,
                "title": "Persistent Volume Claims",
                "transform": "table",
                "transparent": false,
                "type": "table"
            },
            {
                "aliasColors": {},
                "bars": false,
                "dashLength": 10,
                "dashes": false,
                "datasource": "Prometheus",
                "description": "CPU requests by container divided by the rate of CPU usage over the last hour",
                "fill": 1,
                "gridPos": {
                    "h": 9,
                    "w": 24,
                    "x": 0,
                    "y": 9
                },
                "id": 100,
                "legend": {
                    "avg": false,
                    "current": false,
                    "max": false,
                    "min": false,
                    "show": true,
                    "total": false,
                    "values": false
                },
                "lines": true,
                "linewidth": 1,
                "links": [],
                "nullPointMode": "null",
                "percentage": false,
                "pointradius": 5,
                "points": false,
                "renderer": "flot",
                "seriesOverrides": [],
                "spaceLength": 10,
                "stack": false,
                "steppedLine": false,
                "targets": [
                    {
                        "expr": "topk(5, label_replace(\n label_replace(\n kube_pod_container_resource_requests_cpu_cores{namespace=\"$namespace\"},\n \"pod_name\", \n \"$1\", \n \"pod\", \n \"(.+)\"\n ),\n \"container_name\", \n \"$1\", \n \"container\", \n \"(.+)\"\n) \n/\non(pod_name,container_name) \nsum(\n rate(\n container_cpu_usage_seconds_total{namespace=\"$namespace\",pod_name=~\".+\"}[1h]\n )\n) \nby (pod_name,container_name))",
                        "format": "time_series",
                        "intervalFactor": 1,
                        "refId": "A"
                    }
                ],
                "thresholds": [],
                "timeFrom": null,
                "timeShift": null,
                "title": "Ratio of CPU requests to usage (by container)",
                "tooltip": {
                    "shared": true,
                    "sort": 0,
                    "value_type": "individual"
                },
                "type": "graph",
                "xaxis": {
                    "buckets": null,
                    "mode": "time",
                    "name": null,
                    "show": true,
                    "values": []
                },
                "yaxes": [
                    {
                        "format": "short",
                        "label": null,
                        "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": "Prometheus",
                "decimals": 3,
                "description": "This panel shows historical utilisation as an average across all pods in this namespace. It only accounts for currently deployed pods",
                "editable": true,
                "error": false,
                "fill": 0,
                "grid": {},
                "gridPos": {
                    "h": 6,
                    "w": 12,
                    "x": 0,
                    "y": 18
                },
                "height": "",
                "id": 94,
                "isNew": true,
                "legend": {
                    "alignAsTable": false,
                    "avg": false,
                    "current": false,
                    "hideEmpty": false,
                    "hideZero": false,
                    "max": false,
                    "min": false,
                    "rightSide": false,
                    "show": false,
                    "sideWidth": null,
                    "sort": "current",
                    "sortDesc": true,
                    "total": false,
                    "values": true
                },
                "lines": true,
                "linewidth": 2,
                "links": [],
                "nullPointMode": "connected",
                "percentage": false,
                "pointradius": 5,
                "points": false,
                "renderer": "flot",
                "seriesOverrides": [],
                "spaceLength": 10,
                "stack": false,
                "steppedLine": true,
                "targets": [
                    {
                        "expr": "sum (rate (container_cpu_usage_seconds_total{namespace=\"$namespace\"}[10m])) by (namespace) * 1000\n/\nsum(avg_over_time(container_spec_cpu_shares{namespace=\"$namespace\"}[10m])) by (namespace) * 100",
                        "format": "time_series",
                        "hide": false,
                        "instant": false,
                        "interval": "10s",
                        "intervalFactor": 1,
                        "legendFormat": "cpu",
                        "metric": "container_cpu",
                        "refId": "A",
                        "step": 10
                    }
                ],
                "thresholds": [],
                "timeFrom": "",
                "timeShift": null,
                "title": "Overall CPU Utilisation",
                "tooltip": {
                    "msResolution": true,
                    "shared": true,
                    "sort": 2,
                    "value_type": "cumulative"
                },
                "type": "graph",
                "xaxis": {
                    "buckets": null,
                    "mode": "time",
                    "name": null,
                    "show": true,
                    "values": []
                },
                "yaxes": [
                    {
                        "decimals": null,
                        "format": "percent",
                        "label": "",
                        "logBase": 1,
                        "max": "110",
                        "min": "0",
                        "show": true
                    },
                    {
                        "format": "short",
                        "label": null,
                        "logBase": 1,
                        "max": null,
                        "min": null,
                        "show": false
                    }
                ],
                "yaxis": {
                    "align": false,
                    "alignLevel": null
                }
            },
            {
                "aliasColors": {},
                "bars": false,
                "dashLength": 10,
                "dashes": false,
                "datasource": "Prometheus",
                "decimals": 2,
                "description": "This panel shows historical utilisation as an average across all pods in this namespace. It only accounts for currently deployed pods",
                "editable": true,
                "error": false,
                "fill": 0,
                "grid": {},
                "gridPos": {
                    "h": 6,
                    "w": 12,
                    "x": 12,
                    "y": 18
                },
                "id": 92,
                "isNew": true,
                "legend": {
                    "alignAsTable": false,
                    "avg": false,
                    "current": false,
                    "max": false,
                    "min": false,
                    "rightSide": false,
                    "show": false,
                    "sideWidth": 200,
                    "sort": "current",
                    "sortDesc": true,
                    "total": false,
                    "values": true
                },
                "lines": true,
                "linewidth": 2,
                "links": [],
                "nullPointMode": "connected",
                "percentage": false,
                "pointradius": 5,
                "points": false,
                "renderer": "flot",
                "seriesOverrides": [],
                "spaceLength": 10,
                "stack": false,
                "steppedLine": true,
                "targets": [
                    {
                        "expr": "sum (container_memory_working_set_bytes{namespace=\"$namespace\"}) by (namespace)\n/\nsum(container_spec_memory_limit_bytes{namespace=\"$namespace\"}) by (namespace) * 100",
                        "format": "time_series",
                        "instant": false,
                        "interval": "10s",
                        "intervalFactor": 1,
                        "legendFormat": "limit utilization",
                        "metric": "container_memory_usage:sort_desc",
                        "refId": "A",
                        "step": 10
                    },
                    {
                        "expr": "sum (container_memory_working_set_bytes{namespace=\"$namespace\"}) by (namespace)\n/\nsum(kube_pod_container_resource_requests_memory_bytes{namespace=\"$namespace\"}) by (namespace) * 100",
                        "format": "time_series",
                        "instant": false,
                        "intervalFactor": 1,
                        "legendFormat": "request utilization",
                        "refId": "B"
                    }
                ],
                "thresholds": [],
                "timeFrom": "",
                "timeShift": null,
                "title": "Overall RAM Utilisation",
                "tooltip": {
                    "msResolution": false,
                    "shared": true,
                    "sort": 2,
                    "value_type": "cumulative"
                },
                "type": "graph",
                "xaxis": {
                    "buckets": null,
                    "mode": "time",
                    "name": null,
                    "show": true,
                    "values": []
                },
                "yaxes": [
                    {
                        "decimals": null,
                        "format": "percent",
                        "label": null,
                        "logBase": 1,
                        "max": "110",
                        "min": "0",
                        "show": true
                    },
                    {
                        "format": "short",
                        "label": null,
                        "logBase": 1,
                        "max": null,
                        "min": null,
                        "show": false
                    }
                ],
                "yaxis": {
                    "align": false,
                    "alignLevel": null
                }
            },
            {
                "aliasColors": {},
                "bars": false,
                "dashLength": 10,
                "dashes": false,
                "datasource": "Prometheus",
                "decimals": 2,
                "description": "Traffic in and out of this namespace, as a sum of the pods within it",
                "editable": true,
                "error": false,
                "fill": 1,
                "grid": {},
                "gridPos": {
                    "h": 6,
                    "w": 12,
                    "x": 0,
                    "y": 24
                },
                "height": "",
                "id": 96,
                "isNew": true,
                "legend": {
                    "alignAsTable": false,
                    "avg": true,
                    "current": true,
                    "hideEmpty": false,
                    "hideZero": false,
                    "max": false,
                    "min": false,
                    "rightSide": false,
                    "show": true,
                    "sideWidth": null,
                    "sort": "current",
                    "sortDesc": true,
                    "total": false,
                    "values": true
                },
                "lines": true,
                "linewidth": 2,
                "links": [],
                "nullPointMode": "connected",
                "percentage": false,
                "pointradius": 5,
                "points": false,
                "renderer": "flot",
                "seriesOverrides": [],
                "spaceLength": 10,
                "stack": false,
                "steppedLine": false,
                "targets": [
                    {
                        "expr": "sum (rate (container_network_receive_bytes_total{namespace=\"$namespace\"}[10m])) by (namespace)",
                        "format": "time_series",
                        "hide": false,
                        "instant": false,
                        "interval": "",
                        "intervalFactor": 1,
                        "legendFormat": "<- in",
                        "metric": "container_cpu",
                        "refId": "A",
                        "step": 10
                    },
                    {
                        "expr": "- sum (rate (container_network_transmit_bytes_total{namespace=\"$namespace\"}[10m])) by (namespace)",
                        "format": "time_series",
                        "hide": false,
                        "instant": false,
                        "interval": "",
                        "intervalFactor": 1,
                        "legendFormat": "-> out",
                        "refId": "B"
                    }
                ],
                "thresholds": [],
                "timeFrom": "",
                "timeShift": null,
                "title": "Network IO",
                "tooltip": {
                    "msResolution": true,
                    "shared": true,
                    "sort": 2,
                    "value_type": "cumulative"
                },
                "type": "graph",
                "xaxis": {
                    "buckets": null,
                    "mode": "time",
                    "name": null,
                    "show": true,
                    "values": []
                },
                "yaxes": [
                    {
                        "format": "Bps",
                        "label": "",
                        "logBase": 1,
                        "max": null,
                        "min": null,
                        "show": true
                    },
                    {
                        "format": "short",
                        "label": null,
                        "logBase": 1,
                        "max": null,
                        "min": null,
                        "show": false
                    }
                ],
                "yaxis": {
                    "align": false,
                    "alignLevel": null
                }
            },
            {
                "aliasColors": {},
                "bars": false,
                "dashLength": 10,
                "dashes": false,
                "datasource": "Prometheus",
                "decimals": 2,
                "description": "Disk reads and writes for the namespace, as a sum of the pods within it",
                "editable": true,
                "error": false,
                "fill": 1,
                "grid": {},
                "gridPos": {
                    "h": 6,
                    "w": 12,
                    "x": 12,
                    "y": 24
                },
                "height": "",
                "id": 98,
                "isNew": true,
                "legend": {
                    "alignAsTable": false,
                    "avg": true,
                    "current": true,
                    "hideEmpty": false,
                    "hideZero": false,
                    "max": false,
                    "min": false,
                    "rightSide": false,
                    "show": true,
                    "sideWidth": null,
                    "sort": "current",
                    "sortDesc": true,
                    "total": false,
                    "values": true
                },
                "lines": true,
                "linewidth": 2,
                "links": [],
                "nullPointMode": "connected",
                "percentage": false,
                "pointradius": 5,
                "points": false,
                "renderer": "flot",
                "seriesOverrides": [],
                "spaceLength": 10,
                "stack": false,
                "steppedLine": false,
                "targets": [
                    {
                        "expr": "sum (rate (container_fs_writes_bytes_total{namespace=\"$namespace\"}[10m])) by (namespace)",
                        "format": "time_series",
                        "hide": false,
                        "instant": false,
                        "interval": "",
                        "intervalFactor": 1,
                        "legendFormat": "<- write",
                        "metric": "container_cpu",
                        "refId": "A",
                        "step": 10
                    },
                    {
                        "expr": "- sum (rate (container_fs_reads_bytes_total{namespace=\"$namespace\"}[10m])) by (namespace)",
                        "format": "time_series",
                        "hide": false,
                        "instant": false,
                        "interval": "",
                        "intervalFactor": 1,
                        "legendFormat": "-> read",
                        "refId": "B"
                    }
                ],
                "thresholds": [],
                "timeFrom": "",
                "timeShift": null,
                "title": "Disk IO",
                "tooltip": {
                    "msResolution": true,
                    "shared": true,
                    "sort": 2,
                    "value_type": "cumulative"
                },
                "type": "graph",
                "xaxis": {
                    "buckets": null,
                    "mode": "time",
                    "name": null,
                    "show": true,
                    "values": []
                },
                "yaxes": [
                    {
                        "format": "Bps",
                        "label": "",
                        "logBase": 1,
                        "max": null,
                        "min": null,
                        "show": true
                    },
                    {
                        "format": "short",
                        "label": null,
                        "logBase": 1,
                        "max": null,
                        "min": null,
                        "show": false
                    }
                ],
                "yaxis": {
                    "align": false,
                    "alignLevel": null
                }
            }
        ],
        "refresh": "10s",
        "schemaVersion": 16,
        "style": "dark",
        "tags": [
            "cost",
            "utilisation",
            "metrics"
        ],
        "templating": {
            "list": [
                {
                    "current": {
                        "text": "23.06",
                        "value": "23.06"
                    },
                    "hide": 0,
                    "label": "CPU",
                    "name": "costcpu",
                    "options": [
                        {
                            "text": "23.06",
                            "value": "23.06"
                        }
                    ],
                    "query": "23.06",
                    "skipUrlSync": false,
                    "type": "constant"
                },
                {
                    "current": {
                        "text": "7.28",
                        "value": "7.28"
                    },
                    "hide": 0,
                    "label": "PE CPU",
                    "name": "costpcpu",
                    "options": [
                        {
                            "text": "7.28",
                            "value": "7.28"
                        }
                    ],
                    "query": "7.28",
                    "skipUrlSync": false,
                    "type": "constant"
                },
                {
                    "current": {
                        "text": "3.25",
                        "value": "3.25"
                    },
                    "hide": 0,
                    "label": "RAM",
                    "name": "costram",
                    "options": [
                        {
                            "text": "3.25",
                            "value": "3.25"
                        }
                    ],
                    "query": "3.25",
                    "skipUrlSync": false,
                    "type": "constant"
                },
                {
                    "current": {
                        "text": "0.6862",
                        "value": "0.6862"
                    },
                    "hide": 0,
                    "label": "PE RAM",
                    "name": "costpram",
                    "options": [
                        {
                            "text": "0.6862",
                            "value": "0.6862"
                        }
                    ],
                    "query": "0.6862",
                    "skipUrlSync": false,
                    "type": "constant"
                },
                {
                    "current": {
                        "text": "0.04",
                        "value": "0.04"
                    },
                    "hide": 0,
                    "label": "Storage",
                    "name": "costStorageStandard",
                    "options": [
                        {
                            "text": "0.04",
                            "value": "0.04"
                        }
                    ],
                    "query": "0.04",
                    "skipUrlSync": false,
                    "type": "constant"
                },
                {
                    "current": {
                        "text": ".17",
                        "value": ".17"
                    },
                    "hide": 0,
                    "label": "SSD",
                    "name": "costStorageSSD",
                    "options": [
                        {
                            "text": ".17",
                            "value": ".17"
                        }
                    ],
                    "query": ".17",
                    "skipUrlSync": false,
                    "type": "constant"
                },
                {
                    "current": {
                        "text": "30",
                        "value": "30"
                    },
                    "hide": 0,
                    "label": "Disc.",
                    "name": "costDiscount",
                    "options": [
                        {
                            "text": "30",
                            "value": "30"
                        }
                    ],
                    "query": "30",
                    "skipUrlSync": false,
                    "type": "constant"
                },
                {
                    "allValue": null,
                    "current": {
                        "tags": [],
                        "text": "default",
                        "value": "default"
                    },
                    "datasource": "Prometheus",
                    "hide": 0,
                    "includeAll": false,
                    "label": "NS",
                    "multi": false,
                    "name": "namespace",
                    "options": [],
                    "query": "query_result(sum(container_memory_working_set_bytes{namespace!=\"\"}) by (namespace))",
                    "refresh": 1,
                    "regex": "/namespace=\\\"(.*?)(\\\")/",
                    "skipUrlSync": false,
                    "sort": 0,
                    "tagValuesQuery": "",
                    "tags": [],
                    "tagsQuery": "",
                    "type": "query",
                    "useTags": false
                }
            ]
        },
        "time": {
            "from": "now-15m",
            "to": "now"
        },
        "timepicker": {
            "hidden": false,
            "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": "Namespace cost & utilization metrics",
        "uid": "at-cost-analysis-namespace",
        "version": 3
    }