v1Alerts.json 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011
  1. {
  2. "__inputs": [],
  3. "__elements": [],
  4. "__requires": [
  5. {
  6. "type": "grafana",
  7. "id": "grafana",
  8. "name": "Grafana",
  9. "version": "8.4.3"
  10. },
  11. {
  12. "type": "datasource",
  13. "id": "grafana-azure-monitor-datasource",
  14. "name": "Azure Monitor",
  15. "version": "0.3.0"
  16. },
  17. {
  18. "type": "panel",
  19. "id": "stat",
  20. "name": "Stat",
  21. "version": ""
  22. },
  23. {
  24. "type": "panel",
  25. "id": "table",
  26. "name": "Table",
  27. "version": ""
  28. }
  29. ],
  30. "description": "A summary of all alerts for the subscription and other filters selected",
  31. "editable": true,
  32. "id": null,
  33. "links": [],
  34. "liveNow": false,
  35. "panels": [
  36. {
  37. "datasource": {
  38. "type": "grafana-azure-monitor-datasource",
  39. "uid": "${ds}"
  40. },
  41. "fieldConfig": {
  42. "defaults": {
  43. "color": {
  44. "mode": "thresholds"
  45. },
  46. "mappings": [],
  47. "thresholds": {
  48. "mode": "absolute",
  49. "steps": [
  50. {
  51. "color": "green",
  52. "value": null
  53. },
  54. {
  55. "color": "red",
  56. "value": 80
  57. }
  58. ]
  59. }
  60. },
  61. "overrides": [
  62. {
  63. "matcher": {
  64. "id": "byName",
  65. "options": "Total Alerts"
  66. },
  67. "properties": [
  68. {
  69. "id": "links",
  70. "value": [
  71. {
  72. "targetBlank": false,
  73. "title": "",
  74. "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}"
  75. }
  76. ]
  77. }
  78. ]
  79. }
  80. ]
  81. },
  82. "gridPos": {
  83. "h": 4,
  84. "w": 2,
  85. "x": 0,
  86. "y": 0
  87. },
  88. "id": 4,
  89. "options": {
  90. "colorMode": "background",
  91. "graphMode": "area",
  92. "justifyMode": "center",
  93. "orientation": "auto",
  94. "reduceOptions": {
  95. "calcs": ["lastNotNull"],
  96. "fields": "",
  97. "values": true
  98. },
  99. "textMode": "value_and_name"
  100. },
  101. "targets": [
  102. {
  103. "azureMonitor": {
  104. "dimensionFilters": [],
  105. "timeGrain": "auto"
  106. },
  107. "azureResourceGraph": {
  108. "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()"
  109. },
  110. "datasource": {
  111. "type": "grafana-azure-monitor-datasource",
  112. "uid": "${ds}"
  113. },
  114. "queryType": "Azure Resource Graph",
  115. "refId": "A",
  116. "subscription": "",
  117. "subscriptions": ["$sub"]
  118. }
  119. ],
  120. "transformations": [
  121. {
  122. "id": "organize",
  123. "options": {
  124. "excludeByName": {},
  125. "indexByName": {},
  126. "renameByName": {
  127. "count_": "Total Alerts"
  128. }
  129. }
  130. }
  131. ],
  132. "type": "stat"
  133. },
  134. {
  135. "datasource": {
  136. "type": "grafana-azure-monitor-datasource",
  137. "uid": "${ds}"
  138. },
  139. "fieldConfig": {
  140. "defaults": {
  141. "color": {
  142. "fixedColor": "red",
  143. "mode": "fixed"
  144. },
  145. "mappings": [],
  146. "thresholds": {
  147. "mode": "absolute",
  148. "steps": [
  149. {
  150. "color": "green",
  151. "value": null
  152. },
  153. {
  154. "color": "red",
  155. "value": 80
  156. }
  157. ]
  158. }
  159. },
  160. "overrides": [
  161. {
  162. "matcher": {
  163. "id": "byName",
  164. "options": "Critical"
  165. },
  166. "properties": [
  167. {
  168. "id": "links",
  169. "value": [
  170. {
  171. "targetBlank": false,
  172. "title": "",
  173. "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}"
  174. }
  175. ]
  176. }
  177. ]
  178. }
  179. ]
  180. },
  181. "gridPos": {
  182. "h": 4,
  183. "w": 2,
  184. "x": 2,
  185. "y": 0
  186. },
  187. "id": 15,
  188. "options": {
  189. "colorMode": "background",
  190. "graphMode": "area",
  191. "justifyMode": "center",
  192. "orientation": "auto",
  193. "reduceOptions": {
  194. "calcs": ["lastNotNull"],
  195. "fields": "",
  196. "values": true
  197. },
  198. "textMode": "value_and_name"
  199. },
  200. "targets": [
  201. {
  202. "azureMonitor": {
  203. "dimensionFilters": [],
  204. "timeGrain": "auto"
  205. },
  206. "azureResourceGraph": {
  207. "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()"
  208. },
  209. "datasource": {
  210. "type": "grafana-azure-monitor-datasource",
  211. "uid": "${ds}"
  212. },
  213. "queryType": "Azure Resource Graph",
  214. "refId": "A",
  215. "subscription": "",
  216. "subscriptions": ["$sub"]
  217. }
  218. ],
  219. "transformations": [
  220. {
  221. "id": "organize",
  222. "options": {
  223. "excludeByName": {},
  224. "indexByName": {},
  225. "renameByName": {
  226. "count_": "Critical"
  227. }
  228. }
  229. }
  230. ],
  231. "type": "stat"
  232. },
  233. {
  234. "datasource": {
  235. "type": "grafana-azure-monitor-datasource",
  236. "uid": "${ds}"
  237. },
  238. "fieldConfig": {
  239. "defaults": {
  240. "color": {
  241. "fixedColor": "orange",
  242. "mode": "fixed"
  243. },
  244. "mappings": [],
  245. "thresholds": {
  246. "mode": "absolute",
  247. "steps": [
  248. {
  249. "color": "green",
  250. "value": null
  251. },
  252. {
  253. "color": "red",
  254. "value": 80
  255. }
  256. ]
  257. }
  258. },
  259. "overrides": [
  260. {
  261. "matcher": {
  262. "id": "byName",
  263. "options": "Error"
  264. },
  265. "properties": [
  266. {
  267. "id": "links",
  268. "value": [
  269. {
  270. "targetBlank": false,
  271. "title": "",
  272. "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}"
  273. }
  274. ]
  275. }
  276. ]
  277. }
  278. ]
  279. },
  280. "gridPos": {
  281. "h": 4,
  282. "w": 2,
  283. "x": 4,
  284. "y": 0
  285. },
  286. "id": 8,
  287. "options": {
  288. "colorMode": "background",
  289. "graphMode": "area",
  290. "justifyMode": "center",
  291. "orientation": "auto",
  292. "reduceOptions": {
  293. "calcs": ["lastNotNull"],
  294. "fields": "",
  295. "values": true
  296. },
  297. "textMode": "value_and_name"
  298. },
  299. "targets": [
  300. {
  301. "azureMonitor": {
  302. "dimensionFilters": [],
  303. "timeGrain": "auto"
  304. },
  305. "azureResourceGraph": {
  306. "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()"
  307. },
  308. "datasource": {
  309. "type": "grafana-azure-monitor-datasource",
  310. "uid": "${ds}"
  311. },
  312. "queryType": "Azure Resource Graph",
  313. "refId": "A",
  314. "subscription": "",
  315. "subscriptions": ["$sub"]
  316. }
  317. ],
  318. "transformations": [
  319. {
  320. "id": "organize",
  321. "options": {
  322. "excludeByName": {},
  323. "indexByName": {},
  324. "renameByName": {
  325. "count_": "Error"
  326. }
  327. }
  328. }
  329. ],
  330. "type": "stat"
  331. },
  332. {
  333. "datasource": {
  334. "type": "grafana-azure-monitor-datasource",
  335. "uid": "${ds}"
  336. },
  337. "fieldConfig": {
  338. "defaults": {
  339. "color": {
  340. "fixedColor": "yellow",
  341. "mode": "fixed"
  342. },
  343. "mappings": [],
  344. "thresholds": {
  345. "mode": "absolute",
  346. "steps": [
  347. {
  348. "color": "green",
  349. "value": null
  350. },
  351. {
  352. "color": "red",
  353. "value": 80
  354. }
  355. ]
  356. }
  357. },
  358. "overrides": [
  359. {
  360. "matcher": {
  361. "id": "byName",
  362. "options": "Warning"
  363. },
  364. "properties": [
  365. {
  366. "id": "links",
  367. "value": [
  368. {
  369. "targetBlank": false,
  370. "title": "",
  371. "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}"
  372. }
  373. ]
  374. }
  375. ]
  376. }
  377. ]
  378. },
  379. "gridPos": {
  380. "h": 4,
  381. "w": 2,
  382. "x": 6,
  383. "y": 0
  384. },
  385. "id": 10,
  386. "options": {
  387. "colorMode": "background",
  388. "graphMode": "area",
  389. "justifyMode": "center",
  390. "orientation": "auto",
  391. "reduceOptions": {
  392. "calcs": ["lastNotNull"],
  393. "fields": "",
  394. "values": true
  395. },
  396. "textMode": "value_and_name"
  397. },
  398. "targets": [
  399. {
  400. "azureMonitor": {
  401. "dimensionFilters": [],
  402. "timeGrain": "auto"
  403. },
  404. "azureResourceGraph": {
  405. "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()"
  406. },
  407. "datasource": {
  408. "type": "grafana-azure-monitor-datasource",
  409. "uid": "${ds}"
  410. },
  411. "queryType": "Azure Resource Graph",
  412. "refId": "A",
  413. "subscription": "",
  414. "subscriptions": ["$sub"]
  415. }
  416. ],
  417. "transformations": [
  418. {
  419. "id": "organize",
  420. "options": {
  421. "excludeByName": {},
  422. "indexByName": {},
  423. "renameByName": {
  424. "count_": "Warning"
  425. }
  426. }
  427. }
  428. ],
  429. "type": "stat"
  430. },
  431. {
  432. "datasource": {
  433. "type": "grafana-azure-monitor-datasource",
  434. "uid": "${ds}"
  435. },
  436. "fieldConfig": {
  437. "defaults": {
  438. "color": {
  439. "fixedColor": "blue",
  440. "mode": "fixed"
  441. },
  442. "mappings": [],
  443. "thresholds": {
  444. "mode": "absolute",
  445. "steps": [
  446. {
  447. "color": "green",
  448. "value": null
  449. },
  450. {
  451. "color": "red",
  452. "value": 80
  453. }
  454. ]
  455. }
  456. },
  457. "overrides": [
  458. {
  459. "matcher": {
  460. "id": "byName",
  461. "options": "Informational"
  462. },
  463. "properties": [
  464. {
  465. "id": "links",
  466. "value": [
  467. {
  468. "targetBlank": false,
  469. "title": "",
  470. "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}"
  471. }
  472. ]
  473. }
  474. ]
  475. }
  476. ]
  477. },
  478. "gridPos": {
  479. "h": 4,
  480. "w": 2,
  481. "x": 8,
  482. "y": 0
  483. },
  484. "id": 12,
  485. "options": {
  486. "colorMode": "background",
  487. "graphMode": "area",
  488. "justifyMode": "center",
  489. "orientation": "auto",
  490. "reduceOptions": {
  491. "calcs": ["lastNotNull"],
  492. "fields": "",
  493. "values": true
  494. },
  495. "textMode": "value_and_name"
  496. },
  497. "targets": [
  498. {
  499. "azureMonitor": {
  500. "dimensionFilters": [],
  501. "timeGrain": "auto"
  502. },
  503. "azureResourceGraph": {
  504. "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()"
  505. },
  506. "datasource": {
  507. "type": "grafana-azure-monitor-datasource",
  508. "uid": "${ds}"
  509. },
  510. "queryType": "Azure Resource Graph",
  511. "refId": "A",
  512. "subscription": "",
  513. "subscriptions": ["$sub"]
  514. }
  515. ],
  516. "transformations": [
  517. {
  518. "id": "organize",
  519. "options": {
  520. "excludeByName": {},
  521. "indexByName": {},
  522. "renameByName": {
  523. "count_": "Informational"
  524. }
  525. }
  526. }
  527. ],
  528. "type": "stat"
  529. },
  530. {
  531. "datasource": {
  532. "type": "grafana-azure-monitor-datasource",
  533. "uid": "${ds}"
  534. },
  535. "fieldConfig": {
  536. "defaults": {
  537. "color": {
  538. "fixedColor": "purple",
  539. "mode": "fixed"
  540. },
  541. "mappings": [],
  542. "thresholds": {
  543. "mode": "absolute",
  544. "steps": [
  545. {
  546. "color": "green",
  547. "value": null
  548. },
  549. {
  550. "color": "red",
  551. "value": 80
  552. }
  553. ]
  554. }
  555. },
  556. "overrides": [
  557. {
  558. "matcher": {
  559. "id": "byName",
  560. "options": "Verbose"
  561. },
  562. "properties": [
  563. {
  564. "id": "links",
  565. "value": [
  566. {
  567. "targetBlank": false,
  568. "title": "",
  569. "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}"
  570. }
  571. ]
  572. }
  573. ]
  574. }
  575. ]
  576. },
  577. "gridPos": {
  578. "h": 4,
  579. "w": 2,
  580. "x": 10,
  581. "y": 0
  582. },
  583. "id": 14,
  584. "options": {
  585. "colorMode": "background",
  586. "graphMode": "area",
  587. "justifyMode": "center",
  588. "orientation": "auto",
  589. "reduceOptions": {
  590. "calcs": ["lastNotNull"],
  591. "fields": "",
  592. "values": true
  593. },
  594. "textMode": "value_and_name"
  595. },
  596. "targets": [
  597. {
  598. "azureMonitor": {
  599. "dimensionFilters": [],
  600. "timeGrain": "auto"
  601. },
  602. "azureResourceGraph": {
  603. "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()"
  604. },
  605. "datasource": {
  606. "type": "grafana-azure-monitor-datasource",
  607. "uid": "${ds}"
  608. },
  609. "queryType": "Azure Resource Graph",
  610. "refId": "A",
  611. "subscription": "",
  612. "subscriptions": ["$sub"]
  613. }
  614. ],
  615. "transformations": [
  616. {
  617. "id": "organize",
  618. "options": {
  619. "excludeByName": {},
  620. "indexByName": {},
  621. "renameByName": {
  622. "count_": "Verbose"
  623. }
  624. }
  625. }
  626. ],
  627. "type": "stat"
  628. },
  629. {
  630. "datasource": {
  631. "type": "grafana-azure-monitor-datasource",
  632. "uid": "${ds}"
  633. },
  634. "fieldConfig": {
  635. "defaults": {
  636. "color": {
  637. "mode": "continuous-BlYlRd"
  638. },
  639. "custom": {
  640. "align": "center",
  641. "displayMode": "auto",
  642. "filterable": true
  643. },
  644. "links": [],
  645. "mappings": [],
  646. "thresholds": {
  647. "mode": "absolute",
  648. "steps": [
  649. {
  650. "color": "green",
  651. "value": null
  652. },
  653. {
  654. "color": "red",
  655. "value": 80.0002
  656. }
  657. ]
  658. }
  659. },
  660. "overrides": [
  661. {
  662. "matcher": {
  663. "id": "byName",
  664. "options": "Severity"
  665. },
  666. "properties": [
  667. {
  668. "id": "mappings",
  669. "value": [
  670. {
  671. "options": {
  672. "\"Sev0\"": {
  673. "color": "red",
  674. "index": 4,
  675. "text": "Critical"
  676. },
  677. "\"Sev1\"": {
  678. "color": "orange",
  679. "index": 3,
  680. "text": "Error"
  681. },
  682. "\"Sev2\"": {
  683. "color": "yellow",
  684. "index": 2,
  685. "text": "Warning"
  686. },
  687. "\"Sev3\"": {
  688. "color": "blue",
  689. "index": 1,
  690. "text": "Informational"
  691. },
  692. "\"Sev4\"": {
  693. "color": "#8F3BB8",
  694. "index": 0,
  695. "text": "Verbose"
  696. }
  697. },
  698. "type": "value"
  699. }
  700. ]
  701. },
  702. {
  703. "id": "custom.displayMode",
  704. "value": "color-background-solid"
  705. }
  706. ]
  707. },
  708. {
  709. "matcher": {
  710. "id": "byName",
  711. "options": "Name"
  712. },
  713. "properties": [
  714. {
  715. "id": "custom.displayMode",
  716. "value": "color-text"
  717. },
  718. {
  719. "id": "links",
  720. "value": [
  721. {
  722. "targetBlank": true,
  723. "title": "test title",
  724. "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\"]}"
  725. }
  726. ]
  727. }
  728. ]
  729. },
  730. {
  731. "matcher": {
  732. "id": "byName",
  733. "options": "properties_essentials_monitorCondition"
  734. },
  735. "properties": [
  736. {
  737. "id": "mappings",
  738. "value": [
  739. {
  740. "options": {
  741. "Fired": {
  742. "color": "orange",
  743. "index": 1
  744. },
  745. "Resolved": {
  746. "color": "green",
  747. "index": 0
  748. }
  749. },
  750. "type": "value"
  751. }
  752. ]
  753. },
  754. {
  755. "id": "custom.displayMode",
  756. "value": "basic"
  757. }
  758. ]
  759. }
  760. ]
  761. },
  762. "gridPos": {
  763. "h": 16,
  764. "w": 24,
  765. "x": 0,
  766. "y": 4
  767. },
  768. "id": 2,
  769. "links": [],
  770. "options": {
  771. "footer": {
  772. "fields": "",
  773. "reducer": ["sum"],
  774. "show": false
  775. },
  776. "frameIndex": 0,
  777. "showHeader": true,
  778. "sortBy": []
  779. },
  780. "targets": [
  781. {
  782. "azureResourceGraph": {
  783. "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",
  784. "resultFormat": "table"
  785. },
  786. "datasource": {
  787. "type": "grafana-azure-monitor-datasource",
  788. "uid": "${ds}"
  789. },
  790. "insightsAnalytics": {
  791. "query": "",
  792. "resultFormat": "time_series"
  793. },
  794. "queryType": "Azure Resource Graph",
  795. "refId": "A",
  796. "subscription": "",
  797. "subscriptions": ["$sub"]
  798. }
  799. ],
  800. "title": "V1 Alerts",
  801. "transformations": [
  802. {
  803. "id": "organize",
  804. "options": {
  805. "excludeByName": {
  806. "alertId": false
  807. },
  808. "indexByName": {
  809. "alertId": 6,
  810. "name": 0,
  811. "properties_essentials_alertState": 3,
  812. "properties_essentials_lastModifiedDateTime": 5,
  813. "properties_essentials_monitorCondition": 2,
  814. "properties_essentials_monitorService": 4,
  815. "properties_essentials_severity": 1
  816. },
  817. "renameByName": {
  818. "alertId": "Alert ID",
  819. "name": "Name",
  820. "properties_essentials_alertState": "User Response",
  821. "properties_essentials_monitorService": "Monitor Service",
  822. "properties_essentials_lastModifiedDateTime": "Fired Time",
  823. "properties_essentials_monitorCondition": "Alert Condition",
  824. "properties_essentials_severity": "Severity"
  825. }
  826. }
  827. }
  828. ],
  829. "transparent": true,
  830. "type": "table"
  831. }
  832. ],
  833. "refresh": "",
  834. "schemaVersion": 35,
  835. "style": "dark",
  836. "tags": [],
  837. "templating": {
  838. "list": [
  839. {
  840. "current": {},
  841. "hide": 0,
  842. "includeAll": false,
  843. "label": "Datasource",
  844. "multi": false,
  845. "name": "ds",
  846. "options": [],
  847. "query": "grafana-azure-monitor-datasource",
  848. "queryValue": "",
  849. "refresh": 1,
  850. "regex": "",
  851. "skipUrlSync": false,
  852. "type": "datasource"
  853. },
  854. {
  855. "current": {},
  856. "datasource": {
  857. "type": "grafana-azure-monitor-datasource",
  858. "uid": "${ds}"
  859. },
  860. "definition": "subscriptions()",
  861. "hide": 0,
  862. "includeAll": false,
  863. "label": "Subscription",
  864. "multi": false,
  865. "name": "sub",
  866. "options": [],
  867. "query": "subscriptions()",
  868. "refresh": 1,
  869. "regex": "",
  870. "skipUrlSync": false,
  871. "sort": 0,
  872. "type": "query"
  873. },
  874. {
  875. "current": {},
  876. "datasource": {
  877. "type": "grafana-azure-monitor-datasource",
  878. "uid": "${ds}"
  879. },
  880. "definition": "ResourceGroups($sub)",
  881. "hide": 0,
  882. "includeAll": false,
  883. "label": "Resource Group(s)",
  884. "multi": true,
  885. "name": "rg",
  886. "options": [],
  887. "query": "ResourceGroups($sub)",
  888. "refresh": 1,
  889. "regex": "",
  890. "skipUrlSync": false,
  891. "sort": 0,
  892. "type": "query"
  893. },
  894. {
  895. "current": {
  896. "selected": false,
  897. "text": ["Fired", "Resolved"],
  898. "value": ["Fired", "Resolved"]
  899. },
  900. "hide": 0,
  901. "includeAll": false,
  902. "label": "Alert Condition",
  903. "multi": true,
  904. "name": "mc",
  905. "options": [
  906. {
  907. "selected": true,
  908. "text": "Fired",
  909. "value": "Fired"
  910. },
  911. {
  912. "selected": true,
  913. "text": "Resolved",
  914. "value": "Resolved"
  915. }
  916. ],
  917. "query": "Fired, Resolved",
  918. "queryValue": "",
  919. "skipUrlSync": false,
  920. "type": "custom"
  921. },
  922. {
  923. "current": {
  924. "selected": false,
  925. "text": ["New", "Acknowledged", "Closed"],
  926. "value": ["New", "Acknowledged", "Closed"]
  927. },
  928. "hide": 0,
  929. "includeAll": false,
  930. "label": "User Response",
  931. "multi": true,
  932. "name": "as",
  933. "options": [
  934. {
  935. "selected": true,
  936. "text": "New",
  937. "value": "New"
  938. },
  939. {
  940. "selected": true,
  941. "text": "Acknowledged",
  942. "value": "Acknowledged"
  943. },
  944. {
  945. "selected": true,
  946. "text": "Closed",
  947. "value": "Closed"
  948. }
  949. ],
  950. "query": "New, Acknowledged, Closed",
  951. "queryValue": "",
  952. "skipUrlSync": false,
  953. "type": "custom"
  954. },
  955. {
  956. "current": {
  957. "selected": false,
  958. "text": ["Critical", "Error", "Warning", "Informational", "Verbose"],
  959. "value": ["Sev0", "Sev1", "Sev2", "Sev3", "Sev4"]
  960. },
  961. "hide": 0,
  962. "includeAll": false,
  963. "label": "Severity",
  964. "multi": true,
  965. "name": "sev",
  966. "options": [
  967. {
  968. "selected": true,
  969. "text": "Critical",
  970. "value": "Sev0"
  971. },
  972. {
  973. "selected": true,
  974. "text": "Error",
  975. "value": "Sev1"
  976. },
  977. {
  978. "selected": true,
  979. "text": "Warning",
  980. "value": "Sev2"
  981. },
  982. {
  983. "selected": true,
  984. "text": "Informational",
  985. "value": "Sev3"
  986. },
  987. {
  988. "selected": true,
  989. "text": "Verbose",
  990. "value": "Sev4"
  991. }
  992. ],
  993. "query": "Critical : Sev0, Error : Sev1, Warning : Sev2, Informational : Sev3, Verbose : Sev4",
  994. "queryValue": "",
  995. "skipUrlSync": false,
  996. "type": "custom"
  997. }
  998. ]
  999. },
  1000. "time": {
  1001. "from": "now-30d",
  1002. "to": "now"
  1003. },
  1004. "timepicker": {
  1005. "hidden": false,
  1006. "refresh_intervals": ["30m", "1h", "12h", "24h", "3d", "7d", "30d"]
  1007. },
  1008. "title": "Azure / Alert Consumption",
  1009. "uid": "dyzn5SK7z",
  1010. "version": 45
  1011. }