diff --git a/cost-analyzer/grafana-templates/multi-cluster-container-stats.json b/cost-analyzer/grafana-templates/multi-cluster-container-stats.json index 7467e2ede..8a39e09ce 100644 --- a/cost-analyzer/grafana-templates/multi-cluster-container-stats.json +++ b/cost-analyzer/grafana-templates/multi-cluster-container-stats.json @@ -1,8 +1,8 @@ { "__inputs": [ { - "name": "DS_PROMETHEUS", - "label": "Prometheus", + "name": "DS_THANOS", + "label": "Thanos", "description": "", "type": "datasource", "pluginId": "prometheus", @@ -15,7 +15,7 @@ "type": "grafana", "id": "grafana", "name": "Grafana", - "version": "9.5.2" + "version": "10.3.1" }, { "type": "datasource", @@ -23,12 +23,6 @@ "name": "Prometheus", "version": "1.0.0" }, - { - "type": "panel", - "id": "table", - "name": "Table", - "version": "" - }, { "type": "panel", "id": "timeseries", @@ -58,7 +52,7 @@ } ] }, - "description": "Visualize your kubernetes costs at the pod level.", + "description": "", "editable": true, "fiscalYearStartMonth": 0, "gnetId": 9063, @@ -70,21 +64,48 @@ { "datasource": { "type": "prometheus", - "uid": "${datasource}" + "uid": "${DS_THANOS}" }, + "description": "Maximum CPU Core Usage vs avg Requested", "fieldConfig": { "defaults": { "color": { - "mode": "thresholds" + "mode": "palette-classic" }, "custom": { - "align": "auto", - "cellOptions": { - "type": "auto" + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false }, - "inspect": false + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": 3600000, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } }, "mappings": [], + "min": 0, "thresholds": { "mode": "absolute", "steps": [ @@ -97,316 +118,228 @@ "value": 80 } ] - } + }, + "unit": "none", + "unitScale": true }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "container" - }, - "properties": [ - { - "id": "displayName", - "value": "Container" - }, - { - "id": "unit", - "value": "currencyUSD" - }, - { - "id": "decimals", - "value": 2 - }, - { - "id": "custom.align" - }, - { - "id": "thresholds", - "value": { - "mode": "absolute", - "steps": [ - { - "color": "rgba(245, 54, 54, 0.9)", - "value": null - }, - { - "color": "rgba(50, 172, 45, 0.97)", - "value": 30 - }, - { - "color": "#c15c17", - "value": 80 - } - ] - } - } - ] + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 12, + "x": 0, + "y": 0 + }, + "id": 94, + "links": [], + "options": { + "legend": { + "calcs": [ + "max" + ], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "9.4.7", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_THANOS}" }, - { - "matcher": { - "id": "byName", - "options": "Value #memory_requests" - }, - "properties": [ - { - "id": "displayName", - "value": "Memory Request" - }, - { - "id": "unit", - "value": "bytes" - }, - { - "id": "decimals", - "value": 2 - }, - { - "id": "custom.align" - } - ] + "editorMode": "code", + "expr": "max(irate(container_cpu_usage_seconds_total\r\n {cluster_id=\"$cluster\",namespace=~\"$namespace\",pod=~\"$pod\", container=~\"$container\", container!=\"POD\",container!=\"\"}\r\n [$__rate_interval])) \r\n by (cluster_id, namespace, pod, container)", + "format": "time_series", + "hide": false, + "instant": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "{{cluster_id}} {{namespace}}/{{pod}}/{{container}} (usage max)", + "metric": "container_cpu", + "refId": "A", + "step": 10 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_THANOS}" }, - { - "matcher": { - "id": "byName", - "options": "Value #cpu_requests" - }, - "properties": [ - { - "id": "displayName", - "value": "CPU Request" - }, - { - "id": "unit", - "value": "none" - }, - { - "id": "decimals", - "value": 2 - }, - { - "id": "custom.align" - } - ] + "editorMode": "code", + "exemplar": true, + "expr": "avg(kube_pod_container_resource_requests\r\n {cluster_id=\"$cluster\",resource=\"cpu\",unit=\"core\",namespace=~\"$namespace\",pod=~\"$pod\",container=~\"$container\",container!=\"POD\"}\r\n ) \r\nby (cluster_id,namespace,pod,container)", + "legendFormat": "{{cluster_id}} {{namespace}}/{{pod}}/{{container}} (requested)", + "range": true, + "refId": "B" + } + ], + "timeFrom": "", + "title": "CPU Core Usage vs Requested", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_THANOS}" + }, + "description": "Max memory used vs avg requested", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" }, - { - "matcher": { - "id": "byName", - "options": "Time" + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false }, - "properties": [ - { - "id": "unit", - "value": "short" - }, - { - "id": "decimals", - "value": 2 - }, - { - "id": "custom.align" - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Value #C" + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" }, - "properties": [ - { - "id": "displayName", - "value": "Memory ($/hour)" - }, - { - "id": "unit", - "value": "currencyUSD" - }, - { - "id": "decimals", - "value": 2 - }, - { - "id": "custom.align" - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Value #D" + "showPoints": "auto", + "spanNulls": 3600000, + "stacking": { + "group": "A", + "mode": "none" }, - "properties": [ - { - "id": "displayName", - "value": "Spot/PE RAM" - }, - { - "id": "unit", - "value": "currencyUSD" - }, - { - "id": "decimals", - "value": 2 - }, - { - "id": "custom.align" - } - ] + "thresholdsStyle": { + "mode": "off" + } }, - { - "matcher": { - "id": "byName", - "options": "Value #E" - }, - "properties": [ - { - "id": "displayName", - "value": "Total" - }, - { - "id": "unit", - "value": "currencyUSD" - }, - { - "id": "decimals", - "value": 2 - }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ { - "id": "custom.align" + "color": "green", + "value": null }, { - "id": "thresholds", - "value": { - "mode": "absolute", - "steps": [ - { - "color": "#bf1b00", - "value": null - }, - { - "color": "rgba(50, 172, 45, 0.97)" - } - ] - } + "color": "red", + "value": 80 } ] }, - { - "matcher": { - "id": "byName", - "options": "cluster_id" - }, - "properties": [ - { - "id": "custom.width", - "value": 226 - } - ] - } - ] + "unit": "bytes", + "unitScale": true + }, + "overrides": [] }, "gridPos": { - "h": 8, - "w": 24, - "x": 0, + "h": 7, + "w": 12, + "x": 12, "y": 0 }, - "hideTimeOverride": true, - "id": 98, + "id": 96, "links": [], "options": { - "cellHeight": "sm", - "footer": { - "countRows": false, - "fields": "", - "reducer": [ - "sum" + "legend": { + "calcs": [ + "max" ], - "show": false + "displayMode": "list", + "placement": "bottom", + "showLegend": true }, - "showHeader": true, - "sortBy": [ - { - "desc": true, - "displayName": "Memory Request" - } - ] + "tooltip": { + "mode": "multi", + "sort": "asc" + } }, - "pluginVersion": "9.5.2", - "repeatDirection": "v", + "pluginVersion": "9.4.7", "targets": [ { "datasource": { "type": "prometheus", - "uid": "${datasource}" + "uid": "${DS_THANOS}" }, - "expr": "sum(\n avg_over_time(kube_pod_container_resource_requests{resource=\"memory\",cluster_id=~\"$cluster\", namespace=~\"$namespace\", container=~\"$container\", container!=\"POD\"}[$__range])\n) by (cluster_id, namespace, container)", - "format": "table", - "instant": true, + "editorMode": "code", + "expr": "max(max_over_time(container_memory_working_set_bytes\r\n {namespace=~\"$namespace\",pod=~\"$pod\",cluster_id=\"$cluster\",container=~\"$container\",container!=\"POD\",container!=\"\"}\r\n [$__rate_interval])) \r\nby (cluster_id,namespace,pod,container)", + "format": "time_series", + "hide": false, + "instant": false, + "interval": "", "intervalFactor": 1, - "refId": "memory_requests" + "legendFormat": "{{cluster_id}} {{namespace}}/{{pod}}/{{container}} (usage max)", + "metric": "container_cpu", + "refId": "MEMORY_USAGE", + "step": 10 }, { "datasource": { "type": "prometheus", - "uid": "${datasource}" + "uid": "${DS_THANOS}" }, - "expr": "sum(\n avg_over_time(kube_pod_container_resource_requests{resource=\"cpu\",cluster_id=~\"$cluster\", namespace=~\"$namespace\", container=~\"$container\", container!=\"POD\"}[$__range])\n or up * 0 \n) by (cluster_id, namespace, container)", - "format": "table", + "editorMode": "code", + "expr": "avg(kube_pod_container_resource_requests\n {resource=\"memory\",unit=\"byte\",cluster_id=\"$cluster\",namespace=~\"$namespace\",pod=~\"$pod\", container=~\"$container\",container!=\"POD\"}\n )\nby (cluster_id,namespace,pod,container)", + "format": "time_series", "hide": false, - "instant": true, - "interval": "", + "instant": false, "intervalFactor": 1, - "legendFormat": "", - "refId": "cpu_requests" + "legendFormat": "{{cluster_id}} {{namespace}}/{{pod}}/{{container}} (requested)", + "refId": "MEMORY_REQUESTED" } ], - "timeFrom": "1M", - "title": "Container allocation analysis", - "transformations": [ - { - "id": "merge", - "options": { - "reducers": [] - } - } - ], - "type": "table" + "timeFrom": "", + "title": "Memory Usage vs Requested", + "type": "timeseries" }, { "datasource": { "type": "prometheus", - "uid": "${datasource}" + "uid": "${DS_THANOS}" }, - "description": "CPU usage vs requests", + "description": "Network traffic by pod", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", - "fillOpacity": 0, + "fillOpacity": 10, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, - "lineInterpolation": "stepAfter", + "insertNulls": false, + "lineInterpolation": "linear", "lineWidth": 2, "pointSize": 5, "scaleDistribution": { "type": "linear" }, - "showPoints": "never", - "spanNulls": true, + "showPoints": "auto", + "spanNulls": 3600000, "stacking": { "group": "A", "mode": "none" @@ -416,7 +349,6 @@ } }, "mappings": [], - "min": 0, "thresholds": { "mode": "absolute", "steps": [ @@ -430,21 +362,24 @@ } ] }, - "unit": "none" + "unit": "Bps", + "unitScale": true }, "overrides": [] }, "gridPos": { "h": 7, - "w": 24, + "w": 12, "x": 0, - "y": 8 + "y": 7 }, - "id": 94, + "id": 95, "links": [], "options": { "legend": { - "calcs": [], + "calcs": [ + "mean" + ], "displayMode": "list", "placement": "bottom", "showLegend": true @@ -454,75 +389,80 @@ "sort": "desc" } }, - "pluginVersion": "9.1.0-beta1", + "pluginVersion": "9.4.7", "targets": [ { "datasource": { "type": "prometheus", - "uid": "${datasource}" + "uid": "${DS_THANOS}" }, "editorMode": "code", - "expr": "avg(rate(container_cpu_usage_seconds_total{cluster_id=~\"$cluster\", namespace=~\"$namespace\", container=~\"$container\", container!=\"POD\",container!=\"\"}[10m])) by (cluster_id, namespace, container)", + "expr": "sum(irate(container_network_receive_bytes_total\n {cluster_id=~\"$cluster\",namespace=~\"$namespace\",pod=~\"$pod\"}\n [$__rate_interval])) \nby (cluster_id, namespace, pod)", "format": "time_series", "hide": false, "instant": false, "interval": "", "intervalFactor": 1, - "legendFormat": "{{cluster_id}}/{{namespace}}/{{container}} (usage)", + "legendFormat": "{{cluster_id}} {{namespace}}/{{pod}}<- in", "metric": "container_cpu", - "refId": "usage", + "refId": "A", "step": 10 }, { "datasource": { "type": "prometheus", - "uid": "${datasource}" + "uid": "${DS_THANOS}" }, "editorMode": "code", - "exemplar": true, - "expr": "avg(kube_pod_container_resource_requests{resource=\"cpu\", unit=\"core\", cluster_id=~\"$cluster\", namespace=~\"$namespace\", container=~\"$container\", container!=\"POD\"}) by (cluster_id, namespace, container)", - "legendFormat": "{{cluster_id}}/{{namespace}}/{{ container }} (request)", - "range": true, - "refId": "requests" + "expr": "- sum(irate(container_network_transmit_bytes_total\n {cluster_id=\"$cluster\",namespace=~\"$namespace\",pod=~\"$pod\"}\n [$__rate_interval])) \nby (cluster_id, namespace, pod)", + "format": "time_series", + "hide": false, + "instant": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "{{cluster_id}} {{namespace}}/{{pod}}-> out", + "refId": "B" } ], "timeFrom": "", - "title": "CPU Usage vs Requested", + "title": "Network IO", "type": "timeseries" }, { "datasource": { "type": "prometheus", - "uid": "${datasource}" + "uid": "${DS_THANOS}" }, - "description": "Memory usage vs. requests", + "description": "Disk read writes", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", - "fillOpacity": 0, + "fillOpacity": 10, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, - "lineInterpolation": "stepAfter", + "insertNulls": false, + "lineInterpolation": "linear", "lineWidth": 2, "pointSize": 5, "scaleDistribution": { "type": "linear" }, - "showPoints": "never", - "spanNulls": true, + "showPoints": "auto", + "spanNulls": 3600000, "stacking": { "group": "A", "mode": "none" @@ -532,7 +472,6 @@ } }, "mappings": [], - "min": 0, "thresholds": { "mode": "absolute", "steps": [ @@ -546,21 +485,24 @@ } ] }, - "unit": "bytes" + "unit": "Bps", + "unitScale": true }, "overrides": [] }, "gridPos": { "h": 7, - "w": 24, - "x": 0, - "y": 15 + "w": 12, + "x": 12, + "y": 7 }, - "id": 96, + "id": 97, "links": [], "options": { "legend": { - "calcs": [], + "calcs": [ + "mean" + ], "displayMode": "list", "placement": "bottom", "showLegend": true @@ -570,21 +512,21 @@ "sort": "desc" } }, - "pluginVersion": "9.1.0-beta1", + "pluginVersion": "9.4.7", "targets": [ { "datasource": { "type": "prometheus", - "uid": "${datasource}" + "uid": "${DS_THANOS}" }, "editorMode": "code", - "expr": "avg(avg_over_time(container_memory_working_set_bytes{cluster_id=~\"$cluster\", namespace=~\"$namespace\", container=~\"$container\", container!=\"POD\",container!=\"\"}[5m])) by (cluster_id, namespace, container)", + "expr": "sum(irate(container_fs_writes_bytes_total\r\n {cluster_id=\"$cluster\",namespace=~\"$namespace\",container!=\"POD\",pod!=\"\",pod=~\"$pod\",container=~\"$container\"}\r\n [$__rate_interval])) \r\nby (cluster_id,namespace,pod,container)", "format": "time_series", "hide": false, "instant": false, "interval": "", "intervalFactor": 1, - "legendFormat": "{{cluster_id}}/{{namespace}}/{{ container }} (usage)", + "legendFormat": "{{cluster_id}} {{pod}}/{{container}}<- write", "metric": "container_cpu", "refId": "A", "step": 10 @@ -592,34 +534,36 @@ { "datasource": { "type": "prometheus", - "uid": "${datasource}" + "uid": "${DS_THANOS}" }, "editorMode": "code", - "expr": "avg(kube_pod_container_resource_requests{resource=\"memory\", unit=\"byte\", cluster_id=~\"$cluster\", namespace=~\"$namespace\", container=~\"$container\", container!=\"POD\"}) by (cluster_id, namespace, container)", + "expr": "- sum(irate(container_fs_reads_bytes_total\r\n {cluster_id=\"$cluster\",namespace=~\"$namespace\",container!=\"POD\",pod!=\"\",pod=~\"$pod\",container=~\"$container\"}\r\n [$__rate_interval])) \r\nby (cluster_id,namespace,pod,container)", "format": "time_series", "hide": false, "instant": false, + "interval": "", "intervalFactor": 1, - "legendFormat": "{{cluster_id}}/{{namespace}}/{{ container }} (requested)", + "legendFormat": "{{cluster_id}} {{pod}}/{{container}}-> read", "refId": "B" } ], "timeFrom": "", - "title": "RAM Usage vs Requested", + "title": "Disk IO", "type": "timeseries" }, { "datasource": { "type": "prometheus", - "uid": "${datasource}" + "uid": "${DS_THANOS}" }, - "description": "Percentage of time a pod is being throttled. Values range from 0-100", + "description": "This graph shows the % of periods where a pod is being throttled. Values range from 0-100", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", @@ -633,14 +577,15 @@ "tooltip": false, "viz": false }, - "lineInterpolation": "stepAfter", + "insertNulls": false, + "lineInterpolation": "linear", "lineWidth": 2, "pointSize": 5, "scaleDistribution": { "type": "linear" }, - "showPoints": "never", - "spanNulls": true, + "showPoints": "auto", + "spanNulls": 1800000, "stacking": { "group": "A", "mode": "none" @@ -664,21 +609,24 @@ } ] }, - "unit": "none" + "unit": "percent", + "unitScale": true }, "overrides": [] }, "gridPos": { - "h": 6, - "w": 24, + "h": 7, + "w": 12, "x": 0, - "y": 22 + "y": 14 }, "id": 99, "links": [], "options": { "legend": { - "calcs": [], + "calcs": [ + "mean" + ], "displayMode": "list", "placement": "bottom", "showLegend": true @@ -688,20 +636,20 @@ "sort": "desc" } }, - "pluginVersion": "9.1.0-beta1", + "pluginVersion": "9.4.7", "targets": [ { "datasource": { "type": "prometheus", - "uid": "${datasource}" + "uid": "${DS_THANOS}" }, "editorMode": "code", - "expr": "100\n * sum by(cluster_id, namespace, container) (increase(container_cpu_cfs_throttled_periods_total{container!=\"\",cluster_id=~\"$cluster\", namespace=~\"$namespace\", container=~\"$container\", container!=\"POD\"}[5m]))\n / sum by(cluster_id, namespace, container) (increase(container_cpu_cfs_periods_total{container!=\"\",cluster_id=~\"$cluster\", namespace=~\"$namespace\", container=~\"$container\", container!=\"POD\"}[5m]))", + "expr": "100\n * sum by(cluster_id, namespace, pod, container) (increase(container_cpu_cfs_throttled_periods_total{container!=\"\",cluster_id=\"$cluster\", namespace=~\"$namespace\", pod=~\"$pod\", container=~\"$container\", container!=\"POD\"}[$__rate_interval]))\n / sum by(cluster_id,namespace,pod,container) (increase(container_cpu_cfs_periods_total{container!=\"\",cluster_id=\"$cluster\",namespace=~\"$namespace\",pod=~\"$pod\",container=~\"$container\",container!=\"POD\"}[$__rate_interval]))", "format": "time_series", "instant": false, "interval": "", "intervalFactor": 1, - "legendFormat": "{{cluster_id}}/{{namespace}}/{{ container }}", + "legendFormat": "", "refId": "B" } ], @@ -712,48 +660,39 @@ ], "refresh": "", "revision": 1, - "schemaVersion": 38, - "style": "dark", - "tags": [ - "utilization", - "metrics", - "kubecost" - ], + "schemaVersion": 39, + "tags": [], "templating": { "list": [ { - "current": { - "selected": false, - "text": "Prometheus", - "value": "Prometheus" - }, + "current": {}, + "definition": "label_values(cluster_id)", "hide": 0, "includeAll": false, "multi": false, - "name": "datasource", + "name": "cluster", "options": [], - "query": "prometheus", - "queryValue": "", - "refresh": 1, + "query": { + "query": "label_values(cluster_id)", + "refId": "StandardVariableQuery" + }, + "refresh": 2, "regex": "", "skipUrlSync": false, - "type": "datasource" + "sort": 5, + "type": "query" }, { "current": {}, - "datasource": { - "type": "prometheus", - "uid": "${datasource}" - }, - "definition": "label_values(kube_namespace_labels, cluster_id)", + "definition": "label_values(kube_namespace_labels{cluster_id=\"$cluster\"}, namespace) ", "hide": 0, "includeAll": true, "label": "", "multi": false, - "name": "cluster", + "name": "namespace", "options": [], "query": { - "query": "label_values(kube_namespace_labels, cluster_id)", + "query": "label_values(kube_namespace_labels{cluster_id=\"$cluster\"}, namespace) ", "refId": "StandardVariableQuery" }, "refresh": 2, @@ -767,25 +706,21 @@ }, { "current": {}, - "datasource": { - "type": "prometheus", - "uid": "${datasource}" - }, - "definition": "label_values(kube_namespace_labels{cluster_id=~\"$cluster\"}, namespace) ", + "definition": "label_values(kube_pod_labels{cluster_id=\"$cluster\",namespace=~\"$namespace\"}, pod) ", "hide": 0, "includeAll": true, - "label": "", + "label": "pod", "multi": false, - "name": "namespace", + "name": "pod", "options": [], "query": { - "query": "label_values(kube_namespace_labels{cluster_id=~\"$cluster\"}, namespace) ", + "query": "label_values(kube_pod_labels{cluster_id=\"$cluster\",namespace=~\"$namespace\"}, pod) ", "refId": "StandardVariableQuery" }, "refresh": 2, "regex": "", "skipUrlSync": false, - "sort": 5, + "sort": 1, "tagValuesQuery": "", "tagsQuery": "", "type": "query", @@ -793,18 +728,14 @@ }, { "current": {}, - "datasource": { - "type": "prometheus", - "uid": "${datasource}" - }, - "definition": "label_values(container_memory_working_set_bytes{cluster_id=~\"$cluster\",namespace=~\"$namespace\", container!=\"POD\"}, container) ", + "definition": "label_values(container_memory_working_set_bytes{cluster_id=\"$cluster\",namespace=~\"$namespace\",pod=~\"$pod\", container!=\"POD\"}, container) ", "hide": 0, "includeAll": true, "multi": false, "name": "container", "options": [], "query": { - "query": "label_values(container_memory_working_set_bytes{cluster_id=~\"$cluster\",namespace=~\"$namespace\", container!=\"POD\"}, container) ", + "query": "label_values(container_memory_working_set_bytes{cluster_id=\"$cluster\",namespace=~\"$namespace\",pod=~\"$pod\", container!=\"POD\"}, container) ", "refId": "StandardVariableQuery" }, "refresh": 2, @@ -816,7 +747,7 @@ ] }, "time": { - "from": "now-7d", + "from": "now-2d", "to": "now" }, "timepicker": { @@ -845,8 +776,8 @@ ] }, "timezone": "browser", - "title": "Kubecost - container CPU & Memory usage(multi-cluster)", - "uid": "kubecost-container-stats", + "title": "Pod utilization metrics (multi-cluster)", + "uid": "at-cost-analysis-pod2", "version": 1, "weekStart": "" } \ No newline at end of file diff --git a/cost-analyzer/pod-utilization-multi-cluster.json b/cost-analyzer/pod-utilization-multi-cluster.json index 6839559e3..3eb5184bb 100644 --- a/cost-analyzer/pod-utilization-multi-cluster.json +++ b/cost-analyzer/pod-utilization-multi-cluster.json @@ -26,14 +26,14 @@ "fiscalYearStartMonth": 0, "gnetId": 9063, "graphTooltip": 0, - "id": 13, + "id": 4, "links": [], "liveNow": false, "panels": [ { "datasource": { "type": "prometheus", - "uid": "${datasource}" + "uid": "Thanos" }, "description": "Maximum CPU Core Usage vs avg Requested", "fieldConfig": { @@ -42,6 +42,7 @@ "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", @@ -55,6 +56,7 @@ "tooltip": false, "viz": false }, + "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 2, "pointSize": 5, @@ -86,7 +88,8 @@ } ] }, - "unit": "none" + "unit": "none", + "unitScale": true }, "overrides": [] }, @@ -117,7 +120,7 @@ { "datasource": { "type": "prometheus", - "uid": "${datasource}" + "uid": "Thanos" }, "editorMode": "code", "expr": "max(irate(container_cpu_usage_seconds_total\r\n {cluster_id=\"$cluster\",namespace=~\"$namespace\",pod=~\"$pod\", container=~\"$container\", container!=\"POD\",container!=\"\"}\r\n [$__rate_interval])) \r\n by (cluster_id, namespace, pod, container)", @@ -134,7 +137,7 @@ { "datasource": { "type": "prometheus", - "uid": "${datasource}" + "uid": "Thanos" }, "editorMode": "code", "exemplar": true, @@ -151,7 +154,7 @@ { "datasource": { "type": "prometheus", - "uid": "${datasource}" + "uid": "Thanos" }, "description": "Max memory used vs avg requested", "fieldConfig": { @@ -160,6 +163,7 @@ "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", @@ -173,6 +177,7 @@ "tooltip": false, "viz": false }, + "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 2, "pointSize": 5, @@ -204,7 +209,8 @@ } ] }, - "unit": "bytes" + "unit": "bytes", + "unitScale": true }, "overrides": [] }, @@ -234,7 +240,8 @@ "targets": [ { "datasource": { - "uid": "${datasource}" + "type": "prometheus", + "uid": "Thanos" }, "editorMode": "code", "expr": "max(max_over_time(container_memory_working_set_bytes\r\n {namespace=~\"$namespace\",pod=~\"$pod\",cluster_id=\"$cluster\",container=~\"$container\",container!=\"POD\",container!=\"\"}\r\n [$__rate_interval])) \r\nby (cluster_id,namespace,pod,container)", @@ -250,7 +257,8 @@ }, { "datasource": { - "uid": "${datasource}" + "type": "prometheus", + "uid": "Thanos" }, "editorMode": "code", "expr": "avg(kube_pod_container_resource_requests\n {resource=\"memory\",unit=\"byte\",cluster_id=\"$cluster\",namespace=~\"$namespace\",pod=~\"$pod\", container=~\"$container\",container!=\"POD\"}\n )\nby (cluster_id,namespace,pod,container)", @@ -269,7 +277,7 @@ { "datasource": { "type": "prometheus", - "uid": "${datasource}" + "uid": "Thanos" }, "description": "Network traffic by pod", "fieldConfig": { @@ -278,6 +286,7 @@ "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", @@ -291,6 +300,7 @@ "tooltip": false, "viz": false }, + "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 2, "pointSize": 5, @@ -321,7 +331,8 @@ } ] }, - "unit": "Bps" + "unit": "Bps", + "unitScale": true }, "overrides": [] }, @@ -351,7 +362,8 @@ "targets": [ { "datasource": { - "uid": "${datasource}" + "type": "prometheus", + "uid": "Thanos" }, "editorMode": "code", "expr": "sum(irate(container_network_receive_bytes_total\n {cluster_id=~\"$cluster\",namespace=~\"$namespace\",pod=~\"$pod\"}\n [$__rate_interval])) \nby (cluster_id, namespace, pod)", @@ -367,7 +379,8 @@ }, { "datasource": { - "uid": "${datasource}" + "type": "prometheus", + "uid": "Thanos" }, "editorMode": "code", "expr": "- sum(irate(container_network_transmit_bytes_total\n {cluster_id=\"$cluster\",namespace=~\"$namespace\",pod=~\"$pod\"}\n [$__rate_interval])) \nby (cluster_id, namespace, pod)", @@ -387,7 +400,7 @@ { "datasource": { "type": "prometheus", - "uid": "${datasource}" + "uid": "Thanos" }, "description": "Disk read writes", "fieldConfig": { @@ -396,6 +409,7 @@ "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", @@ -409,6 +423,7 @@ "tooltip": false, "viz": false }, + "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 2, "pointSize": 5, @@ -439,7 +454,8 @@ } ] }, - "unit": "Bps" + "unit": "Bps", + "unitScale": true }, "overrides": [] }, @@ -469,7 +485,8 @@ "targets": [ { "datasource": { - "uid": "${datasource}" + "type": "prometheus", + "uid": "Thanos" }, "editorMode": "code", "expr": "sum(irate(container_fs_writes_bytes_total\r\n {cluster_id=\"$cluster\",namespace=~\"$namespace\",container!=\"POD\",pod!=\"\",pod=~\"$pod\",container=~\"$container\"}\r\n [$__rate_interval])) \r\nby (cluster_id,namespace,pod,container)", @@ -485,7 +502,8 @@ }, { "datasource": { - "uid": "${datasource}" + "type": "prometheus", + "uid": "Thanos" }, "editorMode": "code", "expr": "- sum(irate(container_fs_reads_bytes_total\r\n {cluster_id=\"$cluster\",namespace=~\"$namespace\",container!=\"POD\",pod!=\"\",pod=~\"$pod\",container=~\"$container\"}\r\n [$__rate_interval])) \r\nby (cluster_id,namespace,pod,container)", @@ -505,7 +523,7 @@ { "datasource": { "type": "prometheus", - "uid": "${datasource}" + "uid": "Thanos" }, "description": "This graph shows the % of periods where a pod is being throttled. Values range from 0-100", "fieldConfig": { @@ -514,6 +532,7 @@ "mode": "palette-classic" }, "custom": { + "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", @@ -527,6 +546,7 @@ "tooltip": false, "viz": false }, + "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 2, "pointSize": 5, @@ -558,7 +578,8 @@ } ] }, - "unit": "percent" + "unit": "percent", + "unitScale": true }, "overrides": [] }, @@ -588,7 +609,8 @@ "targets": [ { "datasource": { - "uid": "${datasource}" + "type": "prometheus", + "uid": "Thanos" }, "editorMode": "code", "expr": "100\n * sum by(cluster_id, namespace, pod, container) (increase(container_cpu_cfs_throttled_periods_total{container!=\"\",cluster_id=\"$cluster\", namespace=~\"$namespace\", pod=~\"$pod\", container=~\"$container\", container!=\"POD\"}[$__rate_interval]))\n / sum by(cluster_id,namespace,pod,container) (increase(container_cpu_cfs_periods_total{container!=\"\",cluster_id=\"$cluster\",namespace=~\"$namespace\",pod=~\"$pod\",container=~\"$container\",container!=\"POD\"}[$__rate_interval]))", @@ -607,20 +629,19 @@ ], "refresh": "", "revision": 1, - "schemaVersion": 38, - "style": "dark", + "schemaVersion": 39, "tags": [], "templating": { "list": [ { "current": { "selected": false, - "text": "All", - "value": "$__all" + "text": "CostManagement", + "value": "CostManagement" }, "datasource": { "type": "prometheus", - "uid": "${datasource}" + "uid": "Thanos" }, "definition": "label_values(cluster_id)", "hide": 0, @@ -640,10 +661,13 @@ }, { "current": { - "selected": false + "selected": false, + "text": "kubecost", + "value": "kubecost" }, "datasource": { - "uid": "${datasource}" + "type": "prometheus", + "uid": "Thanos" }, "definition": "label_values(kube_namespace_labels{cluster_id=\"$cluster\"}, namespace) ", "hide": 0, @@ -672,7 +696,8 @@ "value": "$__all" }, "datasource": { - "uid": "${datasource}" + "type": "prometheus", + "uid": "Thanos" }, "definition": "label_values(kube_pod_labels{cluster_id=\"$cluster\",namespace=~\"$namespace\"}, pod) ", "hide": 0, @@ -702,7 +727,7 @@ }, "datasource": { "type": "prometheus", - "uid": "${datasource}" + "uid": "Thanos" }, "definition": "label_values(container_memory_working_set_bytes{cluster_id=\"$cluster\",namespace=~\"$namespace\",pod=~\"$pod\", container!=\"POD\"}, container) ", "hide": 0,