From ab0369679f07c508ccec97489cec8066535fbb08 Mon Sep 17 00:00:00 2001 From: Tanay Kothari Date: Mon, 25 Nov 2024 16:38:07 +0000 Subject: [PATCH] Add support for Managed Grafana in quick-start - This change adds an ability to create and use an Azure Managed Grafana in the quick-start script. --- build/k8s/bundle.sh | 0 build/k8s/dashboards/api-server.json | 1191 ++++++++++ build/k8s/dashboards/cluster-info.json | 1622 +++++++++++++ build/k8s/dashboards/metrics-stats.json | 2851 +++++++++++++++++++++++ build/k8s/setup.sh | 67 +- 5 files changed, 5725 insertions(+), 6 deletions(-) mode change 100644 => 100755 build/k8s/bundle.sh create mode 100644 build/k8s/dashboards/api-server.json create mode 100644 build/k8s/dashboards/cluster-info.json create mode 100644 build/k8s/dashboards/metrics-stats.json mode change 100644 => 100755 build/k8s/setup.sh diff --git a/build/k8s/bundle.sh b/build/k8s/bundle.sh old mode 100644 new mode 100755 diff --git a/build/k8s/dashboards/api-server.json b/build/k8s/dashboards/api-server.json new file mode 100644 index 00000000..e9833891 --- /dev/null +++ b/build/k8s/dashboards/api-server.json @@ -0,0 +1,1191 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "grafana", + "uid": "-- Grafana --" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "id": 41, + "links": [ + { + "asDropdown": false, + "icon": "external link", + "includeVars": false, + "keepTime": false, + "tags": [], + "targetBlank": true, + "title": "Search Logs", + "tooltip": "", + "type": "link", + "url": "$LogsURL" + } + ], + "panels": [ + { + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "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 + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "reqps" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Value" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "red", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Errors" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "red", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 8, + "w": 8, + "x": 0, + "y": 0 + }, + "id": 169, + "interval": "1m", + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "OpenAI": false, + "database": "Metrics", + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "expression": { + "groupBy": { + "expressions": [], + "type": "and" + }, + "reduce": { + "expressions": [], + "type": "and" + }, + "where": { + "expressions": [], + "type": "and" + } + }, + "pluginVersion": "5.0.5", + "query": "ApiserverRequestTotal\n| where $__timeFilter(Timestamp)\n| where Labels.cluster == \"$Cluster\"\n| invoke prom_rate()\n| summarize Value=sum(Value) by bin(Timestamp, $__timeInterval)\n| project Timestamp, Requests=Value\n| order by Timestamp asc\n", + "querySource": "raw", + "queryType": "KQL", + "rawMode": true, + "refId": "A", + "resultFormat": "time_series" + }, + { + "OpenAI": false, + "database": "Metrics", + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "expression": { + "groupBy": { + "expressions": [], + "type": "and" + }, + "reduce": { + "expressions": [], + "type": "and" + }, + "where": { + "expressions": [], + "type": "and" + } + }, + "hide": false, + "pluginVersion": "5.0.5", + "query": "ApiserverRequestTotal\n| where $__timeFilter(Timestamp)\n| where Labels.cluster == \"$Cluster\"\n| where Labels.code startswith \"5\"\n| invoke prom_rate()\n| summarize Value=sum(Value) by bin(Timestamp, $__timeInterval)\n| project Timestamp, Errors=Value\n| order by Timestamp asc\n", + "querySource": "raw", + "queryType": "KQL", + "rawMode": true, + "refId": "B", + "resultFormat": "time_series" + } + ], + "title": "Throughput", + "type": "timeseries" + }, + { + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "fieldConfig": { + "defaults": { + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "scaleDistribution": { + "type": "linear" + } + }, + "fieldMinMax": false + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 8, + "x": 8, + "y": 0 + }, + "id": 308, + "options": { + "calculate": false, + "cellGap": 0, + "color": { + "exponent": 0.5, + "fill": "dark-orange", + "mode": "scheme", + "reverse": false, + "scale": "exponential", + "scheme": "Oranges", + "steps": 32 + }, + "exemplars": { + "color": "rgba(255,0,255,0.7)" + }, + "filterValues": { + "le": 1e-9 + }, + "legend": { + "show": true + }, + "rowsFrame": { + "layout": "auto" + }, + "tooltip": { + "mode": "single", + "showColorScale": false, + "yHistogram": false + }, + "yAxis": { + "axisPlacement": "left", + "reverse": false + } + }, + "pluginVersion": "10.4.11", + "targets": [ + { + "OpenAI": false, + "database": "Metrics", + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "expression": { + "groupBy": { + "expressions": [], + "type": "and" + }, + "reduce": { + "expressions": [], + "type": "and" + }, + "where": { + "expressions": [], + "type": "and" + } + }, + "pluginVersion": "5.0.5", + "query": "ApiserverRequestDurationSecondsBucket\n| where $__timeFilter(Timestamp)\n| extend Series=toreal(Labels.le)\n| where Labels.le != \"+Inf\"\n| invoke prom_delta()\n| summarize Value=sum(Value) by bin(Timestamp, 1m), Series\n| project Timestamp, Series, Value\n| order by Timestamp desc, Series asc\n| extend Value=case(prev(Series) < Series, iff(Value-prev(Value) > 0, Value-prev(Value), toreal(0)), Value)\n| project Timestamp, tostring(Series), Value\n| order by Timestamp asc\n", + "querySource": "raw", + "queryType": "KQL", + "rawMode": true, + "refId": "A", + "resultFormat": "time_series" + } + ], + "title": "Latency", + "type": "heatmap" + }, + { + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 8, + "x": 16, + "y": 0 + }, + "id": 3, + "interval": "1m", + "options": { + "displayMode": "gradient", + "maxVizHeight": 300, + "minVizHeight": 16, + "minVizWidth": 8, + "namePlacement": "auto", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "/^Value$/", + "values": true + }, + "showUnfilled": true, + "sizing": "auto", + "valueMode": "hidden" + }, + "pluginVersion": "10.4.11", + "targets": [ + { + "OpenAI": false, + "database": "Metrics", + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "expression": { + "groupBy": { + "expressions": [], + "type": "and" + }, + "reduce": { + "expressions": [], + "type": "and" + }, + "where": { + "expressions": [], + "type": "and" + } + }, + "pluginVersion": "5.0.5", + "query": "ApiserverRequestTotal\n| where $__timeFilter(Timestamp)\n| where Labels.cluster == \"$Cluster\"\n| where Labels.resource != \"\"\n| invoke prom_rate()\n| extend Series=tostring(Labels.resource)\n| summarize Value=sum(Value) by Series\n| project Series, Value\n| order by Value desc\n", + "querySource": "raw", + "queryType": "KQL", + "rawMode": true, + "refId": "A", + "resultFormat": "table" + } + ], + "title": "API Server - Requests By Resource", + "type": "bargauge" + }, + { + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "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 + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 8 + }, + "id": 30, + "interval": "1m", + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "OpenAI": false, + "database": "Metrics", + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "expression": { + "groupBy": { + "expressions": [], + "type": "and" + }, + "reduce": { + "expressions": [], + "type": "and" + }, + "where": { + "expressions": [], + "type": "and" + } + }, + "pluginVersion": "5.0.5", + "query": "ApiserverRequestTotal\n| where $__timeFilter(Timestamp)\n| where Labels.cluster == \"$Cluster\"\n| invoke prom_delta()\n| extend Code=tostring(Labels.code)\n| summarize Value=sum(Value) by bin(Timestamp, $__timeInterval), Code\n| project Timestamp, Code, Value\n| order by Timestamp asc\n", + "querySource": "raw", + "queryType": "KQL", + "rawMode": true, + "refId": "A", + "resultFormat": "time_series" + } + ], + "title": "API Server - Requests By Code", + "type": "timeseries" + }, + { + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "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 + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 8 + }, + "id": 2, + "interval": "1m", + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "OpenAI": false, + "database": "Metrics", + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "expression": { + "groupBy": { + "expressions": [], + "type": "and" + }, + "reduce": { + "expressions": [], + "type": "and" + }, + "where": { + "expressions": [], + "type": "and" + } + }, + "pluginVersion": "5.0.5", + "query": "ApiserverRequestTotal\n| where $__timeFilter(Timestamp)\n| where Labels.cluster == \"$Cluster\"\n| invoke prom_delta()\n| extend Verb=tostring(Labels.verb)\n| summarize Value=sum(Value) by bin(Timestamp, $__timeInterval), Verb\n| project Timestamp, Verb, Value\n| order by Timestamp asc\n", + "querySource": "raw", + "queryType": "KQL", + "rawMode": true, + "refId": "A", + "resultFormat": "time_series" + } + ], + "title": "API Server - Requests By Verb", + "type": "timeseries" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 16 + }, + "id": 8, + "panels": [], + "repeat": "Verb", + "repeatDirection": "h", + "title": "$Verb", + "type": "row" + }, + { + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "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 + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 8, + "x": 0, + "y": 17 + }, + "id": 1, + "interval": "1m", + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "repeat": "Resource", + "repeatDirection": "v", + "targets": [ + { + "OpenAI": false, + "database": "Metrics", + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "expression": { + "groupBy": { + "expressions": [], + "type": "and" + }, + "reduce": { + "expressions": [], + "type": "and" + }, + "where": { + "expressions": [], + "type": "and" + } + }, + "pluginVersion": "5.0.5", + "query": "ApiserverRequestTotal\n| where $__timeFilter(Timestamp)\n| where Labels.cluster == \"$Cluster\"\n| where Labels.resource in ($Resource)\n| where Labels.verb in ($Verb)\n| invoke prom_delta()\n| extend Code=tostring(Labels.code)\n| summarize Value=sum(Value) by bin(Timestamp, $__timeInterval), Code\n| project Timestamp, Code, Value\n| order by Timestamp asc\n", + "querySource": "raw", + "queryType": "KQL", + "rawMode": true, + "refId": "A", + "resultFormat": "time_series" + } + ], + "title": "$Resource By Code", + "type": "timeseries" + }, + { + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "fieldConfig": { + "defaults": { + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "scaleDistribution": { + "type": "linear" + } + }, + "fieldMinMax": false + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 8, + "x": 8, + "y": 17 + }, + "id": 4, + "options": { + "calculate": false, + "cellGap": 0, + "color": { + "exponent": 0.5, + "fill": "dark-orange", + "mode": "scheme", + "reverse": false, + "scale": "exponential", + "scheme": "Oranges", + "steps": 32 + }, + "exemplars": { + "color": "rgba(255,0,255,0.7)" + }, + "filterValues": { + "le": 1e-9 + }, + "legend": { + "show": true + }, + "rowsFrame": { + "layout": "auto" + }, + "tooltip": { + "mode": "single", + "showColorScale": false, + "yHistogram": false + }, + "yAxis": { + "axisPlacement": "left", + "reverse": false + } + }, + "pluginVersion": "10.4.11", + "repeat": "Resource", + "repeatDirection": "v", + "targets": [ + { + "OpenAI": false, + "database": "Metrics", + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "expression": { + "groupBy": { + "expressions": [], + "type": "and" + }, + "reduce": { + "expressions": [], + "type": "and" + }, + "where": { + "expressions": [], + "type": "and" + } + }, + "pluginVersion": "5.0.5", + "query": "ApiserverRequestDurationSecondsBucket\n| where $__timeFilter(Timestamp)\n| extend Series=toreal(Labels.le)\n| where Labels.resource in ($Resource)\n| where Labels.verb in ($Verb)\n| invoke prom_delta()\n| summarize Value=sum(Value) by bin(Timestamp, 1m), Series\n| project Timestamp, Series, Value\n| order by Timestamp desc, Series asc\n| extend Value=case(prev(Series) < Series, iff(Value-prev(Value) > 0, Value-prev(Value), toreal(0)), Value)\n| project Timestamp, tostring(Series), Value\n| order by Timestamp asc\n", + "querySource": "raw", + "queryType": "KQL", + "rawMode": true, + "refId": "A", + "resultFormat": "time_series" + } + ], + "title": "Latency", + "type": "heatmap" + }, + { + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "fieldConfig": { + "defaults": { + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "scaleDistribution": { + "type": "linear" + } + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 8, + "x": 16, + "y": 17 + }, + "id": 7, + "interval": "1m", + "options": { + "calculate": false, + "cellGap": 1, + "color": { + "exponent": 0.5, + "fill": "dark-orange", + "mode": "scheme", + "reverse": false, + "scale": "exponential", + "scheme": "Oranges", + "steps": 64 + }, + "exemplars": { + "color": "rgba(255,0,255,0.7)" + }, + "filterValues": { + "le": 1e-9 + }, + "legend": { + "show": true + }, + "rowsFrame": { + "layout": "auto" + }, + "tooltip": { + "mode": "single", + "showColorScale": false, + "yHistogram": false + }, + "yAxis": { + "axisPlacement": "left", + "reverse": false, + "unit": "decbytes" + } + }, + "pluginVersion": "10.4.11", + "repeat": "Resource", + "repeatDirection": "v", + "targets": [ + { + "OpenAI": false, + "database": "Metrics", + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "expression": { + "groupBy": { + "expressions": [], + "type": "and" + }, + "reduce": { + "expressions": [], + "type": "and" + }, + "where": { + "expressions": [], + "type": "and" + } + }, + "pluginVersion": "5.0.5", + "query": "ApiserverResponseSizesBucket\n| where $__timeFilter(Timestamp)\n| extend Series=toreal(Labels.le)\n| where Labels.resource in ($Resource)\n| where Labels.verb in ($Verb)\n| invoke prom_delta()\n| summarize Value=sum(Value) by bin(Timestamp, 1m), Series\n| project Timestamp, Series, Value\n| order by Timestamp desc, Series asc\n| extend Value=case(prev(Series) < Series, iff(Value-prev(Value) > 0, Value-prev(Value), toreal(0)), Value)\n| project Timestamp, tostring(Series), Value\n| order by Timestamp asc\n", + "querySource": "raw", + "queryType": "KQL", + "rawMode": true, + "refId": "A", + "resultFormat": "time_series" + } + ], + "title": "Response Size", + "type": "heatmap" + } + ], + "refresh": "", + "schemaVersion": 39, + "tags": [], + "templating": { + "list": [ + { + "hide": 0, + "includeAll": false, + "multi": false, + "name": "Datasource", + "options": [], + "query": "grafana-azure-data-explorer-datasource", + "queryValue": "", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "type": "datasource" + }, + { + "current": { + "selected": false, + "text": "", + "value": "" + }, + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "definition": "ContainerCpuUsageSecondsTotal | where $__timeFilter(Timestamp) | extend Cluster=tostring(Labels.cluster) | distinct Cluster", + "error": {}, + "hide": 0, + "includeAll": false, + "multi": false, + "name": "Cluster", + "options": [], + "query": { + "OpenAI": false, + "clusterUri": "", + "database": "Metrics", + "expression": { + "groupBy": { + "expressions": [], + "type": "and" + }, + "reduce": { + "expressions": [], + "type": "and" + }, + "where": { + "expressions": [], + "type": "and" + } + }, + "pluginVersion": "5.0.5", + "query": "ContainerCpuUsageSecondsTotal | where $__timeFilter(Timestamp) | distinct Cluster", + "querySource": "raw", + "queryType": "KQL", + "rawMode": true, + "resultFormat": "table" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "current": { + "selected": false, + "text": [ + "All" + ], + "value": [ + "All" + ] + }, + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "definition": "ApiserverRequestTotal\n| where $__timeFilter(Timestamp)\n| where Cluster == \"$Cluster\"\n| where Labels.resource != \"\"\n| distinct tostring(Labels.resource)\n| order by Labels_resource asc\n", + "error": {}, + "hide": 0, + "includeAll": true, + "label": "", + "multi": true, + "name": "Resource", + "options": [], + "query": { + "OpenAI": false, + "clusterUri": "", + "database": "Metrics", + "expression": { + "groupBy": { + "expressions": [], + "type": "and" + }, + "reduce": { + "expressions": [], + "type": "and" + }, + "where": { + "expressions": [], + "type": "and" + } + }, + "pluginVersion": "5.0.5", + "query": "ApiserverRequestTotal\n| where $__timeFilter(Timestamp)\n| where Cluster == \"$Cluster\"\n| where Labels.resource != \"\"\n| distinct tostring(Labels.resource)\n| order by Labels_resource asc\n", + "querySource": "raw", + "queryType": "KQL", + "rawMode": true, + "resultFormat": "table" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "current": { + "selected": false, + "text": [ + "GET" + ], + "value": [ + "GET" + ] + }, + "hide": 0, + "includeAll": true, + "multi": true, + "name": "Verb", + "options": [ + { + "selected": false, + "text": "All", + "value": "$__all" + }, + { + "selected": false, + "text": "LIST", + "value": "LIST" + }, + { + "selected": false, + "text": "PUT", + "value": "PUT" + }, + { + "selected": false, + "text": "POST", + "value": "POST" + }, + { + "selected": true, + "text": "GET", + "value": "GET" + }, + { + "selected": false, + "text": "PATCH", + "value": "PATCH" + }, + { + "selected": false, + "text": "DELETE", + "value": "DELETE" + }, + { + "selected": false, + "text": "WATCH", + "value": "WATCH" + }, + { + "selected": false, + "text": "CONNECT", + "value": "CONNECT" + } + ], + "query": "LIST,PUT,POST,GET,PATCH,DELETE,WATCH,CONNECT", + "queryValue": "", + "skipUrlSync": false, + "type": "custom" + }, + { + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "definition": "print strcat(\"https://\", current_cluster_endpoint(), \"/\", \"Logs\")", + "hide": 2, + "includeAll": false, + "multi": false, + "name": "LogsURL", + "options": [], + "query": { + "OpenAI": false, + "clusterUri": "", + "database": "Metrics", + "expression": { + "groupBy": { + "expressions": [], + "type": "and" + }, + "reduce": { + "expressions": [], + "type": "and" + }, + "where": { + "expressions": [], + "type": "and" + } + }, + "pluginVersion": "5.0.5", + "query": "print strcat(\"https://\", current_cluster_endpoint(), \"/\", \"Logs\")", + "querySource": "raw", + "queryType": "KQL", + "rawMode": true, + "resultFormat": "table" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + } + ] + }, + "time": { + "from": "now-6h", + "to": "now" + }, + "timepicker": {}, + "timezone": "browser", + "title": "API Server", + "title": "API Server", + "weekStart": "" +} \ No newline at end of file diff --git a/build/k8s/dashboards/cluster-info.json b/build/k8s/dashboards/cluster-info.json new file mode 100644 index 00000000..cf210be3 --- /dev/null +++ b/build/k8s/dashboards/cluster-info.json @@ -0,0 +1,1622 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "id": 37, + "links": [], + "panels": [ + { + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "continuous-GrYlRd" + }, + "fieldMinMax": false, + "mappings": [], + "max": 1, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "percentunit" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 6, + "x": 0, + "y": 0 + }, + "id": 4, + "options": { + "displayMode": "lcd", + "maxVizHeight": 300, + "minVizHeight": 16, + "minVizWidth": 8, + "namePlacement": "top", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showUnfilled": true, + "sizing": "auto", + "text": {}, + "valueMode": "color" + }, + "pluginVersion": "10.4.11", + "targets": [ + { + "OpenAI": false, + "database": "Metrics", + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "expression": { + "groupBy": { + "expressions": [], + "type": "and" + }, + "reduce": { + "expressions": [], + "type": "and" + }, + "where": { + "expressions": [], + "type": "and" + } + }, + "pluginVersion": "5.0.3", + "query": "let totalCPU=toscalar(\nKubeNodeStatusCapacity\n| where $__timeFilter(Timestamp)\n| where Labels.cluster==\"$Cluster\"\n| where Labels.resource == \"cpu\"\n| where Labels.unit == \"core\"\n| extend node=tostring(Labels.node)\n| distinct node, Value\n| summarize Value=sum(Value));\nContainerCpuUsageSecondsTotal\n| where $__timeFilter(Timestamp)\n| where Labels.cluster==\"$Cluster\"\n| where Labels.cpu==\"total\"\n| where Labels.container == \"cadvisor\"\n| extend Namespace=tostring(Labels.namespace)\n| extend Pod=tostring(Labels.pod)\n| extend Container=tostring(Labels.container)\n| where Container == \"\"\n| extend Id = tostring(Labels.id)\n| where Id endswith \".slice\"\n| invoke prom_rate()\n| summarize Value=round(avg(Value)+0.0005,3) by bin(Timestamp, 60000ms), Namespace, Id\n| summarize Value=sum(Value) by bin(Timestamp, $__timeInterval)\n| summarize Real=max(Value)/totalCPU\n\n", + "querySource": "raw", + "queryType": "KQL", + "rawMode": true, + "refId": "Usage", + "resultFormat": "table" + }, + { + "OpenAI": false, + "database": "Metrics", + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "expression": { + "groupBy": { + "expressions": [], + "type": "and" + }, + "reduce": { + "expressions": [], + "type": "and" + }, + "where": { + "expressions": [], + "type": "and" + } + }, + "hide": false, + "pluginVersion": "5.0.3", + "query": "let totalCPU=toscalar(\nKubeNodeStatusCapacity\n| where $__timeFilter(Timestamp)\n| where Labels.cluster==\"$Cluster\"\n| where Labels.resource == \"cpu\"\n| where Labels.unit == \"core\"\n| extend node=tostring(Labels.node)\n| distinct node, Value\n| summarize Value=sum(Value));\nKubePodContainerResourceRequests\n| where $__timeFilter(Timestamp)\n| where Labels.cluster==\"$Cluster\"\n| where Labels.resource==\"cpu\"\n| extend uid=tostring(Labels.uid)\n| summarize Value=max(Value) by bin(Timestamp, 1m), uid\n| summarize Value=sum(Value) by Timestamp\n| summarize Value=avg(Value)\n| project Requests=Value/totalCPU\n\n", + "querySource": "raw", + "queryType": "KQL", + "rawMode": true, + "refId": "Requests", + "resultFormat": "table" + }, + { + "OpenAI": false, + "database": "Metrics", + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "expression": { + "groupBy": { + "expressions": [], + "type": "and" + }, + "reduce": { + "expressions": [], + "type": "and" + }, + "where": { + "expressions": [], + "type": "and" + } + }, + "hide": false, + "pluginVersion": "5.0.3", + "query": "let totalCPU=toscalar(\nKubeNodeStatusCapacity\n| where $__timeFilter(Timestamp)\n| where Labels.cluster==\"$Cluster\"\n| where Labels.resource == \"cpu\"\n| where Labels.unit == \"core\"\n| extend node=tostring(Labels.node)\n| distinct node, Value\n| summarize Value=sum(Value));\nKubePodContainerResourceLimits\n| where $__timeFilter(Timestamp)\n| where Labels.cluster==\"$Cluster\"\n| where Labels.resource==\"cpu\"\n| extend uid=tostring(Labels.uid)\n| summarize Value=max(Value) by bin(Timestamp, 1m), uid\n| summarize Value=sum(Value) by Timestamp\n| summarize Value=avg(Value)\n| project Limits=Value/totalCPU\n\n", + "querySource": "raw", + "queryType": "KQL", + "rawMode": true, + "refId": "Limits", + "resultFormat": "table" + } + ], + "title": "Global CPU Usage", + "type": "bargauge" + }, + { + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "continuous-GrYlRd" + }, + "fieldMinMax": false, + "mappings": [], + "max": 1, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "percentunit" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 6, + "x": 6, + "y": 0 + }, + "id": 5, + "options": { + "displayMode": "lcd", + "maxVizHeight": 300, + "minVizHeight": 16, + "minVizWidth": 8, + "namePlacement": "auto", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showUnfilled": true, + "sizing": "auto", + "valueMode": "color" + }, + "pluginVersion": "10.4.11", + "targets": [ + { + "OpenAI": false, + "database": "Metrics", + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "expression": { + "groupBy": { + "expressions": [], + "type": "and" + }, + "reduce": { + "expressions": [], + "type": "and" + }, + "where": { + "expressions": [], + "type": "and" + } + }, + "pluginVersion": "5.0.3", + "query": "let totalMem=toscalar(\nKubeNodeStatusCapacity\n| where $__timeFilter(Timestamp)\n| where Labels.cluster==\"$Cluster\"\n| where Labels.resource == \"memory\"\n| where Labels.unit == \"byte\"\n| extend node=tostring(Labels.node)\n| distinct node, Value\n| summarize Value=sum(Value));\nContainerMemoryWorkingSetBytes\n| where $__timeFilter(Timestamp)\n| where Labels !has \"id\"\n| where Labels.cluster==\"$Cluster\"\n| extend Namespace=tostring(Labels.namespace)\n| extend Pod=tostring(Labels.pod)\n| extend Container=tostring(Labels.container)\n| where Container != \"\"\n| extend Value=Value\n| summarize Value=avg(Value) by bin(Timestamp, 1m), Namespace, Pod, Container\n| summarize Value=sum(Value) by bin(Timestamp, 1m), Namespace, Pod\n| summarize Value=sum(Value) by bin(Timestamp, 1m)\n| summarize Used=max(Value)\n| project Real=Used/totalMem\n\n", + "querySource": "raw", + "queryType": "KQL", + "rawMode": true, + "refId": "Usage", + "resultFormat": "table" + }, + { + "OpenAI": false, + "database": "Metrics", + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "expression": { + "groupBy": { + "expressions": [], + "type": "and" + }, + "reduce": { + "expressions": [], + "type": "and" + }, + "where": { + "expressions": [], + "type": "and" + } + }, + "hide": false, + "pluginVersion": "5.0.3", + "query": "let totalMem=toscalar(\nKubeNodeStatusCapacity\n| where $__timeFilter(Timestamp)\n| where Labels.cluster==\"$Cluster\"\n| where Labels.resource == \"memory\"\n| where Labels.unit == \"byte\"\n| extend node=tostring(Labels.node)\n| distinct node, Value\n| summarize Value=sum(Value));\nKubePodContainerResourceRequests\n| where $__timeFilter(Timestamp)\n| where Labels.cluster==\"$Cluster\"\n| where Labels.resource==\"memory\"\n| extend uid=tostring(Labels.uid)\n| summarize Value=max(Value) by bin(Timestamp, 1m), uid\n| summarize Value=sum(Value) by Timestamp\n| summarize Value=avg(Value)\n| project Requests=Value/totalMem\n", + "querySource": "raw", + "queryType": "KQL", + "rawMode": true, + "refId": "Requests", + "resultFormat": "table" + }, + { + "OpenAI": false, + "database": "Metrics", + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "expression": { + "groupBy": { + "expressions": [], + "type": "and" + }, + "reduce": { + "expressions": [], + "type": "and" + }, + "where": { + "expressions": [], + "type": "and" + } + }, + "hide": false, + "pluginVersion": "5.0.3", + "query": "let totalMem=toscalar(\nKubeNodeStatusCapacity\n| where $__timeFilter(Timestamp)\n| where Labels.cluster==\"$Cluster\"\n| where Labels.resource == \"memory\"\n| where Labels.unit == \"byte\"\n| extend node=tostring(Labels.node)\n| distinct node, Value\n| summarize Value=sum(Value));\nKubePodContainerResourceLimits\n| where $__timeFilter(Timestamp)\n| where Labels.cluster==\"$Cluster\"\n| where Labels.resource==\"memory\"\n| extend uid=tostring(Labels.uid)\n| summarize Value=max(Value) by bin(Timestamp, 1m), uid\n| summarize Value=sum(Value) by Timestamp\n| summarize Value=avg(Value)\n| project Limits=Value/totalMem\n", + "querySource": "raw", + "queryType": "KQL", + "rawMode": true, + "refId": "Limits", + "resultFormat": "table" + } + ], + "title": "Global RAM Usage", + "type": "bargauge" + }, + { + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "green", + "mode": "fixed" + }, + "mappings": [], + "max": 1000, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 12, + "y": 0 + }, + "id": 1, + "interval": "1m", + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "max" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "10.4.11", + "targets": [ + { + "OpenAI": false, + "database": "Metrics", + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "expression": { + "groupBy": { + "expressions": [], + "type": "and" + }, + "reduce": { + "expressions": [], + "type": "and" + }, + "where": { + "expressions": [], + "type": "and" + } + }, + "pluginVersion": "5.0.3", + "query": "ApiserverStorageObjects\n| where $__timeFilter(Timestamp)\n| extend Resource=tostring(Labels.resource)\n| where Resource in (\"nodes\")\n| summarize Value=avg(Value)\n", + "querySource": "raw", + "queryType": "KQL", + "rawMode": true, + "refId": "A", + "resultFormat": "table" + } + ], + "title": "Nodes", + "type": "stat" + }, + { + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 12, + "w": 10, + "x": 14, + "y": 0 + }, + "id": 12, + "options": { + "legend": { + "calcs": [ + "min", + "max" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "OpenAI": false, + "database": "Metrics", + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "expression": { + "groupBy": { + "expressions": [], + "type": "and" + }, + "reduce": { + "expressions": [], + "type": "and" + }, + "where": { + "expressions": [], + "type": "and" + } + }, + "pluginVersion": "5.0.5", + "query": "ApiserverStorageObjects\n| where $__timeFilter(Timestamp)\n| extend Resource=tostring(Labels.resource)\n| where Resource in (\"configmaps\", \"pods\", \"daemonsets.apps\", \"deployment.apps\", \"events\", \"endpoints\", \"statefulsets.apps\", \"secrets\", \"nodes\", \"namespaces\")\n| extend Resource=replace_string(Resource, \".apps\", \"\")\n| summarize Value=avg(Value) by bin(Timestamp, $__timeInterval), Resource\n| project Timestamp, Resource, Value\n| order by Timestamp asc\n", + "querySource": "raw", + "queryType": "KQL", + "rawMode": true, + "refId": "A", + "resultFormat": "time_series" + } + ], + "title": "Kubernetes Resource Count", + "type": "timeseries" + }, + { + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "green", + "mode": "fixed" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 12, + "y": 4 + }, + "id": 13, + "interval": "1m", + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "10.4.11", + "targets": [ + { + "OpenAI": false, + "database": "Metrics", + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "expression": { + "groupBy": { + "expressions": [], + "type": "and" + }, + "reduce": { + "expressions": [], + "type": "and" + }, + "where": { + "expressions": [], + "type": "and" + } + }, + "pluginVersion": "5.0.3", + "query": "ApiserverStorageObjects\n| where $__timeFilter(Timestamp)\n| extend Resource=tostring(Labels.resource)\n| where Resource in (\"namespaces\")\n| summarize Value=max(Value)\n", + "querySource": "raw", + "queryType": "KQL", + "rawMode": true, + "refId": "A", + "resultFormat": "table" + } + ], + "title": "Namespaces", + "type": "stat" + }, + { + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "green", + "mode": "fixed" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "none" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Real" + }, + "properties": [ + { + "id": "decimals", + "value": 2 + } + ] + } + ] + }, + "gridPos": { + "h": 4, + "w": 6, + "x": 0, + "y": 8 + }, + "id": 6, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "value_and_name", + "wideLayout": true + }, + "pluginVersion": "10.4.11", + "targets": [ + { + "OpenAI": false, + "database": "Metrics", + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "expression": { + "groupBy": { + "expressions": [], + "type": "and" + }, + "reduce": { + "expressions": [], + "type": "and" + }, + "where": { + "expressions": [], + "type": "and" + } + }, + "pluginVersion": "5.0.3", + "query": "ContainerCpuUsageSecondsTotal\n| where $__timeFilter(Timestamp)\n| where Labels.cluster==\"$Cluster\"\n| where Labels.cpu==\"total\"\n| where Labels.container == \"cadvisor\"\n| extend Namespace=tostring(Labels.namespace)\n| extend Pod=tostring(Labels.pod)\n| extend Container=tostring(Labels.container)\n| where Container == \"\"\n| extend Id = tostring(Labels.id)\n| where Id endswith \".slice\"\n| invoke prom_rate()\n| summarize Value=round(avg(Value)+0.0005,1) by bin(Timestamp, 60000ms), Namespace, Id\n| summarize Value=sum(Value) by bin(Timestamp, $__timeInterval)\n| summarize Real=round(max(Value),1)", + "querySource": "raw", + "queryType": "KQL", + "rawMode": true, + "refId": "Real", + "resultFormat": "table" + }, + { + "OpenAI": false, + "database": "Metrics", + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "expression": { + "groupBy": { + "expressions": [], + "type": "and" + }, + "reduce": { + "expressions": [], + "type": "and" + }, + "where": { + "expressions": [], + "type": "and" + } + }, + "hide": false, + "pluginVersion": "5.0.3", + "query": "KubePodContainerResourceRequests\n| where $__timeFilter(Timestamp)\n| where Labels.cluster==\"$Cluster\"\n| where Labels.resource==\"cpu\"\n| extend uid=tostring(Labels.uid)\n| summarize Value=max(Value) by bin(Timestamp, 1m), uid\n| summarize Value=sum(Value) by Timestamp\n| summarize Value=avg(Value)\n| project Requests=Value", + "querySource": "raw", + "queryType": "KQL", + "rawMode": true, + "refId": "Requests", + "resultFormat": "table" + }, + { + "OpenAI": false, + "database": "Metrics", + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "expression": { + "groupBy": { + "expressions": [], + "type": "and" + }, + "reduce": { + "expressions": [], + "type": "and" + }, + "where": { + "expressions": [], + "type": "and" + } + }, + "hide": false, + "pluginVersion": "5.0.3", + "query": "KubePodContainerResourceLimits\n| where $__timeFilter(Timestamp)\n| where Labels.cluster==\"$Cluster\"\n| where Labels.resource==\"cpu\"\n| extend uid=tostring(Labels.uid)\n| summarize Value=max(Value) by bin(Timestamp, 1m), uid\n| summarize Value=sum(Value) by Timestamp\n| summarize Value=avg(Value)\n| project Limits=Value", + "querySource": "raw", + "queryType": "KQL", + "rawMode": true, + "refId": "Limits", + "resultFormat": "table" + }, + { + "OpenAI": false, + "database": "Metrics", + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "expression": { + "groupBy": { + "expressions": [], + "type": "and" + }, + "reduce": { + "expressions": [], + "type": "and" + }, + "where": { + "expressions": [], + "type": "and" + } + }, + "hide": false, + "pluginVersion": "5.0.3", + "query": "KubeNodeStatusCapacity\n| where $__timeFilter(Timestamp)\n| where Labels.cluster==\"$Cluster\"\n| where Labels.resource == \"cpu\"\n| where Labels.unit == \"core\"\n| extend node=tostring(Labels.node)\n| distinct node, Value\n| summarize Total=sum(Value)", + "querySource": "raw", + "queryType": "KQL", + "rawMode": true, + "refId": "Total", + "resultFormat": "table" + } + ], + "title": "CPU Usage (Cores)", + "type": "stat" + }, + { + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "green", + "mode": "fixed" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "decbytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 6, + "x": 6, + "y": 8 + }, + "id": 7, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "value_and_name", + "wideLayout": true + }, + "pluginVersion": "10.4.11", + "targets": [ + { + "OpenAI": false, + "database": "Metrics", + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "expression": { + "groupBy": { + "expressions": [], + "type": "and" + }, + "reduce": { + "expressions": [], + "type": "and" + }, + "where": { + "expressions": [], + "type": "and" + } + }, + "pluginVersion": "5.0.3", + "query": "ContainerMemoryWorkingSetBytes\n| where $__timeFilter(Timestamp)\n| where Labels !has \"id\"\n| where Labels.cluster==\"$Cluster\"\n| extend Namespace=tostring(Labels.namespace)\n| extend Pod=tostring(Labels.pod)\n| extend Container=tostring(Labels.container)\n| where Container != \"\"\n| extend Value=Value\n| summarize Value=avg(Value) by bin(Timestamp, 1m), Namespace, Pod, Container\n| summarize Value=sum(Value) by bin(Timestamp, 1m), Namespace, Pod\n| summarize Value=sum(Value) by bin(Timestamp, 1m)\n| summarize Used=max(Value)\n| project Real=Used", + "querySource": "raw", + "queryType": "KQL", + "rawMode": true, + "refId": "Real", + "resultFormat": "table" + }, + { + "OpenAI": false, + "database": "Metrics", + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "expression": { + "groupBy": { + "expressions": [], + "type": "and" + }, + "reduce": { + "expressions": [], + "type": "and" + }, + "where": { + "expressions": [], + "type": "and" + } + }, + "hide": false, + "pluginVersion": "5.0.3", + "query": "KubePodContainerResourceRequests\n| where $__timeFilter(Timestamp)\n| where Labels.cluster==\"$Cluster\"\n| where Labels.resource==\"memory\"\n| extend uid=tostring(Labels.uid)\n| summarize Value=max(Value) by bin(Timestamp, 1m), uid\n| summarize Value=sum(Value) by Timestamp\n| summarize Value=avg(Value)\n| project Requests=Value", + "querySource": "raw", + "queryType": "KQL", + "rawMode": true, + "refId": "Requests", + "resultFormat": "table" + }, + { + "OpenAI": false, + "database": "Metrics", + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "expression": { + "groupBy": { + "expressions": [], + "type": "and" + }, + "reduce": { + "expressions": [], + "type": "and" + }, + "where": { + "expressions": [], + "type": "and" + } + }, + "hide": false, + "pluginVersion": "5.0.3", + "query": "KubePodContainerResourceLimits\n| where $__timeFilter(Timestamp)\n| where Labels.cluster==\"$Cluster\"\n| where Labels.resource==\"memory\"\n| extend uid=tostring(Labels.uid)\n| summarize Value=max(Value) by bin(Timestamp, 1m), uid\n| summarize Value=sum(Value) by Timestamp\n| summarize Value=avg(Value)\n| project Limits=Value", + "querySource": "raw", + "queryType": "KQL", + "rawMode": true, + "refId": "Limits", + "resultFormat": "table" + }, + { + "OpenAI": false, + "database": "Metrics", + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "expression": { + "groupBy": { + "expressions": [], + "type": "and" + }, + "reduce": { + "expressions": [], + "type": "and" + }, + "where": { + "expressions": [], + "type": "and" + } + }, + "hide": false, + "pluginVersion": "5.0.3", + "query": "KubeNodeStatusCapacity\n| where $__timeFilter(Timestamp)\n| where Labels.cluster==\"$Cluster\"\n| where Labels.resource == \"memory\"\n| where Labels.unit == \"byte\"\n| extend node=tostring(Labels.node)\n| distinct node, Value\n| summarize Total=sum(Value)", + "querySource": "raw", + "queryType": "KQL", + "rawMode": true, + "refId": "Total", + "resultFormat": "table" + } + ], + "title": "RAM Usage", + "type": "stat" + }, + { + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "green", + "mode": "fixed" + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 2, + "x": 12, + "y": 8 + }, + "id": 2, + "interval": "1m", + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "10.4.11", + "targets": [ + { + "OpenAI": false, + "database": "Metrics", + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "expression": { + "groupBy": { + "expressions": [], + "type": "and" + }, + "reduce": { + "expressions": [], + "type": "and" + }, + "where": { + "expressions": [], + "type": "and" + } + }, + "pluginVersion": "5.0.3", + "query": "ApiserverStorageObjects\n| where $__timeFilter(Timestamp)\n| extend Resource=tostring(Labels.resource)\n| where Resource in (\"pods\")\n| summarize Value=avg(Value)\n", + "querySource": "raw", + "queryType": "KQL", + "rawMode": true, + "refId": "A", + "resultFormat": "table" + } + ], + "title": "Pods", + "type": "stat" + }, + { + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "continuous-GrYlRd" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "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": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "max": 1, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "percentunit" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 12, + "x": 0, + "y": 12 + }, + "id": 11, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": false + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "OpenAI": false, + "database": "Metrics", + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "expression": { + "groupBy": { + "expressions": [], + "type": "and" + }, + "reduce": { + "expressions": [], + "type": "and" + }, + "where": { + "expressions": [], + "type": "and" + } + }, + "pluginVersion": "5.0.3", + "query": "let totalCPU=toscalar(\nKubeNodeStatusCapacity\n| where $__timeFilter(Timestamp)\n| where Labels.cluster==\"$Cluster\"\n| where Labels.resource == \"cpu\"\n| where Labels.unit == \"core\"\n| extend node=tostring(Labels.node)\n| distinct node, Value\n| summarize Value=sum(Value));\nContainerCpuUsageSecondsTotal\n| where $__timeFilter(Timestamp)\n| where Labels.cluster==\"$Cluster\"\n| where Labels.cpu==\"total\"\n| extend Namespace=tostring(Labels.namespace)\n| extend Pod=tostring(Labels.pod)\n| extend Container=tostring(Labels.container)\n| where Container != \"\"\n| invoke prom_delta()\n| summarize Value=sum(Value)/60 by bin(Timestamp, $__timeInterval), Namespace\n| project Timestamp, Value/totalCPU\n| order by Timestamp asc\n\n\n", + "querySource": "raw", + "queryType": "KQL", + "rawMode": true, + "refId": "Utilization", + "resultFormat": "time_series" + } + ], + "title": "Cluster CPU Utilization", + "type": "timeseries" + }, + { + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "continuous-GrYlRd" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "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": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "max": 1, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "percentunit" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 12, + "x": 12, + "y": 12 + }, + "id": 10, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": false + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "OpenAI": false, + "database": "Metrics", + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "expression": { + "groupBy": { + "expressions": [], + "type": "and" + }, + "reduce": { + "expressions": [], + "type": "and" + }, + "where": { + "expressions": [], + "type": "and" + } + }, + "pluginVersion": "5.0.3", + "query": "let totalMem=toscalar(\nKubeNodeStatusCapacity\n| where $__timeFilter(Timestamp)\n| where Labels.cluster==\"$Cluster\"\n| where Labels.resource == \"memory\"\n| where Labels.unit == \"byte\"\n| extend node=tostring(Labels.node)\n| distinct node, Value\n| summarize Value=sum(Value));\nContainerMemoryUsageBytes\n| where $__timeFilter(Timestamp)\n| where Labels.cluster==\"$Cluster\"\n| extend Namespace=tostring(Labels.namespace)\n| extend Pod=tostring(Labels.pod)\n| extend Container=tostring(Labels.container)\n| where Container != \"\"\n| extend Value=Value\n| summarize Value=avg(Value) by bin(Timestamp, $__timeInterval), Namespace, Pod\n| summarize Value=sum(Value) by bin(Timestamp, $__timeInterval)\n| project Timestamp, Value=Value/totalMem\n| order by Timestamp asc\n", + "querySource": "raw", + "queryType": "KQL", + "rawMode": true, + "refId": "Utilization", + "resultFormat": "time_series" + } + ], + "title": "Cluster Memory Utilization", + "type": "timeseries" + }, + { + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "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 + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [ + { + "title": "View Namespace", + "url": "https://grafana-largecluster-d4ffgvdnftbvcmfs.cca.grafana.azure.com/d/fdvfjzx9locu8a/namespaces?orgId=1&${__url_time_range}&${Cluster:queryparam}&var-Namespace=${__field.labels.Namespace}" + }, + { + "title": "View Pods", + "url": "https://grafana-largecluster-d4ffgvdnftbvcmfs.cca.grafana.azure.com/d/cduxp9nbmj1fkb/pods?orgId=1&refresh=1m?Namespace=${__field.labels.Namespace}" + } + ], + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "Cores" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 19 + }, + "id": 8, + "interval": "1m", + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "OpenAI": false, + "database": "Metrics", + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "expression": { + "groupBy": { + "expressions": [], + "type": "and" + }, + "reduce": { + "expressions": [], + "type": "and" + }, + "where": { + "expressions": [], + "type": "and" + } + }, + "pluginVersion": "5.0.3", + "query": "ContainerCpuUsageSecondsTotal\n| where $__timeFilter(Timestamp)\n| where Labels.cluster==\"$Cluster\"\n| where Labels.cpu==\"total\"\n| where Labels.container == \"cadvisor\"\n| extend Namespace=tostring(Labels.namespace)\n| extend Pod=tostring(Labels.pod)\n| extend Container=tostring(Labels.container)\n| where Container == \"\"\n| extend Id = tostring(Labels.id)\n| where Id endswith \".slice\"\n| where Namespace != \"\"\n| invoke prom_rate()\n| summarize Value=round(avg(Value)+0.0005,3) by bin(Timestamp, 60000ms), Namespace, Id\n| summarize Value=sum(Value) by bin(Timestamp, $__timeInterval), Namespace\n| project Timestamp, Namespace, Value\n| order by Timestamp asc", + "querySource": "raw", + "queryType": "KQL", + "rawMode": true, + "refId": "Utilization", + "resultFormat": "time_series" + } + ], + "title": "CPU Usage By Namespace", + "type": "timeseries" + }, + { + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "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 + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [ + { + "title": "View Pods", + "url": "https://grafana-largecluster-d4ffgvdnftbvcmfs.cca.grafana.azure.com/d/cduxp9nbmj1fkb/pods?orgId=1&var-Namespace=${__field.labels.Namespace}" + }, + { + "title": "View Namespace", + "url": "https://grafana-largecluster-d4ffgvdnftbvcmfs.cca.grafana.azure.com/d/fdvfjzx9locu8a/namespaces?orgId=1&${__url_time_range}&var-Namespace=${__field.labels.Namespace}&${Cluster:queryparam}" + } + ], + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 19 + }, + "id": 9, + "interval": "1m", + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "OpenAI": false, + "database": "Metrics", + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "expression": { + "groupBy": { + "expressions": [], + "type": "and" + }, + "reduce": { + "expressions": [], + "type": "and" + }, + "where": { + "expressions": [], + "type": "and" + } + }, + "pluginVersion": "5.0.3", + "query": "ContainerMemoryWorkingSetBytes\n| where $__timeFilter(Timestamp)\n| where Labels !has \"id\"\n| where Labels.cluster==\"$Cluster\"\n| extend Namespace=tostring(Labels.namespace)\n| extend Pod=tostring(Labels.pod)\n| extend Container=tostring(Labels.container)\n| where Container != \"\"\n| extend Value=Value\n| summarize Value=avg(Value) by bin(Timestamp, $__timeInterval), Namespace, Pod, Container\n| summarize Value=sum(Value) by bin(Timestamp, $__timeInterval), Namespace, Pod\n| summarize Value=sum(Value) by bin(Timestamp, $__timeInterval), Namespace\n| project Timestamp, Namespace, Value\n| order by Timestamp asc", + "querySource": "raw", + "queryType": "KQL", + "rawMode": true, + "refId": "Utilization", + "resultFormat": "time_series" + } + ], + "title": "Memory Usage By Namespace", + "type": "timeseries" + } + ], + "refresh": "", + "schemaVersion": 39, + "tags": [], + "templating": { + "list": [ + { + "hide": 0, + "includeAll": false, + "multi": false, + "name": "Datasource", + "options": [], + "query": "grafana-azure-data-explorer-datasource", + "queryValue": "", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "type": "datasource" + }, + { + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "definition": "ContainerCpuUsageSecondsTotal | where $__timeFilter(Timestamp) | extend Cluster=tostring(Labels.cluster) | distinct Cluster", + "hide": 0, + "includeAll": false, + "multi": false, + "name": "Cluster", + "options": [], + "query": { + "OpenAI": false, + "clusterUri": "", + "database": "Metrics", + "expression": { + "groupBy": { + "expressions": [], + "type": "and" + }, + "reduce": { + "expressions": [], + "type": "and" + }, + "where": { + "expressions": [], + "type": "and" + } + }, + "pluginVersion": "5.0.5", + "query": "ContainerCpuUsageSecondsTotal | where $__timeFilter(Timestamp) | extend Cluster=tostring(Labels.cluster) | distinct Cluster", + "querySource": "raw", + "queryType": "KQL", + "rawMode": true, + "resultFormat": "table" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + } + ] + }, + "time": { + "from": "now-30m", + "to": "now-1m" + }, + "timepicker": { + "nowDelay": "1m" + }, + "timezone": "browser", + "title": "Cluster Info", + "weekStart": "" +} \ No newline at end of file diff --git a/build/k8s/dashboards/metrics-stats.json b/build/k8s/dashboards/metrics-stats.json new file mode 100644 index 00000000..36154a77 --- /dev/null +++ b/build/k8s/dashboards/metrics-stats.json @@ -0,0 +1,2851 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "target": { + "limit": 100, + "matchAny": false, + "tags": [], + "type": "dashboard" + }, + "type": "dashboard" + } + ] + }, + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "id": 42, + "links": [], + "liveNow": false, + "panels": [ + { + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "max": 10000, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 9000 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 0, + "y": 0 + }, + "id": 2, + "options": { + "minVizHeight": 75, + "minVizWidth": 75, + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true, + "sizing": "auto" + }, + "pluginVersion": "10.4.11", + "targets": [ + { + "database": "$Database", + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "expression": { + "groupBy": { + "expressions": [], + "type": "and" + }, + "reduce": { + "expressions": [], + "type": "and" + }, + "where": { + "expressions": [], + "type": "and" + } + }, + "pluginVersion": "4.4.1", + "query": ".show tables details\n| summarize dcount(TableName) ", + "querySource": "raw", + "queryType": "KQL", + "rawMode": true, + "refId": "A", + "resultFormat": "table" + } + ], + "title": "Metrics", + "type": "gauge" + }, + { + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "red", + "value": null + }, + { + "color": "green", + "value": 0 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 4, + "y": 0 + }, + "hideTimeOverride": true, + "id": 14, + "interval": "1m", + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "/^Value$/", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "10.4.11", + "targets": [ + { + "database": "$Database", + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "expression": { + "groupBy": { + "expressions": [], + "type": "and" + }, + "reduce": { + "expressions": [], + "type": "and" + }, + "where": { + "expressions": [], + "type": "and" + } + }, + "pluginVersion": "4.4.1", + "query": "AdxmonIngestorTableCardinalityCount\n| where Timestamp >= ago(30m)\n| extend Table=tostring(Labels.table)\n| summarize Value=round(avg(Value)) by bin(Timestamp, 1m), Table\n| summarize Value=sum(Value) by bin(Timestamp, 1m)\n| order by Timestamp asc \n", + "querySource": "raw", + "queryType": "KQL", + "rawMode": true, + "refId": "A", + "resultFormat": "table" + } + ], + "title": "Active Series", + "type": "stat" + }, + { + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "decimals": 1, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "short" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "AMCost" + }, + "properties": [ + { + "id": "unit", + "value": "currencyUSD" + } + ] + } + ] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 8, + "y": 0 + }, + "id": 3, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "/.*/", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "10.4.11", + "targets": [ + { + "database": "$Database", + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "expression": { + "groupBy": { + "expressions": [], + "type": "and" + }, + "reduce": { + "expressions": [], + "type": "and" + }, + "where": { + "expressions": [], + "type": "and" + } + }, + "pluginVersion": "4.4.1", + "query": ".show extents \n| summarize Samples=sum(RowCount)\n| extend AMCost=(Samples/10e6)*0.16", + "querySource": "raw", + "queryType": "KQL", + "rawMode": true, + "refId": "A", + "resultFormat": "table" + } + ], + "title": "Samples", + "type": "stat" + }, + { + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "decimals": 1, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 12, + "y": 0 + }, + "id": 28, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "10.4.11", + "targets": [ + { + "database": "Metrics", + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "expression": { + "groupBy": { + "expressions": [], + "type": "and" + }, + "reduce": { + "expressions": [], + "type": "and" + }, + "where": { + "expressions": [], + "type": "and" + } + }, + "pluginVersion": "4.4.1", + "query": "AdxmonCollectorHealthCheck\n| where $__timeFilter(Timestamp)\n| extend Host=tostring(Labels.Host)\n| summarize dcount(Host)", + "querySource": "raw", + "queryType": "KQL", + "rawMode": true, + "refId": "A", + "resultFormat": "table" + } + ], + "title": "Hosts", + "type": "stat" + }, + { + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "decimals": 1, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 16, + "y": 0 + }, + "id": 29, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "max" + ], + "fields": "/^Value$/", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "10.4.11", + "targets": [ + { + "database": "Metrics", + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "expression": { + "groupBy": { + "expressions": [], + "type": "and" + }, + "reduce": { + "expressions": [], + "type": "and" + }, + "where": { + "expressions": [], + "type": "and" + } + }, + "pluginVersion": "4.4.1", + "query": "ContainerCpuUsageSecondsTotal\n| where $__timeFilter(Timestamp)\n| where Labels.cluster == \"$Cluster\"\n| distinct tostring(Labels.pod)\n| summarize Value=count()", + "querySource": "raw", + "queryType": "KQL", + "rawMode": true, + "refId": "A", + "resultFormat": "table" + } + ], + "title": "Pods", + "type": "stat" + }, + { + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "red", + "value": null + }, + { + "color": "green", + "value": 0 + } + ] + }, + "unit": "wps" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 20, + "y": 0 + }, + "hideTimeOverride": true, + "id": 13, + "interval": "1m", + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "/^Value$/", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "10.4.11", + "targets": [ + { + "database": "Metrics", + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "expression": { + "groupBy": { + "expressions": [], + "type": "and" + }, + "reduce": { + "expressions": [], + "type": "and" + }, + "where": { + "expressions": [], + "type": "and" + } + }, + "pluginVersion": "4.4.1", + "query": "AdxmonIngestorSamplesStoredTotal\n| where $__timeFilter(Timestamp)\n| where Labels.metric == \"Ingestor\"\n| invoke prom_delta()\n| summarize Value=sum(Value)/60 by bin(Timestamp, 1m), tostring(Labels.pod)\n| summarize Value=sum(Value) by bin(Timestamp, 1m)", + "querySource": "raw", + "queryType": "KQL", + "rawMode": true, + "refId": "A", + "resultFormat": "table" + } + ], + "timeShift": "5m", + "title": "Samples Throughput", + "type": "stat" + }, + { + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue", + "value": null + }, + { + "color": "red", + "value": 60 + } + ] + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 0, + "y": 4 + }, + "hideTimeOverride": true, + "id": 19, + "interval": "1m", + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "firstNotNull" + ], + "fields": "/^Value$/", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "10.4.11", + "targets": [ + { + "database": "Metrics", + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "expression": { + "groupBy": { + "expressions": [], + "type": "and" + }, + "reduce": { + "expressions": [], + "type": "and" + }, + "where": { + "expressions": [], + "type": "and" + } + }, + "pluginVersion": "4.4.1", + "query": "AdxmonIngestorWalSegmentsMaxAgeSeconds\n| where $__timeFilter(Timestamp)\n| where Labels.cluster == \"$Cluster\"\n| where Labels.metric contains \"ingestor\"\n| where Value != 9223372036.8547764\n| make-series Value=avg(Value) on Timestamp from ago(30m) to now() step 60000ms\n| extend mvg=series_fir(Value, repeat(1, 5), true, true)\n| extend mvg=array_slice(mvg, 0, array_length(mvg)-5)\n| extend Value=mvg[array_length(mvg)-1]\n| project Value\n", + "querySource": "raw", + "queryType": "KQL", + "rawMode": true, + "refId": "A", + "resultFormat": "table" + } + ], + "timeShift": "1m", + "title": "Avg Segment Age", + "type": "stat" + }, + { + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue", + "value": null + }, + { + "color": "red", + "value": 60 + } + ] + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 4, + "y": 4 + }, + "hideTimeOverride": true, + "id": 24, + "interval": "1m", + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "first" + ], + "fields": "/^Value$/", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "10.4.11", + "targets": [ + { + "database": "Metrics", + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "expression": { + "from": { + "property": { + "name": "AdxmonIngestorRequestsReceivedTotal", + "type": "string" + }, + "type": "property" + }, + "groupBy": { + "expressions": [], + "type": "and" + }, + "reduce": { + "expressions": [], + "type": "and" + }, + "where": { + "expressions": [ + { + "expressions": [ + { + "operator": { + "name": "==", + "value": "" + }, + "property": { + "name": "UnderlayName", + "type": "string" + }, + "type": "operator" + } + ], + "type": "or" + } + ], + "type": "and" + } + }, + "pluginVersion": "4.4.1", + "query": "AdxmonIngestorWalSegmentsMaxAgeSeconds\n| where $__timeFilter(Timestamp)\n| where Labels.cluster == \"$Cluster\"\n| where Labels.metric contains \"ingestor\"\n| where Value != 9223372036.8547764\n| make-series Value=max(Value) on Timestamp from ago(30m) to now() step 60000ms\n| extend mvg=series_fir(Value, repeat(1, 5), true, true)\n| extend mvg=array_slice(mvg, 0, array_length(mvg)-5)\n| extend Value=mvg[array_length(mvg)-1]\n| project Value", + "querySource": "raw", + "queryType": "KQL", + "rawMode": true, + "refId": "A", + "resultFormat": "table" + } + ], + "timeShift": "1m", + "title": "Max Segment Age", + "type": "stat" + }, + { + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue", + "value": null + }, + { + "color": "red", + "value": 10000000000 + } + ] + }, + "unit": "decbytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 8, + "y": 4 + }, + "id": 20, + "interval": "1m", + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "10.4.11", + "targets": [ + { + "database": "Metrics", + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "expression": { + "from": { + "property": { + "name": "AdxmonIngestorRequestsReceivedTotal", + "type": "string" + }, + "type": "property" + }, + "groupBy": { + "expressions": [], + "type": "and" + }, + "reduce": { + "expressions": [], + "type": "and" + }, + "where": { + "expressions": [ + { + "expressions": [ + { + "operator": { + "name": "==", + "value": "" + }, + "property": { + "name": "UnderlayName", + "type": "string" + }, + "type": "operator" + } + ], + "type": "or" + } + ], + "type": "and" + } + }, + "pluginVersion": "4.4.1", + "query": "AdxmonIngestorWalSegmentsSizeBytes\n| where $__timeFilter(Timestamp)\n| where Labels.cluster == \"$Cluster\"\n| extend metric=tostring(Labels.metric), Host=tostring(Labels.Host)\n| summarize Value=max(Value) by bin(Timestamp, 5m), metric, Host\n| summarize Value=sum(Value) by bin(Timestamp, 5m), Host\n| summarize avg(Value) by Timestamp\n| order by Timestamp asc\n\n", + "querySource": "raw", + "queryType": "KQL", + "rawMode": true, + "refId": "A", + "resultFormat": "time_series" + } + ], + "title": "WAL Segments Disk Usage", + "type": "stat" + }, + { + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 12, + "y": 4 + }, + "id": 21, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "/^Rention$/", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "10.4.11", + "targets": [ + { + "database": "$Database", + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "expression": { + "groupBy": { + "expressions": [], + "type": "and" + }, + "reduce": { + "expressions": [], + "type": "and" + }, + "where": { + "expressions": [], + "type": "and" + } + }, + "pluginVersion": "4.4.1", + "query": ".show extents \n| summarize MinCreate=min(MinCreatedOn), MaxCreate=max(MaxCreatedOn)\n| extend TimeRange=MaxCreate - MinCreate\n| extend Rention=strcat(format_timespan(TimeRange, 'dd'), \" days\")\n| project-away MinCreate, MaxCreate, TimeRange", + "querySource": "raw", + "queryType": "KQL", + "rawMode": true, + "refId": "A", + "resultFormat": "table" + } + ], + "title": "Rentention", + "type": "stat" + }, + { + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 16, + "y": 4 + }, + "id": 7, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "10.4.11", + "targets": [ + { + "database": "$Database", + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "expression": { + "groupBy": { + "expressions": [], + "type": "and" + }, + "reduce": { + "expressions": [], + "type": "and" + }, + "where": { + "expressions": [], + "type": "and" + } + }, + "pluginVersion": "4.4.1", + "query": ".show extents \n| summarize sum(ExtentSize+IndexSize)", + "querySource": "raw", + "queryType": "KQL", + "rawMode": true, + "refId": "A", + "resultFormat": "table" + } + ], + "title": "DB Size", + "type": "stat" + }, + { + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 20, + "y": 4 + }, + "id": 6, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "10.4.11", + "targets": [ + { + "database": "$Database", + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "expression": { + "groupBy": { + "expressions": [], + "type": "and" + }, + "reduce": { + "expressions": [], + "type": "and" + }, + "where": { + "expressions": [], + "type": "and" + } + }, + "pluginVersion": "4.4.1", + "query": ".show extents \n| summarize sum(OriginalSize)", + "querySource": "raw", + "queryType": "KQL", + "rawMode": true, + "refId": "A", + "resultFormat": "table" + } + ], + "title": "Uncompressed DB Size", + "type": "stat" + }, + { + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "reqps" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 8 + }, + "hideTimeOverride": true, + "id": 12, + "interval": "1m", + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "database": "Metrics", + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "expression": { + "from": { + "property": { + "name": "AdxmonIngestorRequestsReceivedTotal", + "type": "string" + }, + "type": "property" + }, + "groupBy": { + "expressions": [], + "type": "and" + }, + "reduce": { + "expressions": [], + "type": "and" + }, + "where": { + "expressions": [ + { + "expressions": [ + { + "operator": { + "name": "==", + "value": "" + }, + "property": { + "name": "UnderlayName", + "type": "string" + }, + "type": "operator" + } + ], + "type": "or" + } + ], + "type": "and" + } + }, + "pluginVersion": "4.4.1", + "query": "AdxmonIngestorSamplesStoredTotal\n| where $__timeFilter(Timestamp)\n| where Labels.cluster == \"$Cluster\"\n| where Labels.metric == \"Ingestor\"\n| invoke prom_delta()\n| summarize sum(Value)/($__timeInterval()/1s) by bin(Timestamp, $__timeInterval)\n| order by Timestamp asc\n", + "querySource": "raw", + "queryType": "KQL", + "rawMode": true, + "refId": "A", + "resultFormat": "time_series" + } + ], + "timeShift": "1m", + "title": "Ingestor Sample Throughput", + "type": "timeseries" + }, + { + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "normal" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "reqps" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 8 + }, + "id": 11, + "interval": "1m", + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "database": "Metrics", + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "expression": { + "from": { + "property": { + "name": "AdxmonIngestorRequestsReceivedTotal", + "type": "string" + }, + "type": "property" + }, + "groupBy": { + "expressions": [], + "type": "and" + }, + "reduce": { + "expressions": [], + "type": "and" + }, + "where": { + "expressions": [ + { + "expressions": [ + { + "operator": { + "name": "==", + "value": "" + }, + "property": { + "name": "UnderlayName", + "type": "string" + }, + "type": "operator" + } + ], + "type": "or" + } + ], + "type": "and" + } + }, + "pluginVersion": "4.4.1", + "query": "AdxmonIngestorRequestsReceivedTotal\n| where $__timeFilter(Timestamp)\n| where Labels.cluster == \"$Cluster\"\n// | where Container == \"ingestor\"\n| invoke prom_delta()\n| extend code=tostring(Labels.code)\n| extend path=tostring(Labels.path)\n| summarize Avg=sum(Value)/($__timeInterval()/1s) by bin(Timestamp, $__timeInterval), code, path\n| order by Timestamp asc, code, path\n| project Timestamp, code, path, Avg", + "querySource": "raw", + "queryType": "KQL", + "rawMode": true, + "refId": "A", + "resultFormat": "time_series" + } + ], + "title": "Ingestor Requests by Path", + "type": "timeseries" + }, + { + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "continuous-GrYlRd" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "axisSoftMin": 0, + "barAlignment": 0, + "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": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 16 + }, + "hideTimeOverride": true, + "id": 16, + "interval": "1m", + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "database": "Metrics", + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "expression": { + "from": { + "property": { + "name": "AdxmonIngestorRequestsReceivedTotal", + "type": "string" + }, + "type": "property" + }, + "groupBy": { + "expressions": [], + "type": "and" + }, + "reduce": { + "expressions": [], + "type": "and" + }, + "where": { + "expressions": [ + { + "expressions": [ + { + "operator": { + "name": "==", + "value": "" + }, + "property": { + "name": "UnderlayName", + "type": "string" + }, + "type": "operator" + } + ], + "type": "or" + } + ], + "type": "and" + } + }, + "pluginVersion": "4.4.1", + "query": "AdxmonIngestorWalSegmentsMaxAgeSeconds\n| where $__timeFilter(Timestamp)\n| where Labels.cluster == \"$Cluster\"\n| where Labels.metric contains \"ingestor\"\n| where Value != 9223372036.8547764\n| make-series Value=max(Value) on Timestamp from $__timeFrom to $__timeTo step $__timeInterval by Pod\n| extend stats=series_stats_dynamic(Value)\n| order by toreal(stats.max) desc\n| limit 10\n| project Pod, Timestamp, Value", + "querySource": "raw", + "queryType": "KQL", + "rawMode": true, + "refId": "A", + "resultFormat": "time_series_adx_series" + } + ], + "timeShift": "1m", + "title": "Top Max Segment Age", + "type": "timeseries" + }, + { + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "reqps" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 16 + }, + "id": 22, + "interval": "1m", + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "database": "Metrics", + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "expression": { + "from": { + "property": { + "name": "AdxmonIngestorRequestsReceivedTotal", + "type": "string" + }, + "type": "property" + }, + "groupBy": { + "expressions": [], + "type": "and" + }, + "reduce": { + "expressions": [], + "type": "and" + }, + "where": { + "expressions": [ + { + "expressions": [ + { + "operator": { + "name": "==", + "value": "" + }, + "property": { + "name": "UnderlayName", + "type": "string" + }, + "type": "operator" + } + ], + "type": "or" + } + ], + "type": "and" + } + }, + "pluginVersion": "4.4.1", + "query": "AdxmonIngestorRequestsReceivedTotal\n| where $__timeFilter(Timestamp)\n| where Cluster == \"$Cluster\"\n| where Container == \"ingestor\"\n| invoke prom_delta()\n| extend code=tostring(Labels.code)\n| summarize Avg=sum(Value)/($__timeInterval/1s) by bin(Timestamp, $__timeInterval), Host\n| order by Timestamp asc, Host\n| project Timestamp, Host, Avg\n\n", + "querySource": "raw", + "queryType": "KQL", + "rawMode": true, + "refId": "A", + "resultFormat": "time_series" + } + ], + "title": "Ingestor Requests By Host", + "type": "timeseries" + }, + { + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "axisSoftMin": 0, + "barAlignment": -1, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 0, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 24 + }, + "id": 23, + "interval": "1m", + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "database": "Metrics", + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "expression": { + "from": { + "property": { + "name": "AdxmonIngestorRequestsReceivedTotal", + "type": "string" + }, + "type": "property" + }, + "groupBy": { + "expressions": [], + "type": "and" + }, + "reduce": { + "expressions": [], + "type": "and" + }, + "where": { + "expressions": [ + { + "expressions": [ + { + "operator": { + "name": "==", + "value": "" + }, + "property": { + "name": "UnderlayName", + "type": "string" + }, + "type": "operator" + } + ], + "type": "or" + } + ], + "type": "and" + } + }, + "pluginVersion": "4.4.1", + "query": "AdxmonIngestorWalSegmentsCount\n| where $__timeFilter(Timestamp)\n| where Cluster == \"$Cluster\"\n| where Container == \"ingestor\"\n| extend metric=tostring(Labels.metric)\n| summarize Value=avg(Value) by bin(Timestamp, $__timeInterval), Host, metric\n| make-series Value=sum(Value) on Timestamp from $__timeFrom to $__timeTo step $__timeInterval by Host\n| extend stats=series_stats_dynamic(Value)\n| order by toreal(stats.max) desc\n| limit 10\n| project Host, Timestamp, Value", + "querySource": "raw", + "queryType": "KQL", + "rawMode": true, + "refId": "A", + "resultFormat": "time_series_adx_series" + } + ], + "title": "Top WAL Segments Count", + "type": "timeseries" + }, + { + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "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 + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "normal" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 24 + }, + "hideTimeOverride": true, + "id": 18, + "interval": "1m", + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "database": "$Database", + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "expression": { + "groupBy": { + "expressions": [], + "type": "and" + }, + "reduce": { + "expressions": [], + "type": "and" + }, + "where": { + "expressions": [], + "type": "and" + } + }, + "hide": false, + "pluginVersion": "4.4.1", + "query": "AdxmonIngestorTableCardinalityCount\n| where $__timeFilter(Timestamp)\n| extend table = tostring(Labels.table)\n| make-series Value=avg(Value) default = 0 on Timestamp from $__timeFrom to $__timeTo step $__timeInterval by table\n| extend stats=series_stats_dynamic(Value)\n| order by toint(stats.max) desc\n| project Timestamp, table, Value\n| limit 10 \n| extend Value=series_fill_forward(Value, 0)\n", + "querySource": "raw", + "queryType": "KQL", + "rawMode": true, + "refId": "A", + "resultFormat": "time_series_adx_series" + } + ], + "timeShift": "1m", + "title": "Top Active Series", + "type": "timeseries" + }, + { + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "axisSoftMin": 0, + "barAlignment": -1, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 0, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 32 + }, + "id": 25, + "interval": "1m", + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "database": "Metrics", + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "expression": { + "from": { + "property": { + "name": "AdxmonIngestorRequestsReceivedTotal", + "type": "string" + }, + "type": "property" + }, + "groupBy": { + "expressions": [], + "type": "and" + }, + "reduce": { + "expressions": [], + "type": "and" + }, + "where": { + "expressions": [ + { + "expressions": [ + { + "operator": { + "name": "==", + "value": "" + }, + "property": { + "name": "UnderlayName", + "type": "string" + }, + "type": "operator" + } + ], + "type": "or" + } + ], + "type": "and" + } + }, + "pluginVersion": "4.4.1", + "query": "AdxmonIngestorWalSegmentsSizeBytes\n| where $__timeFilter(Timestamp)\n| where Cluster == \"$Cluster\"\n| where Container == \"ingestor\"\n| extend metric=tostring(Labels.metric)\n| summarize hint.shufflekey=Host Value=avg(Value) by bin(Timestamp, $__timeInterval), metric, Host\n| make-series Value=sum(Value) default = 0 on Timestamp from $__timeFrom to $__timeTo step $__timeInterval by Host\n| extend stats=series_stats_dynamic(Value)\n| order by toreal(stats.max) desc\n| limit 10\n| project Host, Timestamp, Value\n\n", + "querySource": "raw", + "queryType": "KQL", + "rawMode": true, + "refId": "A", + "resultFormat": "time_series_adx_series" + } + ], + "title": "Top WAL Segments Disk Usage", + "type": "timeseries" + }, + { + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "axisSoftMin": 0, + "barAlignment": -1, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 0, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "dashed" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 10000 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 32 + }, + "id": 26, + "interval": "1m", + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "database": "Metrics", + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "expression": { + "from": { + "property": { + "name": "AdxmonIngestorRequestsReceivedTotal", + "type": "string" + }, + "type": "property" + }, + "groupBy": { + "expressions": [], + "type": "and" + }, + "reduce": { + "expressions": [], + "type": "and" + }, + "where": { + "expressions": [ + { + "expressions": [ + { + "operator": { + "name": "==", + "value": "" + }, + "property": { + "name": "UnderlayName", + "type": "string" + }, + "type": "operator" + } + ], + "type": "or" + } + ], + "type": "and" + } + }, + "pluginVersion": "4.4.1", + "query": "AdxmonIngestorQueueSize\n| where $__timeFilter(Timestamp)\n| where Cluster == \"$Cluster\"\n| where Container == \"ingestor\"\n| extend queue=tostring(Labels.queue)\n| where queue == \"upload\"\n| make-series Value=sum(Value) default = 0 on Timestamp from $__timeFrom to $__timeTo step $__timeInterval by queue, Host\n| extend stats=series_stats_dynamic(Value)\n| order by toreal(stats.max) desc\n| limit 10\n| project queue, Host, Timestamp, Value\n\n", + "querySource": "raw", + "queryType": "KQL", + "rawMode": true, + "refId": "A", + "resultFormat": "time_series_adx_series" + } + ], + "title": "Upload Queue Size", + "type": "timeseries" + }, + { + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "axisSoftMin": 0, + "barAlignment": -1, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 0, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "dashed" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "light-yellow", + "value": 5000 + }, + { + "color": "semi-dark-red", + "value": 10000 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 40 + }, + "id": 27, + "interval": "1m", + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "database": "Metrics", + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "expression": { + "from": { + "property": { + "name": "AdxmonIngestorRequestsReceivedTotal", + "type": "string" + }, + "type": "property" + }, + "groupBy": { + "expressions": [], + "type": "and" + }, + "reduce": { + "expressions": [], + "type": "and" + }, + "where": { + "expressions": [ + { + "expressions": [ + { + "operator": { + "name": "==", + "value": "" + }, + "property": { + "name": "UnderlayName", + "type": "string" + }, + "type": "operator" + } + ], + "type": "or" + } + ], + "type": "and" + } + }, + "pluginVersion": "4.4.1", + "query": "AdxmonIngestorQueueSize\n| where $__timeFilter(Timestamp)\n| where Cluster == \"$Cluster\"\n| where Container == \"ingestor\"\n| extend queue=tostring(Labels.queue)\n| where queue == \"transfer\"\n| make-series Value=sum(Value) default = 0 on Timestamp from $__timeFrom to $__timeTo step $__timeInterval by queue, Host\n| extend stats=series_stats_dynamic(Value)\n| order by toreal(stats.max) desc\n| limit 10\n| project queue, Host, Timestamp, Value\n\n", + "querySource": "raw", + "queryType": "KQL", + "rawMode": true, + "refId": "A", + "resultFormat": "time_series_adx_series" + } + ], + "title": "Transfer Queue Size", + "type": "timeseries" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 48 + }, + "id": 34, + "panels": [], + "title": "Resource Usage", + "type": "row" + }, + { + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "fieldConfig": { + "defaults": { + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "scaleDistribution": { + "type": "linear" + } + } + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 12, + "x": 0, + "y": 49 + }, + "id": 30, + "interval": "1m", + "options": { + "calculate": false, + "calculation": { + "xBuckets": { + "mode": "count", + "value": "" + } + }, + "cellGap": 1, + "color": { + "exponent": 0.5, + "fill": "dark-orange", + "mode": "scheme", + "reverse": false, + "scale": "exponential", + "scheme": "Oranges", + "steps": 64 + }, + "exemplars": { + "color": "rgba(255,0,255,0.7)" + }, + "filterValues": { + "le": 1e-9 + }, + "legend": { + "show": true + }, + "rowsFrame": { + "layout": "auto" + }, + "tooltip": { + "mode": "single", + "showColorScale": false, + "yHistogram": false + }, + "yAxis": { + "axisPlacement": "left", + "reverse": false + } + }, + "pluginVersion": "10.4.11", + "targets": [ + { + "OpenAI": false, + "database": "Metrics", + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "expression": { + "groupBy": { + "expressions": [], + "type": "and" + }, + "reduce": { + "expressions": [], + "type": "and" + }, + "where": { + "expressions": [], + "type": "and" + } + }, + "pluginVersion": "5.0.5", + "query": "let buckets=50;\nlet binSize=toscalar(ContainerCpuUsageSecondsTotal\n| where $__timeFilter(Timestamp)\n| where Cluster==\"$Cluster\"\n| where Labels.cpu==\"total\"\n| where Labels.namespace == \"adx-mon\"\n| extend Namespace=tostring(Labels.namespace)\n| extend Pod=tostring(Labels.pod)\n| extend Container=tostring(Labels.container)\n| where Container == \"ingestor\"\n| invoke prom_delta()\n| summarize Value=(max(Value)/60) by bin(Timestamp, 60000ms), Namespace, Pod\n| summarize min(Value), max(Value), avg(Value)\n| extend Diff=(max_Value - min_Value) / buckets\n| project Diff);\nContainerCpuUsageSecondsTotal\n| where $__timeFilter(Timestamp)\n| where Cluster==\"$Cluster\"\n| where Labels.cpu==\"total\"\n| where Labels.namespace == \"adx-mon\"\n| extend Namespace=tostring(Labels.namespace)\n| extend Pod=tostring(Labels.pod)\n| extend Container=tostring(Labels.container)\n| where Container == \"ingestor\"\n| invoke prom_rate()\n| summarize Value=round(avg(Value)+0.0005,3) by bin(Timestamp, 60000ms), Pod\n| summarize Value=count() by Timestamp, Bin=round(bin(Value, toreal(binSize)), 3)\n| order by Timestamp asc\n| project Timestamp, tostring(Bin), Value\n", + "querySource": "raw", + "queryType": "KQL", + "rawMode": true, + "refId": "A", + "resultFormat": "time_series" + } + ], + "title": "Ingestor CPU Usage (Cores)", + "type": "heatmap" + }, + { + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "cdw20raltkz5sd" + }, + "fieldConfig": { + "defaults": { + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "scaleDistribution": { + "type": "linear" + } + } + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 12, + "x": 12, + "y": 49 + }, + "id": 31, + "interval": "1m", + "maxPerRow": 2, + "options": { + "calculate": false, + "cellGap": 1, + "color": { + "exponent": 0.5, + "fill": "dark-orange", + "mode": "scheme", + "reverse": false, + "scale": "exponential", + "scheme": "RdYlGn", + "steps": 64 + }, + "exemplars": { + "color": "rgba(255,0,255,0.7)" + }, + "filterValues": { + "le": 1e-9 + }, + "legend": { + "show": true + }, + "rowsFrame": { + "layout": "auto" + }, + "tooltip": { + "mode": "single", + "showColorScale": false, + "yHistogram": false + }, + "yAxis": { + "axisPlacement": "left", + "reverse": false, + "unit": "decbytes" + } + }, + "pluginVersion": "10.4.11", + "repeat": "Namespace", + "repeatDirection": "v", + "targets": [ + { + "OpenAI": false, + "database": "Metrics", + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "cdw20raltkz5sd" + }, + "expression": { + "groupBy": { + "expressions": [], + "type": "and" + }, + "reduce": { + "expressions": [], + "type": "and" + }, + "where": { + "expressions": [], + "type": "and" + } + }, + "pluginVersion": "5.0.3", + "query": "ContainerMemoryWorkingSetBytes\n| where $__timeFilter(Timestamp)\n| where Cluster==\"$Cluster\"\n| extend Namespace=tostring(Labels.namespace)\n| extend Pod=tostring(Labels.pod)\n| extend Container=tostring(Labels.container)\n| where Namespace == \"adx-mon\"\n| where Container == \"ingestor\"\n| extend Value=Value\n| summarize Value=avg(Value) by bin(Timestamp, 60000ms), Namespace, Pod\n| summarize Value=count() by Timestamp, Bin=bin(Value, 5e6), Namespace\n| project Timestamp, tostring(Bin), Value\n| order by Timestamp asc\n", + "querySource": "raw", + "queryType": "KQL", + "rawMode": true, + "refId": "WorkingSet", + "resultFormat": "time_series" + } + ], + "title": "Ingestor Mem Usage", + "type": "heatmap" + }, + { + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "cdw20raltkz5sd" + }, + "fieldConfig": { + "defaults": { + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "scaleDistribution": { + "type": "linear" + } + } + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 12, + "x": 0, + "y": 58 + }, + "id": 35, + "interval": "1m", + "options": { + "calculate": false, + "calculation": { + "xBuckets": { + "mode": "count", + "value": "" + } + }, + "cellGap": 1, + "color": { + "exponent": 0.5, + "fill": "dark-orange", + "mode": "scheme", + "reverse": false, + "scale": "exponential", + "scheme": "Oranges", + "steps": 128 + }, + "exemplars": { + "color": "rgba(255,0,255,0.7)" + }, + "filterValues": { + "le": 1e-9 + }, + "legend": { + "show": true + }, + "rowsFrame": { + "layout": "auto" + }, + "tooltip": { + "mode": "single", + "showColorScale": false, + "yHistogram": false + }, + "yAxis": { + "axisPlacement": "left", + "reverse": false + } + }, + "pluginVersion": "10.4.11", + "targets": [ + { + "OpenAI": false, + "database": "Metrics", + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "cdw20raltkz5sd" + }, + "expression": { + "groupBy": { + "expressions": [], + "type": "and" + }, + "reduce": { + "expressions": [], + "type": "and" + }, + "where": { + "expressions": [], + "type": "and" + } + }, + "pluginVersion": "5.0.3", + "query": "let buckets=50;\nlet binSize=toscalar(ContainerCpuUsageSecondsTotal\n| where $__timeFilter(Timestamp)\n| where Cluster==\"$Cluster\"\n| where Labels.cpu==\"total\"\n| where Labels.namespace == \"adx-mon\"\n| extend Namespace=tostring(Labels.namespace)\n| extend Pod=tostring(Labels.pod)\n| extend Container=tostring(Labels.container)\n| where Container == \"collector\"\n| invoke prom_delta()\n| summarize Value=(max(Value)/60) by bin(Timestamp, 60000ms), Namespace, Pod\n| summarize min(Value), max(Value), avg(Value)\n| extend Diff=(max_Value - min_Value) / buckets\n| project Diff);\nContainerCpuUsageSecondsTotal\n| where $__timeFilter(Timestamp)\n| where Cluster==\"$Cluster\"\n| where Labels.cpu==\"total\"\n| where Labels.namespace == \"adx-mon\"\n| extend Namespace=tostring(Labels.namespace)\n| extend Pod=tostring(Labels.pod)\n| extend Container=tostring(Labels.container)\n| where Container == \"collector\"\n| invoke prom_rate()\n| summarize Value=round(avg(Value)+0.0005,3) by bin(Timestamp, 60000ms), Pod\n| summarize Value=count() by Timestamp, Bin=round(bin(Value, toreal(binSize)), 3)\n| order by Timestamp asc\n| project Timestamp, tostring(Bin), Value\n", + "querySource": "raw", + "queryType": "KQL", + "rawMode": true, + "refId": "Usage", + "resultFormat": "time_series" + } + ], + "title": "Collector CPU Usage (Cores)", + "type": "heatmap" + }, + { + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "cdw20raltkz5sd" + }, + "fieldConfig": { + "defaults": { + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "scaleDistribution": { + "type": "linear" + } + }, + "fieldMinMax": false + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 12, + "x": 12, + "y": 58 + }, + "id": 33, + "interval": "1m", + "maxPerRow": 2, + "options": { + "calculate": false, + "cellGap": 1, + "color": { + "exponent": 1, + "fill": "light-yellow", + "mode": "scheme", + "reverse": false, + "scale": "exponential", + "scheme": "RdYlGn", + "steps": 128 + }, + "exemplars": { + "color": "rgba(255,0,255,0.7)" + }, + "filterValues": { + "le": 1e-9 + }, + "legend": { + "show": true + }, + "rowsFrame": { + "layout": "auto" + }, + "tooltip": { + "mode": "single", + "showColorScale": false, + "yHistogram": true + }, + "yAxis": { + "axisPlacement": "left", + "reverse": false, + "unit": "decbytes" + } + }, + "pluginVersion": "10.4.11", + "repeatDirection": "v", + "targets": [ + { + "OpenAI": false, + "database": "Metrics", + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "cdw20raltkz5sd" + }, + "expression": { + "groupBy": { + "expressions": [], + "type": "and" + }, + "reduce": { + "expressions": [], + "type": "and" + }, + "where": { + "expressions": [], + "type": "and" + } + }, + "pluginVersion": "5.0.3", + "query": "ContainerMemoryWorkingSetBytes\n| where $__timeFilter(Timestamp)\n| where Labels !has \"id\"\n| where Cluster==\"$Cluster\"\n| extend Namespace=tostring(Labels.namespace)\n| extend Pod=tostring(Labels.pod)\n| extend Container=tostring(Labels.container)\n| where Namespace == \"adx-mon\"\n| where Container == \"collector\"\n| extend Value=Value\n| summarize Value=avg(Value) by bin(Timestamp, 60000ms), Namespace, Pod\n| summarize Value=count() by Timestamp, Bin=bin(Value, 1e7), Namespace\n| project Timestamp, tostring(Bin), Value\n| order by Timestamp asc\n", + "querySource": "raw", + "queryType": "KQL", + "rawMode": true, + "refId": "WorkingSet", + "resultFormat": "time_series" + } + ], + "title": "Collector Mem Usage", + "type": "heatmap" + } + ], + "refresh": "", + "revision": 1, + "schemaVersion": 39, + "tags": [], + "templating": { + "list": [ + { + "current": { + "selected": true, + "text": "ccp-adx-kusto", + "value": "be58o1fh7iznka" + }, + "hide": 0, + "includeAll": false, + "multi": false, + "name": "Datasource", + "options": [], + "query": "grafana-azure-data-explorer-datasource", + "queryValue": "", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "type": "datasource" + }, + { + "current": { + "selected": false, + "text": "Metrics", + "value": "Metrics" + }, + "hide": 0, + "includeAll": false, + "label": "Database", + "multi": false, + "name": "Database", + "options": [ + { + "selected": true, + "text": "Metrics", + "value": "Metrics" + } + ], + "query": "Metrics", + "queryValue": "", + "skipUrlSync": false, + "type": "custom" + }, + { + "current": { + "selected": false, + "text": "ccp-adx-aks-9", + "value": "ccp-adx-aks-9" + }, + "datasource": { + "type": "grafana-azure-data-explorer-datasource", + "uid": "${Datasource:text}" + }, + "definition": "ContainerCpuUsageSecondsTotal | where $__timeFilter(Timestamp) | extend Cluster=tostring(Labels.cluster) | distinct Cluster", + "hide": 0, + "includeAll": false, + "multi": false, + "name": "Cluster", + "options": [], + "query": { + "OpenAI": false, + "clusterUri": "", + "database": "Metrics", + "expression": { + "groupBy": { + "expressions": [], + "type": "and" + }, + "reduce": { + "expressions": [], + "type": "and" + }, + "where": { + "expressions": [], + "type": "and" + } + }, + "pluginVersion": "5.0.5", + "query": "ContainerCpuUsageSecondsTotal | where $__timeFilter(Timestamp) | extend Cluster=tostring(Labels.cluster) | distinct Cluster", + "querySource": "raw", + "queryType": "KQL", + "rawMode": true, + "resultFormat": "table" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + } + ] + }, + "time": { + "from": "now-6h", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "Metrics Stats", + "weekStart": "" +} \ No newline at end of file diff --git a/build/k8s/setup.sh b/build/k8s/setup.sh old mode 100644 new mode 100755 index 6c08013c..51cb8cdd --- a/build/k8s/setup.sh +++ b/build/k8s/setup.sh @@ -23,12 +23,14 @@ if [[ "$CURRENT_DATE" > "$TOKEN_EXPIRY" ]]; then fi for EXT in resource-graph kusto; do - read -p "The '$ext' extension is not installed. Do you want to install it now? (y/n) " INSTALL_EXT - if [[ "$INSTALL_EXT" == "y" ]]; then - az extension add --name "$EXT" - else - echo "The '$EXT' extension is required. Exiting." - exit 1 + if ! az extension show --name $EXT &> /dev/null; then + read -p "The '$ext' extension is not installed. Do you want to install it now? (y/n) " INSTALL_EXT + if [[ "$INSTALL_EXT" == "y" ]]; then + az extension add --name "$EXT" + else + echo "The '$EXT' extension is required. Exiting." + exit 1 + fi fi done @@ -131,7 +133,60 @@ envsubst < $SCRIPT_DIR/ingestor.yaml | kubectl apply -f - envsubst < $SCRIPT_DIR/collector.yaml | kubectl apply -f - kubectl apply -f $SCRIPT_DIR/ksm.yaml +echo +read -p "Do you want to setup an Azure Managed Grafana instance to visualize the AKS telemetry? (y/n) " CONFIRM +if [[ "$CONFIRM" == "y" ]]; then + if ! az extension show --name amg &> /dev/null; then + read -p "The 'amg' extension is not installed. Do you want to install it now? (y/n) " INSTALL_EXT + if [[ "$INSTALL_EXT" == "y" ]]; then + az extension add --name "amg" + else + echo "The 'amg' extension is required to setup grafana. Exiting." + exit 1 + fi + fi + + read -p "Please enter a name for the Azure Managed Grafana instance: " GRAFANA + while [[ -z "${GRAFANA// }" ]]; do + echo "Instance name cannot be empty. Please enter the name:" + read GRAFANA + done + + GRAFANA_EXISTS=$(az grafana show --name "$GRAFANA" --resource-group "$RESOURCE_GROUP" --query "name" -o json 2>/dev/null || echo "") + if [[ -z "$GRAFANA_EXISTS" ]]; then + # Create Azure Managed Grafana + echo "The $GRAFANA instance does not exist. Creating it in $RESOURCE_GROUP resource group." + az grafana create --name "$GRAFANA" --resource-group "$RESOURCE_GROUP" + else + echo "The $GRAFANA instance already exists in $RESOURCE_GROUP resource group." + fi + + # Grant the grafana MSI as a reader/viewer on the kusto cluster + GRAFANA_IDENTITY=$(az grafana show -n "$GRAFANA" -g "$RESOURCE_GROUP" --query identity.principalId -o json | jq -r .) + az kusto database add-principal --cluster-name $CLUSTER_NAME --resource-group $RESOURCE_GROUP --database-name Metrics --value role=Viewer name=AzureManagedGrafana type=app app-id=$GRAFANA_IDENTITY + + echo "Adding Kusto $CLUSTER_NAME as data source to grafana" + # Add the kusto cluster as a datasource in grafana + az grafana data-source create -n "$GRAFANA" --definition '{"name": "'$CLUSTER_NAME'","type": "grafana-azure-data-explorer-datasource","access": "proxy","jsonData": {"clusterUrl": "'$ADX_URL'"}}' + + GRAFANA_ENDPOINT=$(az grafana show --name "$GRAFANA" --resource-group "$RESOURCE_GROUP" --query=properties.endpoint -o json 2>/dev/null | jq -r) + + # Import Grafana dashboards if the user wants + read -p "Do you want to import pre-built dashboards in this Grafana instance? (y/n) " IMPORT_DASHBOARDS + if [[ "$IMPORT_DASHBOARDS" == "y" ]]; then + for DASHBOARD in cluster-info api-server; do + az grafana dashboard create -n "$GRAFANA" --resource-group "$RESOURCE_GROUP" --definition @"dashboards/$DASHBOARD.json" + done + else + echo "No dashboards will be imported." + fi +fi + echo echo -e "\e[97mSuccessfully deployed ADX-Mon components to AKS cluster $CLUSTER.\e[0m" echo echo "Collected telemetry can be found the $DATABASE_NAME database at $ADX_FQDN." +if [ ! -z "$GRAFANA_ENDPOINT" ]; then + echo + echo "Azure Managed Grafana instance can be accessed at $GRAFANA_ENDPOINT." +fi \ No newline at end of file