{ "annotations": { "list": [] }, "editable": true, "links": [], "panels": [ { "datasource": { "type": "prometheus", "uid": "${prom_ds}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "auto", "showValues": false, "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "thresholds": { "mode": "percentage", "steps": [ { "color": "green", "value": 0 } ] }, "unit": "bytes" }, "overrides": [] }, "gridPos": { "h": 8, "w": 12, "x": 0, "y": 0 }, "id": 3, "options": { "legend": { "calcs": [ "last", "max" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "hideZeros": false, "mode": "single", "sort": "none" } }, "targets": [ { "editorMode": "code", "expr": "sum by (k8s_podname, pid) (\n (mem_alloc_bytes_total{cluster=~\"$cluster\",k8s_namespace=~\"$namespace\",k8s_podname=~\"$pod\",host_raw=\"0\"} - mem_free_bytes_total{cluster=~\"$cluster\",k8s_namespace=~\"$namespace\",k8s_podname=~\"$pod\",host_raw=\"0\"} - mem_implicit_free_bytes_total{cluster=~\"$cluster\",k8s_namespace=~\"$namespace\",k8s_podname=~\"$pod\",host_raw=\"0\"})\n)", "legendFormat": "{{k8s_podname}} / pid {{pid}}", "range": true, "refId": "A", "datasource": { "type": "prometheus", "uid": "${prom_ds}" } } ], "title": "GPU Active Memory by Pod", "description": "Currently allocated GPU memory (CUDA) per pod (allocations - frees - implicit frees). Note: only workloads started after profiling was enabled are tracked; pre-existing allocations are not visible.", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${prom_ds}" }, "fieldConfig": { "defaults": { "unit": "bytes" } }, "gridPos": { "h": 8, "w": 12, "x": 0, "y": 8 }, "id": 4, "options": { "legend": { "calcs": [ "last", "max" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "hideZeros": false, "mode": "single", "sort": "none" } }, "targets": [ { "editorMode": "code", "expr": "topk(5,\n sum by (k8s_podname, pid) (mem_alloc_bytes_total{cluster=~\"$cluster\",k8s_namespace=~\"$namespace\",k8s_podname=~\"$pod\",host_raw=\"0\"} - mem_free_bytes_total{cluster=~\"$cluster\",k8s_namespace=~\"$namespace\",k8s_podname=~\"$pod\",host_raw=\"0\"} - mem_implicit_free_bytes_total{cluster=~\"$cluster\",k8s_namespace=~\"$namespace\",k8s_podname=~\"$pod\",host_raw=\"0\"})\n)", "legendFormat": "{{k8s_podname}} / pid {{pid}}", "range": true, "refId": "A", "datasource": { "type": "prometheus", "uid": "${prom_ds}" } } ], "title": "Top GPU Processes", "description": "Top 5 pod/process combinations by GPU (CUDA) memory usage", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${prom_ds}" }, "fieldConfig": { "defaults": { "unit": "Bps" } }, "gridPos": { "h": 8, "w": 12, "x": 12, "y": 8 }, "id": 1, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "hideZeros": false, "mode": "single", "sort": "none" } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "${prom_ds}" }, "editorMode": "builder", "expr": "sum by(k8s_podname, pid) (rate(mem_alloc_bytes_total{cluster=~\"$cluster\",k8s_namespace=~\"$namespace\",k8s_podname=~\"$pod\",host_raw=\"0\"}[5m]))", "instant": false, "legendFormat": "{{k8s_podname}} / pid {{pid}}", "range": true, "refId": "A" } ], "title": "GPU Memory Allocation Rate", "description": "Rate of GPU (CUDA) memory allocations per pod", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${prom_ds}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "auto", "showValues": false, "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": 0 }, { "color": "red", "value": 80 } ] }, "unit": "Bps" }, "overrides": [] }, "gridPos": { "h": 8, "w": 12, "x": 0, "y": 16 }, "id": 2, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "hideZeros": false, "mode": "single", "sort": "none" } }, "targets": [ { "editorMode": "builder", "expr": "sum by(k8s_podname, pid) (rate(mem_free_bytes_total{cluster=~\"$cluster\",k8s_namespace=~\"$namespace\",k8s_podname=~\"$pod\",host_raw=\"0\"}[5m]))", "legendFormat": "{{k8s_podname}} / pid {{pid}}", "range": true, "refId": "A", "datasource": { "type": "prometheus", "uid": "${prom_ds}" } } ], "title": "GPU Memory Free Rate", "description": "Rate of explicit GPU (CUDA) memory frees per pod", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${prom_ds}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "auto", "showValues": false, "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": 0 }, { "color": "red", "value": 80 } ] }, "unit": "Bps" }, "overrides": [] }, "gridPos": { "h": 8, "w": 12, "x": 12, "y": 16 }, "id": 6, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "hideZeros": false, "mode": "single", "sort": "none" } }, "targets": [ { "editorMode": "builder", "expr": "sum by(k8s_podname, pid) (rate(mem_implicit_free_bytes_total{cluster=~\"$cluster\",k8s_namespace=~\"$namespace\",k8s_podname=~\"$pod\",host_raw=\"0\"}[5m]))", "legendFormat": "{{k8s_podname}} / pid {{pid}}", "range": true, "refId": "A", "datasource": { "type": "prometheus", "uid": "${prom_ds}" } } ], "title": "GPU Memory Implicit Free Rate", "description": "Rate of implicit GPU (CUDA) memory frees per pod (e.g., on process exit)", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "${prom_ds}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 2, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "auto", "showValues": false, "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": 0 } ] }, "unit": "bytes" }, "overrides": [] }, "gridPos": { "h": 8, "w": 12, "x": 12, "y": 0 }, "id": 7, "options": { "legend": { "calcs": [ "last", "max" ], "displayMode": "table", "placement": "bottom", "showLegend": true }, "tooltip": { "hideZeros": false, "mode": "single", "sort": "none" } }, "targets": [ { "editorMode": "code", "expr": "sum(mem_alloc_bytes_total{cluster=~\"$cluster\",k8s_namespace=~\"$namespace\",host_raw=\"0\"} - mem_free_bytes_total{cluster=~\"$cluster\",k8s_namespace=~\"$namespace\",host_raw=\"0\"} - mem_implicit_free_bytes_total{cluster=~\"$cluster\",k8s_namespace=~\"$namespace\",host_raw=\"0\"})", "legendFormat": "Total GPU Memory", "range": true, "refId": "A", "datasource": { "type": "prometheus", "uid": "${prom_ds}" } } ], "title": "Total GPU Memory", "description": "Total GPU (CUDA) memory usage across all pods", "type": "timeseries" }, { "datasource": { "type": "grafana-pyroscope-datasource", "uid": "${pyroscope_ds}" }, "fieldConfig": { "defaults": {}, "overrides": [] }, "gridPos": { "h": 9, "w": 24, "x": 0, "y": 24 }, "id": 5, "options": {}, "targets": [ { "datasource": { "type": "grafana-pyroscope-datasource", "uid": "${pyroscope_ds}" }, "groupBy": [], "includeExemplars": false, "labelSelector": "{k8s_namespace=~\"${namespace:regex}\",k8s_podName=~\"${pod:regex}\"}", "profileTypeId": "$profile_type", "queryType": "profile", "refId": "A", "spanSelector": [] } ], "title": "GPU Memory Profiles", "description": "Flamegraph showing GPU (CUDA) memory allocation call stacks", "type": "flamegraph" } ], "preload": false, "schemaVersion": 41, "tags": [ "Azure-managed", "GPU", "Kubernetes" ], "templating": { "list": [ { "name": "prom_ds", "label": "Prometheus Datasource", "type": "datasource", "query": "prometheus", "refresh": 1, "hide": 0, "current": {}, "regex": "", "skipUrlSync": false, "multi": false, "includeAll": false }, { "name": "pyroscope_ds", "label": "Pyroscope Datasource", "type": "datasource", "query": "grafana-pyroscope-datasource", "refresh": 1, "hide": 0, "current": {}, "regex": "", "skipUrlSync": false, "multi": false, "includeAll": false }, { "name": "profile_type", "label": "Profile Type", "type": "query", "datasource": { "type": "grafana-pyroscope-datasource", "uid": "${pyroscope_ds}" }, "query": { "type": "profileType" }, "refresh": 0, "hide": 0, "includeAll": false, "multi": false, "options": [ { "text": "process_cpu:malloc:bytes:process_cuda:bytes", "value": "process_cpu:malloc:bytes:process_cuda:bytes", "selected": true } ], "current": { "text": "process_cpu:malloc:bytes:process_cuda:bytes", "value": "process_cpu:malloc:bytes:process_cuda:bytes", "selected": true }, "regex": "/process_cuda/" }, { "name": "cluster", "label": "Cluster", "type": "query", "datasource": { "type": "prometheus", "uid": "${prom_ds}" }, "query": { "qryType": 1, "query": "label_values(mem_alloc_bytes_total, cluster)", "refId": "PrometheusVariableQueryEditor-VariableQuery" }, "refresh": 2, "sort": 1, "hide": 0, "includeAll": false, "multi": false, "current": {}, "regex": "" }, { "name": "namespace", "label": "Namespace", "type": "query", "datasource": { "type": "prometheus", "uid": "${prom_ds}" }, "query": { "qryType": 1, "query": "label_values(mem_alloc_bytes_total{cluster=~\"$cluster\"}, k8s_namespace)", "refId": "PrometheusVariableQueryEditor-VariableQuery" }, "refresh": 2, "sort": 1, "hide": 0, "includeAll": true, "allValue": ".*", "multi": true, "current": { "text": "All", "value": "$__all" }, "regex": "" }, { "name": "pod", "label": "Pod", "type": "query", "datasource": { "type": "prometheus", "uid": "${prom_ds}" }, "query": { "qryType": 1, "query": "label_values(mem_alloc_bytes_total{cluster=~\"$cluster\",k8s_namespace=~\"$namespace\"}, k8s_podname)", "refId": "PrometheusVariableQueryEditor-VariableQuery" }, "refresh": 2, "sort": 1, "hide": 0, "includeAll": true, "allValue": ".*", "multi": true, "current": { "text": "All", "value": "$__all" }, "regex": "" } ] }, "time": { "from": "now-1h", "to": "now" }, "timepicker": {}, "timezone": "browser", "title": "Advanced GPU Observability", "uid": "AdvancedGPUObservability", "version": 1, "id": null, "__requires": [ { "type": "grafana", "id": "grafana", "name": "Grafana", "version": "11.6.9" }, { "type": "datasource", "id": "prometheus", "name": "Prometheus", "version": "1.0.0" }, { "type": "datasource", "id": "grafana-pyroscope-datasource", "name": "Pyroscope", "version": "1.0.0" }, { "type": "panel", "id": "timeseries", "name": "Time series", "version": "" }, { "type": "panel", "id": "flamegraph", "name": "Flame Graph", "version": "" } ], "refresh": "30s", "description": "Advanced GPU Observability for AKS using Inspektor Gadget eBPF CUDA metrics (enabled via the Inspektor Gadget cluster extension and scraped by Azure Managed Prometheus) and Pyroscope profiles. Tracks per-pod CUDA memory usage, top processes, allocation/free rates, and CUDA memory profiles." }