mirror of https://git.rancher.io/charts
936 lines
40 KiB
YAML
936 lines
40 KiB
YAML
|
{{- /*
|
||
|
Generated from 'k8s-resources-workload' from https://raw.githubusercontent.com/prometheus-operator/kube-prometheus/release-0.1/manifests/grafana-dashboardDefinitions.yaml
|
||
|
Do not change in-place! In order to change this file first read following link:
|
||
|
https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack/hack
|
||
|
*/ -}}
|
||
|
{{- $kubeTargetVersion := default .Capabilities.KubeVersion.GitVersion .Values.kubeTargetVersionOverride }}
|
||
|
{{- if and (semverCompare ">=1.10.0-0" $kubeTargetVersion) (semverCompare "<1.14.0-0" $kubeTargetVersion) .Values.grafana.enabled .Values.grafana.defaultDashboardsEnabled }}
|
||
|
apiVersion: v1
|
||
|
kind: ConfigMap
|
||
|
metadata:
|
||
|
namespace: {{ .Values.grafana.sidecar.dashboards.searchNamespace }}
|
||
|
name: {{ printf "%s-%s" (include "kube-prometheus-stack.fullname" $) "k8s-resources-workload" | trunc 63 | trimSuffix "-" }}
|
||
|
annotations:
|
||
|
{{ toYaml .Values.grafana.sidecar.dashboards.annotations | indent 4 }}
|
||
|
labels:
|
||
|
{{- if $.Values.grafana.sidecar.dashboards.label }}
|
||
|
{{ $.Values.grafana.sidecar.dashboards.label }}: "1"
|
||
|
{{- end }}
|
||
|
app: {{ template "kube-prometheus-stack.name" $ }}-grafana
|
||
|
{{ include "kube-prometheus-stack.labels" $ | indent 4 }}
|
||
|
data:
|
||
|
k8s-resources-workload.json: |-
|
||
|
{
|
||
|
"annotations": {
|
||
|
"list": [
|
||
|
|
||
|
]
|
||
|
},
|
||
|
"editable": true,
|
||
|
"gnetId": null,
|
||
|
"graphTooltip": 0,
|
||
|
"hideControls": false,
|
||
|
"links": [
|
||
|
|
||
|
],
|
||
|
"refresh": "10s",
|
||
|
"rows": [
|
||
|
{
|
||
|
"collapse": false,
|
||
|
"height": "250px",
|
||
|
"panels": [
|
||
|
{
|
||
|
"aliasColors": {
|
||
|
|
||
|
},
|
||
|
"bars": false,
|
||
|
"dashLength": 10,
|
||
|
"dashes": false,
|
||
|
"datasource": "$datasource",
|
||
|
"fill": 10,
|
||
|
"id": 1,
|
||
|
"legend": {
|
||
|
"avg": false,
|
||
|
"current": false,
|
||
|
"max": false,
|
||
|
"min": false,
|
||
|
"show": true,
|
||
|
"total": false,
|
||
|
"values": false
|
||
|
},
|
||
|
"lines": true,
|
||
|
"linewidth": 0,
|
||
|
"links": [
|
||
|
|
||
|
],
|
||
|
"nullPointMode": "null as zero",
|
||
|
"percentage": false,
|
||
|
"pointradius": 5,
|
||
|
"points": false,
|
||
|
"renderer": "flot",
|
||
|
"seriesOverrides": [
|
||
|
|
||
|
],
|
||
|
"spaceLength": 10,
|
||
|
"span": 12,
|
||
|
"stack": true,
|
||
|
"steppedLine": false,
|
||
|
"targets": [
|
||
|
{
|
||
|
"expr": "sum(\n label_replace(\n namespace_pod_name_container_name:container_cpu_usage_seconds_total:sum_rate{cluster=\"$cluster\", namespace=\"$namespace\"},\n \"pod\", \"$1\", \"pod_name\", \"(.*)\"\n ) * on(namespace,pod) group_left(workload, workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=\"$namespace\", workload=\"$workload\", workload_type=\"$type\"}\n) by (pod)\n",
|
||
|
"format": "time_series",
|
||
|
"intervalFactor": 2,
|
||
|
"legendFormat": "{{`{{`}}pod{{`}}`}}",
|
||
|
"legendLink": null,
|
||
|
"step": 10
|
||
|
}
|
||
|
],
|
||
|
"thresholds": [
|
||
|
|
||
|
],
|
||
|
"timeFrom": null,
|
||
|
"timeShift": null,
|
||
|
"title": "CPU Usage",
|
||
|
"tooltip": {
|
||
|
"shared": false,
|
||
|
"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": 0,
|
||
|
"show": true
|
||
|
},
|
||
|
{
|
||
|
"format": "short",
|
||
|
"label": null,
|
||
|
"logBase": 1,
|
||
|
"max": null,
|
||
|
"min": null,
|
||
|
"show": false
|
||
|
}
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"repeat": null,
|
||
|
"repeatIteration": null,
|
||
|
"repeatRowId": null,
|
||
|
"showTitle": true,
|
||
|
"title": "CPU Usage",
|
||
|
"titleSize": "h6"
|
||
|
},
|
||
|
{
|
||
|
"collapse": false,
|
||
|
"height": "250px",
|
||
|
"panels": [
|
||
|
{
|
||
|
"aliasColors": {
|
||
|
|
||
|
},
|
||
|
"bars": false,
|
||
|
"dashLength": 10,
|
||
|
"dashes": false,
|
||
|
"datasource": "$datasource",
|
||
|
"fill": 1,
|
||
|
"id": 2,
|
||
|
"legend": {
|
||
|
"avg": false,
|
||
|
"current": false,
|
||
|
"max": false,
|
||
|
"min": false,
|
||
|
"show": true,
|
||
|
"total": false,
|
||
|
"values": false
|
||
|
},
|
||
|
"lines": true,
|
||
|
"linewidth": 1,
|
||
|
"links": [
|
||
|
|
||
|
],
|
||
|
"nullPointMode": "null as zero",
|
||
|
"percentage": false,
|
||
|
"pointradius": 5,
|
||
|
"points": false,
|
||
|
"renderer": "flot",
|
||
|
"seriesOverrides": [
|
||
|
|
||
|
],
|
||
|
"spaceLength": 10,
|
||
|
"span": 12,
|
||
|
"stack": false,
|
||
|
"steppedLine": false,
|
||
|
"styles": [
|
||
|
{
|
||
|
"alias": "Time",
|
||
|
"dateFormat": "YYYY-MM-DD HH:mm:ss",
|
||
|
"pattern": "Time",
|
||
|
"type": "hidden"
|
||
|
},
|
||
|
{
|
||
|
"alias": "CPU Usage",
|
||
|
"colorMode": null,
|
||
|
"colors": [
|
||
|
|
||
|
],
|
||
|
"dateFormat": "YYYY-MM-DD HH:mm:ss",
|
||
|
"decimals": 2,
|
||
|
"link": false,
|
||
|
"linkTooltip": "Drill down",
|
||
|
"linkUrl": "",
|
||
|
"pattern": "Value #A",
|
||
|
"thresholds": [
|
||
|
|
||
|
],
|
||
|
"type": "number",
|
||
|
"unit": "short"
|
||
|
},
|
||
|
{
|
||
|
"alias": "CPU Requests",
|
||
|
"colorMode": null,
|
||
|
"colors": [
|
||
|
|
||
|
],
|
||
|
"dateFormat": "YYYY-MM-DD HH:mm:ss",
|
||
|
"decimals": 2,
|
||
|
"link": false,
|
||
|
"linkTooltip": "Drill down",
|
||
|
"linkUrl": "",
|
||
|
"pattern": "Value #B",
|
||
|
"thresholds": [
|
||
|
|
||
|
],
|
||
|
"type": "number",
|
||
|
"unit": "short"
|
||
|
},
|
||
|
{
|
||
|
"alias": "CPU Requests %",
|
||
|
"colorMode": null,
|
||
|
"colors": [
|
||
|
|
||
|
],
|
||
|
"dateFormat": "YYYY-MM-DD HH:mm:ss",
|
||
|
"decimals": 2,
|
||
|
"link": false,
|
||
|
"linkTooltip": "Drill down",
|
||
|
"linkUrl": "",
|
||
|
"pattern": "Value #C",
|
||
|
"thresholds": [
|
||
|
|
||
|
],
|
||
|
"type": "number",
|
||
|
"unit": "percentunit"
|
||
|
},
|
||
|
{
|
||
|
"alias": "CPU Limits",
|
||
|
"colorMode": null,
|
||
|
"colors": [
|
||
|
|
||
|
],
|
||
|
"dateFormat": "YYYY-MM-DD HH:mm:ss",
|
||
|
"decimals": 2,
|
||
|
"link": false,
|
||
|
"linkTooltip": "Drill down",
|
||
|
"linkUrl": "",
|
||
|
"pattern": "Value #D",
|
||
|
"thresholds": [
|
||
|
|
||
|
],
|
||
|
"type": "number",
|
||
|
"unit": "short"
|
||
|
},
|
||
|
{
|
||
|
"alias": "CPU Limits %",
|
||
|
"colorMode": null,
|
||
|
"colors": [
|
||
|
|
||
|
],
|
||
|
"dateFormat": "YYYY-MM-DD HH:mm:ss",
|
||
|
"decimals": 2,
|
||
|
"link": false,
|
||
|
"linkTooltip": "Drill down",
|
||
|
"linkUrl": "",
|
||
|
"pattern": "Value #E",
|
||
|
"thresholds": [
|
||
|
|
||
|
],
|
||
|
"type": "number",
|
||
|
"unit": "percentunit"
|
||
|
},
|
||
|
{
|
||
|
"alias": "Pod",
|
||
|
"colorMode": null,
|
||
|
"colors": [
|
||
|
|
||
|
],
|
||
|
"dateFormat": "YYYY-MM-DD HH:mm:ss",
|
||
|
"decimals": 2,
|
||
|
"link": true,
|
||
|
"linkTooltip": "Drill down",
|
||
|
"linkUrl": "./d/6581e46e4e5c7ba40a07646395ef7b23/k8s-resources-pod?var-datasource=$datasource&var-cluster=$cluster&var-namespace=$namespace&var-pod=$__cell",
|
||
|
"pattern": "pod",
|
||
|
"thresholds": [
|
||
|
|
||
|
],
|
||
|
"type": "number",
|
||
|
"unit": "short"
|
||
|
},
|
||
|
{
|
||
|
"alias": "",
|
||
|
"colorMode": null,
|
||
|
"colors": [
|
||
|
|
||
|
],
|
||
|
"dateFormat": "YYYY-MM-DD HH:mm:ss",
|
||
|
"decimals": 2,
|
||
|
"pattern": "/.*/",
|
||
|
"thresholds": [
|
||
|
|
||
|
],
|
||
|
"type": "string",
|
||
|
"unit": "short"
|
||
|
}
|
||
|
],
|
||
|
"targets": [
|
||
|
{
|
||
|
"expr": "sum(\n label_replace(\n namespace_pod_name_container_name:container_cpu_usage_seconds_total:sum_rate{cluster=\"$cluster\", namespace=\"$namespace\"},\n \"pod\", \"$1\", \"pod_name\", \"(.*)\"\n ) * on(namespace,pod) group_left(workload, workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=\"$namespace\", workload=\"$workload\", workload_type=\"$type\"}\n) by (pod)\n",
|
||
|
"format": "table",
|
||
|
"instant": true,
|
||
|
"intervalFactor": 2,
|
||
|
"legendFormat": "",
|
||
|
"refId": "A",
|
||
|
"step": 10
|
||
|
},
|
||
|
{
|
||
|
"expr": "sum(\n kube_pod_container_resource_requests_cpu_cores{cluster=\"$cluster\", namespace=\"$namespace\"}\n * on(namespace,pod) group_left(workload, workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=\"$namespace\", workload=\"$workload\", workload_type=\"$type\"}\n) by (pod)\n",
|
||
|
"format": "table",
|
||
|
"instant": true,
|
||
|
"intervalFactor": 2,
|
||
|
"legendFormat": "",
|
||
|
"refId": "B",
|
||
|
"step": 10
|
||
|
},
|
||
|
{
|
||
|
"expr": "sum(\n label_replace(\n namespace_pod_name_container_name:container_cpu_usage_seconds_total:sum_rate{cluster=\"$cluster\", namespace=\"$namespace\"},\n \"pod\", \"$1\", \"pod_name\", \"(.*)\"\n ) * on(namespace,pod) group_left(workload, workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=\"$namespace\", workload=\"$workload\", workload_type=\"$type\"}\n) by (pod)\n/sum(\n kube_pod_container_resource_requests_cpu_cores{cluster=\"$cluster\", namespace=\"$namespace\"}\n * on(namespace,pod) group_left(workload, workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=\"$namespace\", workload=\"$workload\", workload_type=\"$type\"}\n) by (pod)\n",
|
||
|
"format": "table",
|
||
|
"instant": true,
|
||
|
"intervalFactor": 2,
|
||
|
"legendFormat": "",
|
||
|
"refId": "C",
|
||
|
"step": 10
|
||
|
},
|
||
|
{
|
||
|
"expr": "sum(\n kube_pod_container_resource_limits_cpu_cores{cluster=\"$cluster\", namespace=\"$namespace\"}\n * on(namespace,pod) group_left(workload, workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=\"$namespace\", workload=\"$workload\", workload_type=\"$type\"}\n) by (pod)\n",
|
||
|
"format": "table",
|
||
|
"instant": true,
|
||
|
"intervalFactor": 2,
|
||
|
"legendFormat": "",
|
||
|
"refId": "D",
|
||
|
"step": 10
|
||
|
},
|
||
|
{
|
||
|
"expr": "sum(\n label_replace(\n namespace_pod_name_container_name:container_cpu_usage_seconds_total:sum_rate{cluster=\"$cluster\", namespace=\"$namespace\"},\n \"pod\", \"$1\", \"pod_name\", \"(.*)\"\n ) * on(namespace,pod) group_left(workload, workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=\"$namespace\", workload=\"$workload\", workload_type=\"$type\"}\n) by (pod)\n/sum(\n kube_pod_container_resource_limits_cpu_cores{cluster=\"$cluster\", namespace=\"$namespace\"}\n * on(namespace,pod) group_left(workload, workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=\"$namespace\", workload=\"$workload\", workload_type=\"$type\"}\n) by (pod)\n",
|
||
|
"format": "table",
|
||
|
"instant": true,
|
||
|
"intervalFactor": 2,
|
||
|
"legendFormat": "",
|
||
|
"refId": "E",
|
||
|
"step": 10
|
||
|
}
|
||
|
],
|
||
|
"thresholds": [
|
||
|
|
||
|
],
|
||
|
"timeFrom": null,
|
||
|
"timeShift": null,
|
||
|
"title": "CPU Quota",
|
||
|
"tooltip": {
|
||
|
"shared": false,
|
||
|
"sort": 0,
|
||
|
"value_type": "individual"
|
||
|
},
|
||
|
"transform": "table",
|
||
|
"type": "table",
|
||
|
"xaxis": {
|
||
|
"buckets": null,
|
||
|
"mode": "time",
|
||
|
"name": null,
|
||
|
"show": true,
|
||
|
"values": [
|
||
|
|
||
|
]
|
||
|
},
|
||
|
"yaxes": [
|
||
|
{
|
||
|
"format": "short",
|
||
|
"label": null,
|
||
|
"logBase": 1,
|
||
|
"max": null,
|
||
|
"min": 0,
|
||
|
"show": true
|
||
|
},
|
||
|
{
|
||
|
"format": "short",
|
||
|
"label": null,
|
||
|
"logBase": 1,
|
||
|
"max": null,
|
||
|
"min": null,
|
||
|
"show": false
|
||
|
}
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"repeat": null,
|
||
|
"repeatIteration": null,
|
||
|
"repeatRowId": null,
|
||
|
"showTitle": true,
|
||
|
"title": "CPU Quota",
|
||
|
"titleSize": "h6"
|
||
|
},
|
||
|
{
|
||
|
"collapse": false,
|
||
|
"height": "250px",
|
||
|
"panels": [
|
||
|
{
|
||
|
"aliasColors": {
|
||
|
|
||
|
},
|
||
|
"bars": false,
|
||
|
"dashLength": 10,
|
||
|
"dashes": false,
|
||
|
"datasource": "$datasource",
|
||
|
"fill": 10,
|
||
|
"id": 3,
|
||
|
"legend": {
|
||
|
"avg": false,
|
||
|
"current": false,
|
||
|
"max": false,
|
||
|
"min": false,
|
||
|
"show": true,
|
||
|
"total": false,
|
||
|
"values": false
|
||
|
},
|
||
|
"lines": true,
|
||
|
"linewidth": 0,
|
||
|
"links": [
|
||
|
|
||
|
],
|
||
|
"nullPointMode": "null as zero",
|
||
|
"percentage": false,
|
||
|
"pointradius": 5,
|
||
|
"points": false,
|
||
|
"renderer": "flot",
|
||
|
"seriesOverrides": [
|
||
|
|
||
|
],
|
||
|
"spaceLength": 10,
|
||
|
"span": 12,
|
||
|
"stack": true,
|
||
|
"steppedLine": false,
|
||
|
"targets": [
|
||
|
{
|
||
|
"expr": "sum(\n label_replace(\n container_memory_usage_bytes{cluster=\"$cluster\", namespace=\"$namespace\", container_name!=\"\"},\n \"pod\", \"$1\", \"pod_name\", \"(.*)\"\n ) * on(namespace,pod) group_left(workload, workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=\"$namespace\", workload=\"$workload\", workload_type=\"$type\"}\n ) by (pod)\n",
|
||
|
"format": "time_series",
|
||
|
"intervalFactor": 2,
|
||
|
"legendFormat": "{{`{{`}}pod{{`}}`}}",
|
||
|
"legendLink": null,
|
||
|
"step": 10
|
||
|
}
|
||
|
],
|
||
|
"thresholds": [
|
||
|
|
||
|
],
|
||
|
"timeFrom": null,
|
||
|
"timeShift": null,
|
||
|
"title": "Memory Usage",
|
||
|
"tooltip": {
|
||
|
"shared": false,
|
||
|
"sort": 0,
|
||
|
"value_type": "individual"
|
||
|
},
|
||
|
"type": "graph",
|
||
|
"xaxis": {
|
||
|
"buckets": null,
|
||
|
"mode": "time",
|
||
|
"name": null,
|
||
|
"show": true,
|
||
|
"values": [
|
||
|
|
||
|
]
|
||
|
},
|
||
|
"yaxes": [
|
||
|
{
|
||
|
"format": "bytes",
|
||
|
"label": null,
|
||
|
"logBase": 1,
|
||
|
"max": null,
|
||
|
"min": 0,
|
||
|
"show": true
|
||
|
},
|
||
|
{
|
||
|
"format": "short",
|
||
|
"label": null,
|
||
|
"logBase": 1,
|
||
|
"max": null,
|
||
|
"min": null,
|
||
|
"show": false
|
||
|
}
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"repeat": null,
|
||
|
"repeatIteration": null,
|
||
|
"repeatRowId": null,
|
||
|
"showTitle": true,
|
||
|
"title": "Memory Usage",
|
||
|
"titleSize": "h6"
|
||
|
},
|
||
|
{
|
||
|
"collapse": false,
|
||
|
"height": "250px",
|
||
|
"panels": [
|
||
|
{
|
||
|
"aliasColors": {
|
||
|
|
||
|
},
|
||
|
"bars": false,
|
||
|
"dashLength": 10,
|
||
|
"dashes": false,
|
||
|
"datasource": "$datasource",
|
||
|
"fill": 1,
|
||
|
"id": 4,
|
||
|
"legend": {
|
||
|
"avg": false,
|
||
|
"current": false,
|
||
|
"max": false,
|
||
|
"min": false,
|
||
|
"show": true,
|
||
|
"total": false,
|
||
|
"values": false
|
||
|
},
|
||
|
"lines": true,
|
||
|
"linewidth": 1,
|
||
|
"links": [
|
||
|
|
||
|
],
|
||
|
"nullPointMode": "null as zero",
|
||
|
"percentage": false,
|
||
|
"pointradius": 5,
|
||
|
"points": false,
|
||
|
"renderer": "flot",
|
||
|
"seriesOverrides": [
|
||
|
|
||
|
],
|
||
|
"spaceLength": 10,
|
||
|
"span": 12,
|
||
|
"stack": false,
|
||
|
"steppedLine": false,
|
||
|
"styles": [
|
||
|
{
|
||
|
"alias": "Time",
|
||
|
"dateFormat": "YYYY-MM-DD HH:mm:ss",
|
||
|
"pattern": "Time",
|
||
|
"type": "hidden"
|
||
|
},
|
||
|
{
|
||
|
"alias": "Memory Usage",
|
||
|
"colorMode": null,
|
||
|
"colors": [
|
||
|
|
||
|
],
|
||
|
"dateFormat": "YYYY-MM-DD HH:mm:ss",
|
||
|
"decimals": 2,
|
||
|
"link": false,
|
||
|
"linkTooltip": "Drill down",
|
||
|
"linkUrl": "",
|
||
|
"pattern": "Value #A",
|
||
|
"thresholds": [
|
||
|
|
||
|
],
|
||
|
"type": "number",
|
||
|
"unit": "bytes"
|
||
|
},
|
||
|
{
|
||
|
"alias": "Memory Requests",
|
||
|
"colorMode": null,
|
||
|
"colors": [
|
||
|
|
||
|
],
|
||
|
"dateFormat": "YYYY-MM-DD HH:mm:ss",
|
||
|
"decimals": 2,
|
||
|
"link": false,
|
||
|
"linkTooltip": "Drill down",
|
||
|
"linkUrl": "",
|
||
|
"pattern": "Value #B",
|
||
|
"thresholds": [
|
||
|
|
||
|
],
|
||
|
"type": "number",
|
||
|
"unit": "bytes"
|
||
|
},
|
||
|
{
|
||
|
"alias": "Memory Requests %",
|
||
|
"colorMode": null,
|
||
|
"colors": [
|
||
|
|
||
|
],
|
||
|
"dateFormat": "YYYY-MM-DD HH:mm:ss",
|
||
|
"decimals": 2,
|
||
|
"link": false,
|
||
|
"linkTooltip": "Drill down",
|
||
|
"linkUrl": "",
|
||
|
"pattern": "Value #C",
|
||
|
"thresholds": [
|
||
|
|
||
|
],
|
||
|
"type": "number",
|
||
|
"unit": "percentunit"
|
||
|
},
|
||
|
{
|
||
|
"alias": "Memory Limits",
|
||
|
"colorMode": null,
|
||
|
"colors": [
|
||
|
|
||
|
],
|
||
|
"dateFormat": "YYYY-MM-DD HH:mm:ss",
|
||
|
"decimals": 2,
|
||
|
"link": false,
|
||
|
"linkTooltip": "Drill down",
|
||
|
"linkUrl": "",
|
||
|
"pattern": "Value #D",
|
||
|
"thresholds": [
|
||
|
|
||
|
],
|
||
|
"type": "number",
|
||
|
"unit": "bytes"
|
||
|
},
|
||
|
{
|
||
|
"alias": "Memory Limits %",
|
||
|
"colorMode": null,
|
||
|
"colors": [
|
||
|
|
||
|
],
|
||
|
"dateFormat": "YYYY-MM-DD HH:mm:ss",
|
||
|
"decimals": 2,
|
||
|
"link": false,
|
||
|
"linkTooltip": "Drill down",
|
||
|
"linkUrl": "",
|
||
|
"pattern": "Value #E",
|
||
|
"thresholds": [
|
||
|
|
||
|
],
|
||
|
"type": "number",
|
||
|
"unit": "percentunit"
|
||
|
},
|
||
|
{
|
||
|
"alias": "Pod",
|
||
|
"colorMode": null,
|
||
|
"colors": [
|
||
|
|
||
|
],
|
||
|
"dateFormat": "YYYY-MM-DD HH:mm:ss",
|
||
|
"decimals": 2,
|
||
|
"link": true,
|
||
|
"linkTooltip": "Drill down",
|
||
|
"linkUrl": "./d/6581e46e4e5c7ba40a07646395ef7b23/k8s-resources-pod?var-datasource=$datasource&var-cluster=$cluster&var-namespace=$namespace&var-pod=$__cell",
|
||
|
"pattern": "pod",
|
||
|
"thresholds": [
|
||
|
|
||
|
],
|
||
|
"type": "number",
|
||
|
"unit": "short"
|
||
|
},
|
||
|
{
|
||
|
"alias": "",
|
||
|
"colorMode": null,
|
||
|
"colors": [
|
||
|
|
||
|
],
|
||
|
"dateFormat": "YYYY-MM-DD HH:mm:ss",
|
||
|
"decimals": 2,
|
||
|
"pattern": "/.*/",
|
||
|
"thresholds": [
|
||
|
|
||
|
],
|
||
|
"type": "string",
|
||
|
"unit": "short"
|
||
|
}
|
||
|
],
|
||
|
"targets": [
|
||
|
{
|
||
|
"expr": "sum(\n label_replace(\n container_memory_usage_bytes{cluster=\"$cluster\", namespace=\"$namespace\", container_name!=\"\"},\n \"pod\", \"$1\", \"pod_name\", \"(.*)\"\n ) * on(namespace,pod) group_left(workload, workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=\"$namespace\", workload=\"$workload\", workload_type=\"$type\"}\n ) by (pod)\n",
|
||
|
"format": "table",
|
||
|
"instant": true,
|
||
|
"intervalFactor": 2,
|
||
|
"legendFormat": "",
|
||
|
"refId": "A",
|
||
|
"step": 10
|
||
|
},
|
||
|
{
|
||
|
"expr": "sum(\n kube_pod_container_resource_requests_memory_bytes{cluster=\"$cluster\", namespace=\"$namespace\"}\n * on(namespace,pod) group_left(workload, workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=\"$namespace\", workload=\"$workload\", workload_type=\"$type\"}\n) by (pod)\n",
|
||
|
"format": "table",
|
||
|
"instant": true,
|
||
|
"intervalFactor": 2,
|
||
|
"legendFormat": "",
|
||
|
"refId": "B",
|
||
|
"step": 10
|
||
|
},
|
||
|
{
|
||
|
"expr": "sum(\n label_replace(\n container_memory_usage_bytes{cluster=\"$cluster\", namespace=\"$namespace\", container_name!=\"\"},\n \"pod\", \"$1\", \"pod_name\", \"(.*)\"\n ) * on(namespace,pod) group_left(workload, workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=\"$namespace\", workload=\"$workload\", workload_type=\"$type\"}\n ) by (pod)\n/sum(\n kube_pod_container_resource_requests_memory_bytes{cluster=\"$cluster\", namespace=\"$namespace\"}\n * on(namespace,pod) group_left(workload, workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=\"$namespace\", workload=\"$workload\", workload_type=\"$type\"}\n) by (pod)\n",
|
||
|
"format": "table",
|
||
|
"instant": true,
|
||
|
"intervalFactor": 2,
|
||
|
"legendFormat": "",
|
||
|
"refId": "C",
|
||
|
"step": 10
|
||
|
},
|
||
|
{
|
||
|
"expr": "sum(\n kube_pod_container_resource_limits_memory_bytes{cluster=\"$cluster\", namespace=\"$namespace\"}\n * on(namespace,pod) group_left(workload, workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=\"$namespace\", workload=\"$workload\", workload_type=\"$type\"}\n) by (pod)\n",
|
||
|
"format": "table",
|
||
|
"instant": true,
|
||
|
"intervalFactor": 2,
|
||
|
"legendFormat": "",
|
||
|
"refId": "D",
|
||
|
"step": 10
|
||
|
},
|
||
|
{
|
||
|
"expr": "sum(\n label_replace(\n container_memory_usage_bytes{cluster=\"$cluster\", namespace=\"$namespace\", container_name!=\"\"},\n \"pod\", \"$1\", \"pod_name\", \"(.*)\"\n ) * on(namespace,pod) group_left(workload, workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=\"$namespace\", workload=\"$workload\", workload_type=\"$type\"}\n ) by (pod)\n/sum(\n kube_pod_container_resource_limits_memory_bytes{cluster=\"$cluster\", namespace=\"$namespace\"}\n * on(namespace,pod) group_left(workload, workload_type) mixin_pod_workload{cluster=\"$cluster\", namespace=\"$namespace\", workload=\"$workload\", workload_type=\"$type\"}\n) by (pod)\n",
|
||
|
"format": "table",
|
||
|
"instant": true,
|
||
|
"intervalFactor": 2,
|
||
|
"legendFormat": "",
|
||
|
"refId": "E",
|
||
|
"step": 10
|
||
|
}
|
||
|
],
|
||
|
"thresholds": [
|
||
|
|
||
|
],
|
||
|
"timeFrom": null,
|
||
|
"timeShift": null,
|
||
|
"title": "Memory Quota",
|
||
|
"tooltip": {
|
||
|
"shared": false,
|
||
|
"sort": 0,
|
||
|
"value_type": "individual"
|
||
|
},
|
||
|
"transform": "table",
|
||
|
"type": "table",
|
||
|
"xaxis": {
|
||
|
"buckets": null,
|
||
|
"mode": "time",
|
||
|
"name": null,
|
||
|
"show": true,
|
||
|
"values": [
|
||
|
|
||
|
]
|
||
|
},
|
||
|
"yaxes": [
|
||
|
{
|
||
|
"format": "short",
|
||
|
"label": null,
|
||
|
"logBase": 1,
|
||
|
"max": null,
|
||
|
"min": 0,
|
||
|
"show": true
|
||
|
},
|
||
|
{
|
||
|
"format": "short",
|
||
|
"label": null,
|
||
|
"logBase": 1,
|
||
|
"max": null,
|
||
|
"min": null,
|
||
|
"show": false
|
||
|
}
|
||
|
]
|
||
|
}
|
||
|
],
|
||
|
"repeat": null,
|
||
|
"repeatIteration": null,
|
||
|
"repeatRowId": null,
|
||
|
"showTitle": true,
|
||
|
"title": "Memory Quota",
|
||
|
"titleSize": "h6"
|
||
|
}
|
||
|
],
|
||
|
"schemaVersion": 14,
|
||
|
"style": "dark",
|
||
|
"tags": [
|
||
|
"kubernetes-mixin"
|
||
|
],
|
||
|
"templating": {
|
||
|
"list": [
|
||
|
{
|
||
|
"current": {
|
||
|
"text": "Prometheus",
|
||
|
"value": "Prometheus"
|
||
|
},
|
||
|
"hide": 0,
|
||
|
"label": null,
|
||
|
"name": "datasource",
|
||
|
"options": [
|
||
|
|
||
|
],
|
||
|
"query": "prometheus",
|
||
|
"refresh": 1,
|
||
|
"regex": "",
|
||
|
"type": "datasource"
|
||
|
},
|
||
|
{
|
||
|
"allValue": null,
|
||
|
"current": {
|
||
|
"text": "prod",
|
||
|
"value": "prod"
|
||
|
},
|
||
|
"datasource": "$datasource",
|
||
|
"hide": 2,
|
||
|
"includeAll": false,
|
||
|
"label": "cluster",
|
||
|
"multi": false,
|
||
|
"name": "cluster",
|
||
|
"options": [
|
||
|
|
||
|
],
|
||
|
"query": "label_values(:kube_pod_info_node_count:, cluster)",
|
||
|
"refresh": 1,
|
||
|
"regex": "",
|
||
|
"sort": 2,
|
||
|
"tagValuesQuery": "",
|
||
|
"tags": [
|
||
|
|
||
|
],
|
||
|
"tagsQuery": "",
|
||
|
"type": "query",
|
||
|
"useTags": false
|
||
|
},
|
||
|
{
|
||
|
"allValue": null,
|
||
|
"current": {
|
||
|
"text": "prod",
|
||
|
"value": "prod"
|
||
|
},
|
||
|
"datasource": "$datasource",
|
||
|
"hide": 0,
|
||
|
"includeAll": false,
|
||
|
"label": "namespace",
|
||
|
"multi": false,
|
||
|
"name": "namespace",
|
||
|
"options": [
|
||
|
|
||
|
],
|
||
|
"query": "label_values(kube_pod_info{cluster=\"$cluster\"}, namespace)",
|
||
|
"refresh": 1,
|
||
|
"regex": "",
|
||
|
"sort": 2,
|
||
|
"tagValuesQuery": "",
|
||
|
"tags": [
|
||
|
|
||
|
],
|
||
|
"tagsQuery": "",
|
||
|
"type": "query",
|
||
|
"useTags": false
|
||
|
},
|
||
|
{
|
||
|
"allValue": null,
|
||
|
"current": {
|
||
|
"text": "prod",
|
||
|
"value": "prod"
|
||
|
},
|
||
|
"datasource": "$datasource",
|
||
|
"hide": 0,
|
||
|
"includeAll": false,
|
||
|
"label": "workload",
|
||
|
"multi": false,
|
||
|
"name": "workload",
|
||
|
"options": [
|
||
|
|
||
|
],
|
||
|
"query": "label_values(mixin_pod_workload{cluster=\"$cluster\", namespace=\"$namespace\"}, workload)",
|
||
|
"refresh": 1,
|
||
|
"regex": "",
|
||
|
"sort": 2,
|
||
|
"tagValuesQuery": "",
|
||
|
"tags": [
|
||
|
|
||
|
],
|
||
|
"tagsQuery": "",
|
||
|
"type": "query",
|
||
|
"useTags": false
|
||
|
},
|
||
|
{
|
||
|
"allValue": null,
|
||
|
"current": {
|
||
|
"text": "prod",
|
||
|
"value": "prod"
|
||
|
},
|
||
|
"datasource": "$datasource",
|
||
|
"hide": 0,
|
||
|
"includeAll": false,
|
||
|
"label": "type",
|
||
|
"multi": false,
|
||
|
"name": "type",
|
||
|
"options": [
|
||
|
|
||
|
],
|
||
|
"query": "label_values(mixin_pod_workload{cluster=\"$cluster\", namespace=\"$namespace\", workload=\"$workload\"}, workload_type)",
|
||
|
"refresh": 1,
|
||
|
"regex": "",
|
||
|
"sort": 2,
|
||
|
"tagValuesQuery": "",
|
||
|
"tags": [
|
||
|
|
||
|
],
|
||
|
"tagsQuery": "",
|
||
|
"type": "query",
|
||
|
"useTags": false
|
||
|
}
|
||
|
]
|
||
|
},
|
||
|
"time": {
|
||
|
"from": "now-1h",
|
||
|
"to": "now"
|
||
|
},
|
||
|
"timepicker": {
|
||
|
"refresh_intervals": [
|
||
|
"5s",
|
||
|
"10s",
|
||
|
"30s",
|
||
|
"1m",
|
||
|
"5m",
|
||
|
"15m",
|
||
|
"30m",
|
||
|
"1h",
|
||
|
"2h",
|
||
|
"1d"
|
||
|
],
|
||
|
"time_options": [
|
||
|
"5m",
|
||
|
"15m",
|
||
|
"1h",
|
||
|
"6h",
|
||
|
"12h",
|
||
|
"24h",
|
||
|
"2d",
|
||
|
"7d",
|
||
|
"30d"
|
||
|
]
|
||
|
},
|
||
|
"timezone": "",
|
||
|
"title": "Kubernetes / Compute Resources / Workload",
|
||
|
"uid": "a164a7f0339f99e89cea5cb47e9be617",
|
||
|
"version": 0
|
||
|
}
|
||
|
{{- end }}
|