{ "__inputs": [], "__elements": [], "__requires": [ { "type": "grafana", "id": "grafana", "name": "Grafana", "version": "8.4.3" }, { "type": "datasource", "id": "grafana-azure-monitor-datasource", "name": "Azure Monitor", "version": "0.3.0" }, { "type": "panel", "id": "stat", "name": "Stat", "version": "" }, { "type": "panel", "id": "table", "name": "Table", "version": "" } ], "description": "A summary of all alerts for the subscription and other filters selected", "editable": true, "id": null, "links": [], "liveNow": false, "panels": [ { "datasource": { "type": "grafana-azure-monitor-datasource", "uid": "${ds}" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] } }, "overrides": [ { "matcher": { "id": "byName", "options": "Total Alerts" }, "properties": [ { "id": "links", "value": [ { "targetBlank": false, "title": "", "url": "d/dyzn5SK7z/azure-alert-consumption?${ds:queryparam}&${sub:queryparam}&${rg:queryparam}&${__url_time_range}&var-mc=Fired&var-mc=Resolved&var-as=New&var-as=Acknowledged&var-as=Closed&var-sev=Sev0&var-sev=Sev1&var-sev=Sev2&var-sev=Sev3&var-sev=Sev4&${__url_time_range}" } ] } ] } ] }, "gridPos": { "h": 4, "w": 2, "x": 0, "y": 0 }, "id": 4, "options": { "colorMode": "background", "graphMode": "area", "justifyMode": "center", "orientation": "auto", "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": true }, "textMode": "value_and_name" }, "targets": [ { "azureMonitor": { "dimensionFilters": [], "timeGrain": "auto" }, "azureResourceGraph": { "query": "alertsmanagementresources\r\n| where type == \"microsoft.alertsmanagement/alerts\"\r\n| where todatetime(properties.essentials.lastModifiedDateTime) >= $__timeFrom and todatetime(properties.essentials.lastModifiedDateTime) <= $__timeTo\r\n| where tolower(subscriptionId) == tolower(\"$sub\") and properties.essentials.targetResourceGroup in~ ($rg) and properties.essentials.monitorCondition in~ ($mc)\r\nand properties.essentials.alertState in~ ($as) and properties.essentials.severity in~ ($sev)\r\n| summarize count()" }, "datasource": { "type": "grafana-azure-monitor-datasource", "uid": "${ds}" }, "queryType": "Azure Resource Graph", "refId": "A", "subscription": "", "subscriptions": ["$sub"] } ], "transformations": [ { "id": "organize", "options": { "excludeByName": {}, "indexByName": {}, "renameByName": { "count_": "Total Alerts" } } } ], "type": "stat" }, { "datasource": { "type": "grafana-azure-monitor-datasource", "uid": "${ds}" }, "fieldConfig": { "defaults": { "color": { "fixedColor": "red", "mode": "fixed" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] } }, "overrides": [ { "matcher": { "id": "byName", "options": "Critical" }, "properties": [ { "id": "links", "value": [ { "targetBlank": false, "title": "", "url": "d/dyzn5SK7z/azure-alert-consumption?${ds:queryparam}&${sub:queryparam}&${rg:queryparam}&${__url_time_range}&var-mc=Fired&var-mc=Resolved&var-as=New&var-as=Acknowledged&var-as=Closed&var-sev=Sev0&${__url_time_range}" } ] } ] } ] }, "gridPos": { "h": 4, "w": 2, "x": 2, "y": 0 }, "id": 15, "options": { "colorMode": "background", "graphMode": "area", "justifyMode": "center", "orientation": "auto", "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": true }, "textMode": "value_and_name" }, "targets": [ { "azureMonitor": { "dimensionFilters": [], "timeGrain": "auto" }, "azureResourceGraph": { "query": "alertsmanagementresources\r\n| where type == \"microsoft.alertsmanagement/alerts\"\r\n| where todatetime(properties.essentials.lastModifiedDateTime) >= $__timeFrom and todatetime(properties.essentials.lastModifiedDateTime) <= $__timeTo\r\n| where tolower(subscriptionId) == tolower(\"$sub\") and properties.essentials.targetResourceGroup in~ ($rg) and properties.essentials.monitorCondition in~ ($mc)\r\nand properties.essentials.alertState in~ ($as) and properties.essentials.severity in~ ($sev) and properties.essentials.severity == \"Sev0\" \r\n| summarize count()" }, "datasource": { "type": "grafana-azure-monitor-datasource", "uid": "${ds}" }, "queryType": "Azure Resource Graph", "refId": "A", "subscription": "", "subscriptions": ["$sub"] } ], "transformations": [ { "id": "organize", "options": { "excludeByName": {}, "indexByName": {}, "renameByName": { "count_": "Critical" } } } ], "type": "stat" }, { "datasource": { "type": "grafana-azure-monitor-datasource", "uid": "${ds}" }, "fieldConfig": { "defaults": { "color": { "fixedColor": "orange", "mode": "fixed" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] } }, "overrides": [ { "matcher": { "id": "byName", "options": "Error" }, "properties": [ { "id": "links", "value": [ { "targetBlank": false, "title": "", "url": "d/dyzn5SK7z/azure-alert-consumption?${ds:queryparam}&${sub:queryparam}&${rg:queryparam}&${__url_time_range}&var-mc=Fired&var-mc=Resolved&var-as=New&var-as=Acknowledged&var-as=Closed&var-sev=Sev1&${__url_time_range}" } ] } ] } ] }, "gridPos": { "h": 4, "w": 2, "x": 4, "y": 0 }, "id": 8, "options": { "colorMode": "background", "graphMode": "area", "justifyMode": "center", "orientation": "auto", "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": true }, "textMode": "value_and_name" }, "targets": [ { "azureMonitor": { "dimensionFilters": [], "timeGrain": "auto" }, "azureResourceGraph": { "query": "alertsmanagementresources\r\n| where type == \"microsoft.alertsmanagement/alerts\"\r\n| where todatetime(properties.essentials.lastModifiedDateTime) >= $__timeFrom and todatetime(properties.essentials.lastModifiedDateTime) <= $__timeTo\r\n| where tolower(subscriptionId) == tolower(\"$sub\") and properties.essentials.targetResourceGroup in~ ($rg) and properties.essentials.monitorCondition in~ ($mc)\r\nand properties.essentials.alertState in~ ($as) and properties.essentials.severity in~ ($sev) and properties.essentials.severity == \"Sev1\" \r\n| summarize count()" }, "datasource": { "type": "grafana-azure-monitor-datasource", "uid": "${ds}" }, "queryType": "Azure Resource Graph", "refId": "A", "subscription": "", "subscriptions": ["$sub"] } ], "transformations": [ { "id": "organize", "options": { "excludeByName": {}, "indexByName": {}, "renameByName": { "count_": "Error" } } } ], "type": "stat" }, { "datasource": { "type": "grafana-azure-monitor-datasource", "uid": "${ds}" }, "fieldConfig": { "defaults": { "color": { "fixedColor": "yellow", "mode": "fixed" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] } }, "overrides": [ { "matcher": { "id": "byName", "options": "Warning" }, "properties": [ { "id": "links", "value": [ { "targetBlank": false, "title": "", "url": "d/dyzn5SK7z/azure-alert-consumption?${ds:queryparam}&${sub:queryparam}&${rg:queryparam}&${__url_time_range}&var-mc=Fired&var-mc=Resolved&var-as=New&var-as=Acknowledged&var-as=Closed&var-sev=Sev2&${__url_time_range}" } ] } ] } ] }, "gridPos": { "h": 4, "w": 2, "x": 6, "y": 0 }, "id": 10, "options": { "colorMode": "background", "graphMode": "area", "justifyMode": "center", "orientation": "auto", "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": true }, "textMode": "value_and_name" }, "targets": [ { "azureMonitor": { "dimensionFilters": [], "timeGrain": "auto" }, "azureResourceGraph": { "query": "alertsmanagementresources\r\n| where type == \"microsoft.alertsmanagement/alerts\"\r\n| where todatetime(properties.essentials.lastModifiedDateTime) >= $__timeFrom and todatetime(properties.essentials.lastModifiedDateTime) <= $__timeTo\r\n| where tolower(subscriptionId) == tolower(\"$sub\") and properties.essentials.targetResourceGroup in~ ($rg) and properties.essentials.monitorCondition in~ ($mc)\r\nand properties.essentials.alertState in~ ($as) and properties.essentials.severity in~ ($sev) and properties.essentials.severity == \"Sev2\" \r\n| summarize count()" }, "datasource": { "type": "grafana-azure-monitor-datasource", "uid": "${ds}" }, "queryType": "Azure Resource Graph", "refId": "A", "subscription": "", "subscriptions": ["$sub"] } ], "transformations": [ { "id": "organize", "options": { "excludeByName": {}, "indexByName": {}, "renameByName": { "count_": "Warning" } } } ], "type": "stat" }, { "datasource": { "type": "grafana-azure-monitor-datasource", "uid": "${ds}" }, "fieldConfig": { "defaults": { "color": { "fixedColor": "blue", "mode": "fixed" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] } }, "overrides": [ { "matcher": { "id": "byName", "options": "Informational" }, "properties": [ { "id": "links", "value": [ { "targetBlank": false, "title": "", "url": "d/dyzn5SK7z/azure-alert-consumption?${ds:queryparam}&${sub:queryparam}&${rg:queryparam}&${__url_time_range}&var-mc=Fired&var-mc=Resolved&var-as=New&var-as=Acknowledged&var-as=Closed&var-sev=Sev3&${__url_time_range}" } ] } ] } ] }, "gridPos": { "h": 4, "w": 2, "x": 8, "y": 0 }, "id": 12, "options": { "colorMode": "background", "graphMode": "area", "justifyMode": "center", "orientation": "auto", "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": true }, "textMode": "value_and_name" }, "targets": [ { "azureMonitor": { "dimensionFilters": [], "timeGrain": "auto" }, "azureResourceGraph": { "query": "alertsmanagementresources\r\n| where type == \"microsoft.alertsmanagement/alerts\"\r\n| where todatetime(properties.essentials.lastModifiedDateTime) >= $__timeFrom and todatetime(properties.essentials.lastModifiedDateTime) <= $__timeTo\r\n| where tolower(subscriptionId) == tolower(\"$sub\") and properties.essentials.targetResourceGroup in~ ($rg) and properties.essentials.monitorCondition in~ ($mc)\r\nand properties.essentials.alertState in~ ($as) and properties.essentials.severity in~ ($sev) and properties.essentials.severity == \"Sev3\" \r\n| summarize count()" }, "datasource": { "type": "grafana-azure-monitor-datasource", "uid": "${ds}" }, "queryType": "Azure Resource Graph", "refId": "A", "subscription": "", "subscriptions": ["$sub"] } ], "transformations": [ { "id": "organize", "options": { "excludeByName": {}, "indexByName": {}, "renameByName": { "count_": "Informational" } } } ], "type": "stat" }, { "datasource": { "type": "grafana-azure-monitor-datasource", "uid": "${ds}" }, "fieldConfig": { "defaults": { "color": { "fixedColor": "purple", "mode": "fixed" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] } }, "overrides": [ { "matcher": { "id": "byName", "options": "Verbose" }, "properties": [ { "id": "links", "value": [ { "targetBlank": false, "title": "", "url": "d/dyzn5SK7z/azure-alert-consumption?${ds:queryparam}&${sub:queryparam}&${rg:queryparam}&${__url_time_range}&var-mc=Fired&var-mc=Resolved&var-as=New&var-as=Acknowledged&var-as=Closed&var-sev=Sev4&${__url_time_range}" } ] } ] } ] }, "gridPos": { "h": 4, "w": 2, "x": 10, "y": 0 }, "id": 14, "options": { "colorMode": "background", "graphMode": "area", "justifyMode": "center", "orientation": "auto", "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": true }, "textMode": "value_and_name" }, "targets": [ { "azureMonitor": { "dimensionFilters": [], "timeGrain": "auto" }, "azureResourceGraph": { "query": "alertsmanagementresources\r\n| where type == \"microsoft.alertsmanagement/alerts\"\r\n| where todatetime(properties.essentials.lastModifiedDateTime) >= $__timeFrom and todatetime(properties.essentials.lastModifiedDateTime) <= $__timeTo\r\n| where tolower(subscriptionId) == tolower(\"$sub\") and properties.essentials.targetResourceGroup in~ ($rg) and properties.essentials.monitorCondition in~ ($mc)\r\nand properties.essentials.alertState in~ ($as) and properties.essentials.severity in~ ($sev) and properties.essentials.severity == \"Sev4\" \r\n| summarize count()" }, "datasource": { "type": "grafana-azure-monitor-datasource", "uid": "${ds}" }, "queryType": "Azure Resource Graph", "refId": "A", "subscription": "", "subscriptions": ["$sub"] } ], "transformations": [ { "id": "organize", "options": { "excludeByName": {}, "indexByName": {}, "renameByName": { "count_": "Verbose" } } } ], "type": "stat" }, { "datasource": { "type": "grafana-azure-monitor-datasource", "uid": "${ds}" }, "fieldConfig": { "defaults": { "color": { "mode": "continuous-BlYlRd" }, "custom": { "align": "center", "displayMode": "auto", "filterable": true }, "links": [], "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80.0002 } ] } }, "overrides": [ { "matcher": { "id": "byName", "options": "Severity" }, "properties": [ { "id": "mappings", "value": [ { "options": { "\"Sev0\"": { "color": "red", "index": 4, "text": "Critical" }, "\"Sev1\"": { "color": "orange", "index": 3, "text": "Error" }, "\"Sev2\"": { "color": "yellow", "index": 2, "text": "Warning" }, "\"Sev3\"": { "color": "blue", "index": 1, "text": "Informational" }, "\"Sev4\"": { "color": "#8F3BB8", "index": 0, "text": "Verbose" } }, "type": "value" } ] }, { "id": "custom.displayMode", "value": "color-background-solid" } ] }, { "matcher": { "id": "byName", "options": "Name" }, "properties": [ { "id": "custom.displayMode", "value": "color-text" }, { "id": "links", "value": [ { "targetBlank": true, "title": "test title", "url": "https://ms.portal.azure.com/#blade/Microsoft_Azure_Monitoring/AlertDetailsTemplateBlade/alertId/%2Fsubscriptions%2F${sub}%2Fresourcegroups%2F${rg}%2Fproviders%2Fmicrosoft.insights%2Fcomponents%2F${res}%2Fproviders%2FMicrosoft.AlertsManagement%2Falerts%2F${__data.fields[\"Alert ID\"]}" } ] } ] }, { "matcher": { "id": "byName", "options": "properties_essentials_monitorCondition" }, "properties": [ { "id": "mappings", "value": [ { "options": { "Fired": { "color": "orange", "index": 1 }, "Resolved": { "color": "green", "index": 0 } }, "type": "value" } ] }, { "id": "custom.displayMode", "value": "basic" } ] } ] }, "gridPos": { "h": 16, "w": 24, "x": 0, "y": 4 }, "id": 2, "links": [], "options": { "footer": { "fields": "", "reducer": ["sum"], "show": false }, "frameIndex": 0, "showHeader": true, "sortBy": [] }, "targets": [ { "azureResourceGraph": { "query": "alertsmanagementresources\r\n| join kind=leftouter (ResourceContainers | where type=='microsoft.resources/subscriptions' | project SubName=name, subscriptionId) on subscriptionId\r\n| where type == \"microsoft.alertsmanagement/alerts\"\r\n| where tolower(subscriptionId) == tolower(\"$sub\") and properties.essentials.targetResourceGroup in~ ($rg) and properties.essentials.monitorCondition in~ ($mc)\r\nand properties.essentials.alertState in~ ($as) and properties.essentials.severity in~ ($sev)\r\nand todatetime(properties.essentials.lastModifiedDateTime) >= $__timeFrom and todatetime(properties.essentials.lastModifiedDateTime) <= $__timeTo\r\n| parse id with * \"alerts/\" alertId\r\n| project name, properties.essentials.severity, tostring(properties.essentials.monitorCondition), \r\ntostring(properties.essentials.alertState), todatetime(properties.essentials.lastModifiedDateTime), tostring(properties.essentials.monitorService), alertId\r\n", "resultFormat": "table" }, "datasource": { "type": "grafana-azure-monitor-datasource", "uid": "${ds}" }, "insightsAnalytics": { "query": "", "resultFormat": "time_series" }, "queryType": "Azure Resource Graph", "refId": "A", "subscription": "", "subscriptions": ["$sub"] } ], "title": "V1 Alerts", "transformations": [ { "id": "organize", "options": { "excludeByName": { "alertId": false }, "indexByName": { "alertId": 6, "name": 0, "properties_essentials_alertState": 3, "properties_essentials_lastModifiedDateTime": 5, "properties_essentials_monitorCondition": 2, "properties_essentials_monitorService": 4, "properties_essentials_severity": 1 }, "renameByName": { "alertId": "Alert ID", "name": "Name", "properties_essentials_alertState": "User Response", "properties_essentials_monitorService": "Monitor Service", "properties_essentials_lastModifiedDateTime": "Fired Time", "properties_essentials_monitorCondition": "Alert Condition", "properties_essentials_severity": "Severity" } } } ], "transparent": true, "type": "table" } ], "refresh": "", "schemaVersion": 35, "style": "dark", "tags": [], "templating": { "list": [ { "current": {}, "hide": 0, "includeAll": false, "label": "Datasource", "multi": false, "name": "ds", "options": [], "query": "grafana-azure-monitor-datasource", "queryValue": "", "refresh": 1, "regex": "", "skipUrlSync": false, "type": "datasource" }, { "current": {}, "datasource": { "type": "grafana-azure-monitor-datasource", "uid": "${ds}" }, "definition": "subscriptions()", "hide": 0, "includeAll": false, "label": "Subscription", "multi": false, "name": "sub", "options": [], "query": "subscriptions()", "refresh": 1, "regex": "", "skipUrlSync": false, "sort": 0, "type": "query" }, { "current": {}, "datasource": { "type": "grafana-azure-monitor-datasource", "uid": "${ds}" }, "definition": "ResourceGroups($sub)", "hide": 0, "includeAll": false, "label": "Resource Group(s)", "multi": true, "name": "rg", "options": [], "query": "ResourceGroups($sub)", "refresh": 1, "regex": "", "skipUrlSync": false, "sort": 0, "type": "query" }, { "current": { "selected": false, "text": ["Fired", "Resolved"], "value": ["Fired", "Resolved"] }, "hide": 0, "includeAll": false, "label": "Alert Condition", "multi": true, "name": "mc", "options": [ { "selected": true, "text": "Fired", "value": "Fired" }, { "selected": true, "text": "Resolved", "value": "Resolved" } ], "query": "Fired, Resolved", "queryValue": "", "skipUrlSync": false, "type": "custom" }, { "current": { "selected": false, "text": ["New", "Acknowledged", "Closed"], "value": ["New", "Acknowledged", "Closed"] }, "hide": 0, "includeAll": false, "label": "User Response", "multi": true, "name": "as", "options": [ { "selected": true, "text": "New", "value": "New" }, { "selected": true, "text": "Acknowledged", "value": "Acknowledged" }, { "selected": true, "text": "Closed", "value": "Closed" } ], "query": "New, Acknowledged, Closed", "queryValue": "", "skipUrlSync": false, "type": "custom" }, { "current": { "selected": false, "text": ["Critical", "Error", "Warning", "Informational", "Verbose"], "value": ["Sev0", "Sev1", "Sev2", "Sev3", "Sev4"] }, "hide": 0, "includeAll": false, "label": "Severity", "multi": true, "name": "sev", "options": [ { "selected": true, "text": "Critical", "value": "Sev0" }, { "selected": true, "text": "Error", "value": "Sev1" }, { "selected": true, "text": "Warning", "value": "Sev2" }, { "selected": true, "text": "Informational", "value": "Sev3" }, { "selected": true, "text": "Verbose", "value": "Sev4" } ], "query": "Critical : Sev0, Error : Sev1, Warning : Sev2, Informational : Sev3, Verbose : Sev4", "queryValue": "", "skipUrlSync": false, "type": "custom" } ] }, "time": { "from": "now-30d", "to": "now" }, "timepicker": { "hidden": false, "refresh_intervals": ["30m", "1h", "12h", "24h", "3d", "7d", "30d"] }, "title": "Azure / Alert Consumption", "uid": "dyzn5SK7z", "version": 45 }