vMInsightsRG.json 161 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660
  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. "type": "panel",
  31. "id": "text",
  32. "name": "Text",
  33. "version": ""
  34. },
  35. {
  36. "type": "panel",
  37. "id": "timeseries",
  38. "name": "Time series",
  39. "version": ""
  40. }
  41. ],
  42. "annotations": {
  43. "list": [
  44. {
  45. "builtIn": 1,
  46. "datasource": "-- Grafana --",
  47. "enable": true,
  48. "hide": true,
  49. "iconColor": "rgba(0, 211, 255, 1)",
  50. "name": "Annotations & Alerts",
  51. "target": {
  52. "limit": 100,
  53. "matchAny": false,
  54. "tags": [],
  55. "type": "dashboard"
  56. },
  57. "type": "dashboard"
  58. }
  59. ]
  60. },
  61. "editable": true,
  62. "fiscalYearStartMonth": 0,
  63. "graphTooltip": 0,
  64. "id": null,
  65. "iteration": 1647558476173,
  66. "links": [],
  67. "liveNow": false,
  68. "panels": [
  69. {
  70. "gridPos": {
  71. "h": 5,
  72. "w": 24,
  73. "x": 0,
  74. "y": 0
  75. },
  76. "id": 54,
  77. "options": {
  78. "content": "<div style=\"padding: 1em; text-align: center\">\n <p>Welcome to the Azure Monitor data source for Grafana. To learn more about it, visit our <a href=\"https://grafana.com/docs/grafana/latest/datasources/azuremonitor/\" target=\"__blank\">docs</a>. </p>\n <p> Choose the resource group(s) with VMs enabled with Azure Monitor VM Insights to get started.</p>\n</div>",
  79. "mode": "markdown"
  80. },
  81. "pluginVersion": "8.4.3",
  82. "title": "How to activate this dashboard",
  83. "type": "text"
  84. },
  85. {
  86. "collapsed": false,
  87. "gridPos": {
  88. "h": 1,
  89. "w": 24,
  90. "x": 0,
  91. "y": 5
  92. },
  93. "id": 28,
  94. "panels": [],
  95. "title": "CPU Utilization %",
  96. "type": "row"
  97. },
  98. {
  99. "datasource": {
  100. "uid": "${ds}"
  101. },
  102. "description": "The resource path for this panel uses multiple template variables which requires modifying the dashboard JSON directly. If you would like to do something similar please go to Settings > Save As. Edit as you'd like in your new copy by going to Settings > JSON Model.",
  103. "fieldConfig": {
  104. "defaults": {
  105. "color": {
  106. "mode": "palette-classic"
  107. },
  108. "custom": {
  109. "axisGridShow": true,
  110. "axisLabel": "",
  111. "axisPlacement": "auto",
  112. "axisSoftMax": 100,
  113. "axisSoftMin": 0,
  114. "barAlignment": 0,
  115. "drawStyle": "line",
  116. "fillOpacity": 0,
  117. "gradientMode": "none",
  118. "hideFrom": {
  119. "legend": false,
  120. "tooltip": false,
  121. "viz": false
  122. },
  123. "lineInterpolation": "linear",
  124. "lineWidth": 1,
  125. "pointSize": 5,
  126. "scaleDistribution": {
  127. "type": "linear"
  128. },
  129. "showPoints": "never",
  130. "spanNulls": true,
  131. "stacking": {
  132. "group": "A",
  133. "mode": "none"
  134. },
  135. "thresholdsStyle": {
  136. "mode": "off"
  137. }
  138. },
  139. "mappings": [],
  140. "thresholds": {
  141. "mode": "absolute",
  142. "steps": [
  143. {
  144. "color": "green",
  145. "value": null
  146. },
  147. {
  148. "color": "red",
  149. "value": 80
  150. }
  151. ]
  152. },
  153. "unit": "percent"
  154. },
  155. "overrides": []
  156. },
  157. "gridPos": {
  158. "h": 10,
  159. "w": 24,
  160. "x": 0,
  161. "y": 6
  162. },
  163. "id": 2,
  164. "options": {
  165. "legend": {
  166. "calcs": [],
  167. "displayMode": "list",
  168. "placement": "bottom"
  169. },
  170. "tooltip": {
  171. "mode": "single",
  172. "sort": "none"
  173. }
  174. },
  175. "targets": [
  176. {
  177. "appInsights": {
  178. "dimension": [],
  179. "metricName": "select",
  180. "timeGrain": "auto"
  181. },
  182. "azureLogAnalytics": {
  183. "query": "let startDateTime = $__timeFrom;\nlet endDateTime = $__timeTo;\nlet trendBinSize = (endDateTime - startDateTime)/100;\nlet summary = InsightsMetrics\n| where TimeGenerated between (startDateTime .. endDateTime)\n| where Origin == 'vm.azm.ms' and (Namespace == 'Processor' and Name == 'UtilizationPercentage')\n| parse kind=regex tolower(_ResourceId) with 'resourcegroups/' resGroup '/p(.+)' *\n| where resGroup in~ ($rg)\n| extend ComputerId = iff(isempty(_ResourceId), Computer, _ResourceId)\n| summarize hint.shufflekey=ComputerId $agg by ComputerId, Computer| top 10 by score;\nlet computerList=(summary\n| project ComputerId, Computer);\nlet EmptyNodeIdentityAndProps = datatable(ComputerId: string, Computer:string, NodeId:string, NodeProps:dynamic, Priority: long) []; \nlet OmsNodeIdentityAndProps = computerList \n| extend NodeId = ComputerId \n| extend Priority = 1 \n| extend NodeProps = pack('type', 'StandAloneNode', 'name', Computer); \nlet ServiceMapNodeIdentityAndProps = VMComputer \n| where TimeGenerated >= startDateTime \n| where TimeGenerated < endDateTime \n| extend ResourceId = strcat('machines/', Machine) \n| extend tempComputerId=iff(isempty(_ResourceId), Computer, _ResourceId) \n| extend laResourceId = iff(isempty(_ResourceId),'', replace(@'virtualmachine`alesets/(.+)/virtualmachines/(\\\\d+)', @'virtualmachinescalesets/\\\\1/virtualmachines/\\\\1_\\\\2', _ResourceId))\n | extend oldLaResourceId=iff(isempty(_ResourceId),'',replace(@'virtualmachinescalesets/(.+)/virtualmachines/(\\\\d+)',@'virtualmachines/\\\\1_\\\\2', _ResourceId)) \n | where tempComputerId in~ (computerList) or laResourceId in (computerList) or oldLaResourceId in (computerList) \n | extend ComputerId = iff(laResourceId in (computerList), laResourceId, iff(oldLaResourceId in (computerList), oldLaResourceId, tempComputerId)) \n | summarize arg_max(TimeGenerated, *) by Machine \n | extend AzureCloudServiceNodeIdentity = iif(isnotempty(AzureCloudServiceName), strcat(AzureCloudServiceInstanceId, '|', AzureCloudServiceDeployment), ''), AzureScaleSetNodeIdentity = iif(isnotempty(AzureVmScaleSetName), strcat(AzureVmScaleSetInstanceId, '|', AzureVmScaleSetDeployment), ''), ComputerProps = pack('type', 'StandAloneNode', 'name', DisplayName, 'mappingResourceId', ResourceId, 'subscriptionId', AzureSubscriptionId, 'resourceGroup', AzureResourceGroup, 'azureResourceId', _ResourceId), AzureCloudServiceNodeProps = pack('type', 'AzureCloudServiceNode', 'cloudServiceInstanceId', AzureCloudServiceInstanceId, 'cloudServiceRoleName', AzureCloudServiceRoleName, 'cloudServiceDeploymentId', AzureCloudServiceDeployment, 'fullDisplayName', FullDisplayName, 'cloudServiceName', AzureCloudServiceName, 'mappingResourceId', ResourceId), AzureScaleSetNodeProps = pack('type', 'AzureScaleSetNode', 'scaleSetInstanceId', AzureResourceName, 'vmScaleSetDeploymentId', AzureVmScaleSetDeployment, 'vmScaleSetName', AzureVmScaleSetName, 'serviceFabricClusterName', AzureServiceFabricClusterName, 'vmScaleSetResourceId', AzureVmScaleSetResourceId, 'resourceGroupName', AzureResourceGroup, 'subscriptionId', AzureSubscriptionId, 'fullDisplayName', FullDisplayName, 'mappingResourceId', ResourceId) \n | project ComputerId, Computer, NodeId = case(isnotempty(AzureCloudServiceNodeIdentity), AzureCloudServiceNodeIdentity, isnotempty(AzureScaleSetNodeIdentity), AzureScaleSetNodeIdentity, Computer), NodeProps = case(isnotempty(AzureCloudServiceNodeIdentity), AzureCloudServiceNodeProps, isnotempty(AzureScaleSetNodeIdentity), AzureScaleSetNodeProps, ComputerProps), Priority = 2; \n let NodeIdentityAndProps = union kind=inner isfuzzy = true EmptyNodeIdentityAndProps, OmsNodeIdentityAndProps, ServiceMapNodeIdentityAndProps \n | summarize arg_max(Priority, *) by ComputerId;\n summary\n | join (InsightsMetrics \n | where TimeGenerated between (startDateTime .. endDateTime) \n | where Origin == 'vm.azm.ms' and (Namespace == 'Processor' and Name == 'UtilizationPercentage') \n | extend ComputerId = iff(isempty(_ResourceId), Computer, _ResourceId) \n | where ComputerId in (computerList) \n | summarize $agg by bin(TimeGenerated, trendBinSize), ComputerId \n | sort by TimeGenerated asc) on ComputerId",
  184. "resource": "/subscriptions/$sub",
  185. "resultFormat": "table",
  186. "workspace": ""
  187. },
  188. "azureMonitor": {
  189. "aggOptions": [],
  190. "aggregation": "Average",
  191. "allowedTimeGrainsMs": [60000, 300000, 900000, 1800000, 3600000, 21600000, 43200000, 86400000],
  192. "dimensionFilter": "*",
  193. "dimensionFilters": [],
  194. "metricDefinition": "Microsoft.Compute/virtualMachines",
  195. "metricName": "Percentage CPU",
  196. "metricNamespace": "Microsoft.Compute/virtualMachines",
  197. "resourceGroup": "$rg",
  198. "resourceName": "$res",
  199. "timeGrain": "auto",
  200. "timeGrains": [],
  201. "top": "10"
  202. },
  203. "azureResourceGraph": {
  204. "resultFormat": "table"
  205. },
  206. "hide": false,
  207. "insightsAnalytics": {
  208. "query": "",
  209. "resultFormat": "time_series"
  210. },
  211. "queryType": "Azure Log Analytics",
  212. "refId": "A",
  213. "subscription": "$sub",
  214. "subscriptions": []
  215. }
  216. ],
  217. "title": "${agg:text} CPU Utilization %",
  218. "transformations": [
  219. {
  220. "id": "organize",
  221. "options": {
  222. "excludeByName": {
  223. "ComputerId": true,
  224. "ComputerId1": true,
  225. "P5th": true,
  226. "P95th": true,
  227. "score": true
  228. },
  229. "indexByName": {},
  230. "renameByName": {}
  231. }
  232. },
  233. {
  234. "id": "prepareTimeSeries",
  235. "options": {
  236. "format": "many"
  237. }
  238. },
  239. {
  240. "id": "renameByRegex",
  241. "options": {
  242. "regex": "(.+)\\s(.+)",
  243. "renamePattern": "$2"
  244. }
  245. }
  246. ],
  247. "type": "timeseries"
  248. },
  249. {
  250. "datasource": {
  251. "type": "grafana-azure-monitor-datasource",
  252. "uid": "${ds}"
  253. },
  254. "description": "The resource path for this panel uses multiple template variables which requires modifying the dashboard JSON directly. If you would like to do something similar please go to Settings > Save As. Edit as you'd like in your new copy by going to Settings > JSON Model.",
  255. "fieldConfig": {
  256. "defaults": {
  257. "color": {
  258. "mode": "thresholds"
  259. },
  260. "custom": {
  261. "align": "auto",
  262. "displayMode": "auto"
  263. },
  264. "mappings": [],
  265. "thresholds": {
  266. "mode": "absolute",
  267. "steps": [
  268. {
  269. "color": "green",
  270. "value": null
  271. },
  272. {
  273. "color": "red",
  274. "value": 80
  275. }
  276. ]
  277. }
  278. },
  279. "overrides": [
  280. {
  281. "matcher": {
  282. "id": "byName",
  283. "options": "Computer"
  284. },
  285. "properties": [
  286. {
  287. "id": "links",
  288. "value": [
  289. {
  290. "targetBlank": true,
  291. "title": "",
  292. "url": "https://ms.portal.azure.com/#@${__data.fields[\"Tenant ID\"]}/resource/subscriptions/${sub}/resourcegroups/${__data.fields[\"Resource Group\"]}/providers/microsoft.compute/${__data.fields.Type}/${__data.fields[\"Resource Name\"]}/infrainsights"
  293. }
  294. ]
  295. }
  296. ]
  297. },
  298. {
  299. "matcher": {
  300. "id": "byName",
  301. "options": "Resource Group"
  302. },
  303. "properties": [
  304. {
  305. "id": "custom.width",
  306. "value": 136
  307. }
  308. ]
  309. },
  310. {
  311. "matcher": {
  312. "id": "byName",
  313. "options": "Average"
  314. },
  315. "properties": [
  316. {
  317. "id": "custom.width",
  318. "value": 111
  319. }
  320. ]
  321. },
  322. {
  323. "matcher": {
  324. "id": "byName",
  325. "options": "P50th"
  326. },
  327. "properties": [
  328. {
  329. "id": "custom.width",
  330. "value": 105
  331. }
  332. ]
  333. },
  334. {
  335. "matcher": {
  336. "id": "byName",
  337. "options": "P90th"
  338. },
  339. "properties": [
  340. {
  341. "id": "custom.width",
  342. "value": 101
  343. }
  344. ]
  345. },
  346. {
  347. "matcher": {
  348. "id": "byName",
  349. "options": "P95th"
  350. },
  351. "properties": [
  352. {
  353. "id": "custom.width",
  354. "value": 99
  355. }
  356. ]
  357. },
  358. {
  359. "matcher": {
  360. "id": "byName",
  361. "options": "Max"
  362. },
  363. "properties": [
  364. {
  365. "id": "custom.width",
  366. "value": 98
  367. }
  368. ]
  369. }
  370. ]
  371. },
  372. "gridPos": {
  373. "h": 12,
  374. "w": 14,
  375. "x": 0,
  376. "y": 16
  377. },
  378. "id": 26,
  379. "options": {
  380. "footer": {
  381. "fields": "",
  382. "reducer": ["sum"],
  383. "show": false
  384. },
  385. "showHeader": true,
  386. "sortBy": []
  387. },
  388. "pluginVersion": "8.4.3",
  389. "targets": [
  390. {
  391. "azureLogAnalytics": {
  392. "query": "let startDateTime = $__timeFrom;\r\nlet endDateTime = $__timeTo;\r\nlet trendBinSize = 5m;\r\nlet maxResultCount = 500;\r\nlet summaryPerComputer = InsightsMetrics\r\n| where TimeGenerated between (startDateTime .. endDateTime)\r\n| where Origin == 'vm.azm.ms' and (Namespace == 'Processor' and Name == 'UtilizationPercentage') \r\n| extend ComputerId = iff(isempty(_ResourceId), Computer, _ResourceId)\r\n| summarize hint.shufflekey = ComputerId Average = avg(Val), Max = max(Val), percentiles(Val, 5, 10, 50, 90, 95) by ComputerId, Computer, _ResourceId\r\n| project ComputerId, Computer, Average, Max, P5th = percentile_Val_5, P10th = percentile_Val_10, P50th = percentile_Val_50, P90th = percentile_Val_90, P95th = percentile_Val_95, ResourceId = _ResourceId\r\n| top 10 by ${agg:text};\r\nlet computerList = summaryPerComputer\r\n| summarize by ComputerId, Computer;\r\nlet EmptyNodeIdentityAndProps = datatable(ComputerId: string, Computer:string, NodeId:string, NodeProps:dynamic, Priority: long) []; \r\nlet OmsNodeIdentityAndProps = computerList \r\n| extend NodeId = ComputerId \r\n| extend Priority = 1 \r\n| extend NodeProps = pack('type', 'StandAloneNode', 'name', Computer); \r\nlet ServiceMapNodeIdentityAndProps = VMComputer \r\n| where TimeGenerated >= startDateTime \r\n| where TimeGenerated < endDateTime \r\n| extend ResourceId = strcat('machines/', Machine) \r\n| extend tempComputerId=iff(isempty(_ResourceId), Computer, _ResourceId) \r\n| extend laResourceId = iff(isempty(_ResourceId),'', replace(@'virtualmachinescalesets/(.+)/virtualmachines/(\\\\d+)', @'virtualmachinescalesets/\\\\1/virtualmachines/\\\\1_\\\\2', _ResourceId)) \r\n| extend oldLaResourceId=iff(isempty(_ResourceId),'',replace(@'virtualmachinescalesets/(.+)/virtualmachines/(\\\\d+)',@'virtualmachines/\\\\1_\\\\2', _ResourceId)) \r\n| where tempComputerId in~ (computerList) or laResourceId in (computerList) or oldLaResourceId in (computerList) \r\n| extend ComputerId = iff(laResourceId in (computerList), laResourceId, iff(oldLaResourceId in (computerList), oldLaResourceId, tempComputerId)) \r\n| summarize arg_max(TimeGenerated, *) by Machine \r\n| extend AzureCloudServiceNodeIdentity = iif(isnotempty(AzureCloudServiceName), strcat(AzureCloudServiceInstanceId, '|', AzureCloudServiceDeployment), ''), AzureScaleSetNodeIdentity = iif(isnotempty(AzureVmScaleSetName), strcat(AzureVmScaleSetInstanceId, '|', AzureVmScaleSetDeployment), ''), ComputerProps = pack('type', 'StandAloneNode', 'name', DisplayName, 'mappingResourceId', ResourceId, 'subscriptionId', AzureSubscriptionId, 'resourceGroup', AzureResourceGroup, 'azureResourceId', _ResourceId), AzureCloudServiceNodeProps = pack('type', 'AzureCloudServiceNode', 'cloudServiceInstanceId', AzureCloudServiceInstanceId, 'cloudServiceRoleName', AzureCloudServiceRoleName, 'cloudServiceDeploymentId', AzureCloudServiceDeployment, 'fullDisplayName', FullDisplayName, 'cloudServiceName', AzureCloudServiceName, 'mappingResourceId', ResourceId), AzureScaleSetNodeProps = pack('type', 'AzureScaleSetNode', 'scaleSetInstanceId', AzureResourceName, 'vmScaleSetDeploymentId', AzureVmScaleSetDeployment, 'vmScaleSetName', AzureVmScaleSetName, 'serviceFabricClusterName', AzureServiceFabricClusterName, 'vmScaleSetResourceId', AzureVmScaleSetResourceId, 'resourceGroupName', AzureResourceGroup, 'subscriptionId', AzureSubscriptionId, 'fullDisplayName', FullDisplayName, 'mappingResourceId', ResourceId) \r\n| project ComputerId, Computer, NodeId = case(isnotempty(AzureCloudServiceNodeIdentity), AzureCloudServiceNodeIdentity, isnotempty(AzureScaleSetNodeIdentity), AzureScaleSetNodeIdentity, Computer), NodeProps = case(isnotempty(AzureCloudServiceNodeIdentity), AzureCloudServiceNodeProps, isnotempty(AzureScaleSetNodeIdentity), AzureScaleSetNodeProps, ComputerProps), Priority = 2; let NodeIdentityAndProps = union kind=inner isfuzzy = true EmptyNodeIdentityAndProps, OmsNodeIdentityAndProps, ServiceMapNodeIdentityAndProps \r\n| summarize arg_max(Priority, *) by ComputerId;let trend = InsightsMetrics\r\n| where TimeGenerated between (startDateTime .. endDateTime)\r\n| where Origin == 'vm.azm.ms' and (Namespace == 'Processor' and Name == 'UtilizationPercentage')\r\n| extend ComputerId = iff(isempty(_ResourceId), Computer, _ResourceId)\r\n| where ComputerId in (computerList)\r\n| summarize hint.shufflekey = ComputerId TrendValue = percentile(Val, 95) by ComputerId, Computer, bin(TimeGenerated, trendBinSize)\r\n| project ComputerId, Computer\r\n| summarize hint.shufflekey = ComputerId by ComputerId, Computer;\r\nsummaryPerComputer\r\n| join ( trend ) on ComputerId\r\n| join ( NodeIdentityAndProps ) on ComputerId\r\n| parse tolower(ResourceId) with * \"virtualmachinescalesets/\" scaleSetName \"/virtualmachines/\" vmNameScale\r\n| parse tolower(ResourceId) with * \"virtualmachines/\" vmName\r\n| parse tolower(ResourceId) with * \"resourcegroups/\" resourceGroup \"/providers/microsoft.compute/\" typeVM \"/\" nameVM\r\n| parse tolower(ResourceId) with * \"microsoft.compute/\" typeScale \"/\" nameScale \"/virtualmachines\" remaining\r\n| project resourceGroup, Average, P50th, P90th, P95th, Max, Computer, Type = iff(isnotempty(typeScale), typeScale, typeVM), Name = iff(isnotempty(nameScale), nameScale, nameVM)\r\n",
  393. "resource": "/subscriptions/$sub",
  394. "resultFormat": "table"
  395. },
  396. "azureMonitor": {
  397. "timeGrain": "auto"
  398. },
  399. "datasource": {
  400. "type": "grafana-azure-monitor-datasource",
  401. "uid": "${ds}"
  402. },
  403. "queryType": "Azure Log Analytics",
  404. "refId": "A",
  405. "subscription": ""
  406. },
  407. {
  408. "azureMonitor": {
  409. "dimensionFilters": [],
  410. "timeGrain": "auto"
  411. },
  412. "azureResourceGraph": {
  413. "query": "resources\r\n| where tolower(type) contains \"virtualmachines\" and resourceGroup in~ ($rg) \r\n| project Name = tolower(name), tenantId, resourceGroup"
  414. },
  415. "datasource": {
  416. "type": "grafana-azure-monitor-datasource",
  417. "uid": "${ds}"
  418. },
  419. "hide": false,
  420. "queryType": "Azure Resource Graph",
  421. "refId": "B",
  422. "subscription": "",
  423. "subscriptions": ["$sub"]
  424. }
  425. ],
  426. "title": "CPU Utilization % Statistics",
  427. "transformations": [
  428. {
  429. "id": "merge",
  430. "options": {}
  431. },
  432. {
  433. "id": "organize",
  434. "options": {
  435. "excludeByName": {
  436. "Max": false,
  437. "NodeId": true,
  438. "NodeProps": true,
  439. "P50th": false,
  440. "ResourceId": true
  441. },
  442. "indexByName": {
  443. "Average": 2,
  444. "Computer": 0,
  445. "Max": 6,
  446. "Name": 8,
  447. "P50th": 3,
  448. "P90th": 4,
  449. "P95th": 5,
  450. "Type": 7,
  451. "resourceGroup": 1,
  452. "tenantId": 9
  453. },
  454. "renameByName": {
  455. "Name": "Resource Name",
  456. "UseRelativeScale": "",
  457. "list_TrendPoint": "95th Trend",
  458. "resGroup": "Resource Group",
  459. "resourceGroup": "Resource Group",
  460. "tenantId": "Tenant ID",
  461. "typeName": "Type/Name"
  462. }
  463. }
  464. },
  465. {
  466. "id": "filterByValue",
  467. "options": {
  468. "filters": [
  469. {
  470. "config": {
  471. "id": "isNotNull",
  472. "options": {}
  473. },
  474. "fieldName": "Computer"
  475. }
  476. ],
  477. "match": "all",
  478. "type": "include"
  479. }
  480. }
  481. ],
  482. "type": "table"
  483. },
  484. {
  485. "datasource": {
  486. "type": "grafana-azure-monitor-datasource",
  487. "uid": "${ds}"
  488. },
  489. "description": "The resource path for this panel uses multiple template variables which requires modifying the dashboard JSON directly. If you would like to do something similar please go to Settings > Save As. Edit as you'd like in your new copy by going to Settings > JSON Model.",
  490. "fieldConfig": {
  491. "defaults": {
  492. "color": {
  493. "fixedColor": "light-green",
  494. "mode": "fixed"
  495. },
  496. "mappings": [],
  497. "thresholds": {
  498. "mode": "absolute",
  499. "steps": [
  500. {
  501. "color": "green",
  502. "value": null
  503. },
  504. {
  505. "color": "red",
  506. "value": 80
  507. }
  508. ]
  509. }
  510. },
  511. "overrides": []
  512. },
  513. "gridPos": {
  514. "h": 12,
  515. "w": 10,
  516. "x": 14,
  517. "y": 16
  518. },
  519. "id": 46,
  520. "options": {
  521. "colorMode": "value",
  522. "graphMode": "area",
  523. "justifyMode": "auto",
  524. "orientation": "auto",
  525. "reduceOptions": {
  526. "calcs": ["max"],
  527. "fields": "",
  528. "values": false
  529. },
  530. "text": {},
  531. "textMode": "auto"
  532. },
  533. "pluginVersion": "8.4.3",
  534. "targets": [
  535. {
  536. "azureLogAnalytics": {
  537. "query": "let startDateTime = $__timeFrom;\r\nlet endDateTime = $__timeTo;\r\nlet trendBinSize = (endDateTime - startDateTime)/100;\r\nlet summary = InsightsMetrics\r\n| where TimeGenerated between (startDateTime .. endDateTime)\r\n| where Origin == 'vm.azm.ms' and (Namespace == 'Processor' and Name == 'UtilizationPercentage')\r\n| parse kind=regex tolower(_ResourceId) with 'resourcegroups/' resGroup '/p(.+)' *\r\n| where resGroup in~ ($rg)\r\n| extend ComputerId = iff(isempty(_ResourceId), Computer, _ResourceId)\r\n| summarize hint.shufflekey=ComputerId Average = avg(Val), Min = min(Val),P5th = round(percentile(Val, 5), 2), P10th = round(percentile(Val, 10), 2), \r\nP50th = round(percentile(Val, 50), 2), P80th = round(percentile(Val, 80), 2),\r\nP90th = round(percentile(Val, 90), 2), P95th = round(percentile(Val, 95), 2) by ComputerId, Computer\r\n| top 10 by ${agg:text};\r\nlet computerList=(summary\r\n| project ComputerId, Computer);\r\nlet EmptyNodeIdentityAndProps = datatable(ComputerId: string, Computer:string, NodeId:string, NodeProps:dynamic, Priority: long) []; \r\nlet OmsNodeIdentityAndProps = computerList \r\n| extend NodeId = ComputerId \r\n| extend Priority = 1 \r\n| extend NodeProps = pack('type', 'StandAloneNode', 'name', Computer); \r\nlet ServiceMapNodeIdentityAndProps = VMComputer \r\n| where TimeGenerated >= startDateTime \r\n| where TimeGenerated < endDateTime \r\n| extend ResourceId = strcat('machines/', Machine) \r\n| extend tempComputerId=iff(isempty(_ResourceId), Computer, _ResourceId) \r\n| extend laResourceId = iff(isempty(_ResourceId),'', replace(@'virtualmachine`alesets/(.+)/virtualmachines/(\\\\d+)', @'virtualmachinescalesets/\\\\1/virtualmachines/\\\\1_\\\\2', _ResourceId))\r\n | extend oldLaResourceId=iff(isempty(_ResourceId),'',replace(@'virtualmachinescalesets/(.+)/virtualmachines/(\\\\d+)',@'virtualmachines/\\\\1_\\\\2', _ResourceId)) \r\n | where tempComputerId in~ (computerList) or laResourceId in (computerList) or oldLaResourceId in (computerList) \r\n | extend ComputerId = iff(laResourceId in (computerList), laResourceId, iff(oldLaResourceId in (computerList), oldLaResourceId, tempComputerId)) \r\n | summarize arg_max(TimeGenerated, *) by Machine \r\n | extend AzureCloudServiceNodeIdentity = iif(isnotempty(AzureCloudServiceName), strcat(AzureCloudServiceInstanceId, '|', AzureCloudServiceDeployment), ''), AzureScaleSetNodeIdentity = iif(isnotempty(AzureVmScaleSetName), strcat(AzureVmScaleSetInstanceId, '|', AzureVmScaleSetDeployment), ''), ComputerProps = pack('type', 'StandAloneNode', 'name', DisplayName, 'mappingResourceId', ResourceId, 'subscriptionId', AzureSubscriptionId, 'resourceGroup', AzureResourceGroup, 'azureResourceId', _ResourceId), AzureCloudServiceNodeProps = pack('type', 'AzureCloudServiceNode', 'cloudServiceInstanceId', AzureCloudServiceInstanceId, 'cloudServiceRoleName', AzureCloudServiceRoleName, 'cloudServiceDeploymentId', AzureCloudServiceDeployment, 'fullDisplayName', FullDisplayName, 'cloudServiceName', AzureCloudServiceName, 'mappingResourceId', ResourceId), AzureScaleSetNodeProps = pack('type', 'AzureScaleSetNode', 'scaleSetInstanceId', AzureResourceName, 'vmScaleSetDeploymentId', AzureVmScaleSetDeployment, 'vmScaleSetName', AzureVmScaleSetName, 'serviceFabricClusterName', AzureServiceFabricClusterName, 'vmScaleSetResourceId', AzureVmScaleSetResourceId, 'resourceGroupName', AzureResourceGroup, 'subscriptionId', AzureSubscriptionId, 'fullDisplayName', FullDisplayName, 'mappingResourceId', ResourceId) \r\n | project ComputerId, Computer, NodeId = case(isnotempty(AzureCloudServiceNodeIdentity), AzureCloudServiceNodeIdentity, isnotempty(AzureScaleSetNodeIdentity), AzureScaleSetNodeIdentity, Computer), NodeProps = case(isnotempty(AzureCloudServiceNodeIdentity), AzureCloudServiceNodeProps, isnotempty(AzureScaleSetNodeIdentity), AzureScaleSetNodeProps, ComputerProps), Priority = 2; \r\n let NodeIdentityAndProps = union kind=inner isfuzzy = true EmptyNodeIdentityAndProps, OmsNodeIdentityAndProps, ServiceMapNodeIdentityAndProps \r\n | summarize arg_max(Priority, *) by ComputerId;\r\n summary\r\n | join (InsightsMetrics \r\n | where TimeGenerated between (startDateTime .. endDateTime) \r\n | where Origin == 'vm.azm.ms' and (Namespace == 'Processor' and Name == 'UtilizationPercentage') \r\n | extend ComputerId = iff(isempty(_ResourceId), Computer, _ResourceId) \r\n | where ComputerId in (computerList) \r\n | summarize Max = max(Val) by bin(TimeGenerated, trendBinSize), ComputerId \r\n | sort by TimeGenerated asc) on ComputerId",
  538. "resource": "/subscriptions/$sub",
  539. "resultFormat": "table"
  540. },
  541. "azureMonitor": {
  542. "timeGrain": "auto"
  543. },
  544. "datasource": {
  545. "type": "grafana-azure-monitor-datasource",
  546. "uid": "${ds}"
  547. },
  548. "queryType": "Azure Log Analytics",
  549. "refId": "A",
  550. "subscription": ""
  551. }
  552. ],
  553. "title": "Max CPU Utilization % and trend lines",
  554. "transformations": [
  555. {
  556. "id": "organize",
  557. "options": {
  558. "excludeByName": {
  559. "Average": true,
  560. "Computer": false,
  561. "ComputerId": true,
  562. "ComputerId1": true,
  563. "Min": true,
  564. "P10th": true,
  565. "P50th": true,
  566. "P5th": true,
  567. "P80th": true,
  568. "P90th": true,
  569. "P95th": true,
  570. "score": false
  571. },
  572. "indexByName": {},
  573. "renameByName": {}
  574. }
  575. },
  576. {
  577. "id": "prepareTimeSeries",
  578. "options": {
  579. "format": "many"
  580. }
  581. },
  582. {
  583. "id": "renameByRegex",
  584. "options": {
  585. "regex": "(.+)\\s(.+)",
  586. "renamePattern": "$2"
  587. }
  588. }
  589. ],
  590. "type": "stat"
  591. },
  592. {
  593. "collapsed": true,
  594. "gridPos": {
  595. "h": 1,
  596. "w": 24,
  597. "x": 0,
  598. "y": 28
  599. },
  600. "id": 30,
  601. "panels": [
  602. {
  603. "datasource": {
  604. "type": "grafana-azure-monitor-datasource",
  605. "uid": "${ds}"
  606. },
  607. "description": "The resource path for this panel uses multiple template variables which requires modifying the dashboard JSON directly. If you would like to do something similar please go to Settings > Save As. Edit as you'd like in your new copy by going to Settings > JSON Model.",
  608. "fieldConfig": {
  609. "defaults": {
  610. "color": {
  611. "mode": "palette-classic"
  612. },
  613. "custom": {
  614. "axisGridShow": true,
  615. "axisLabel": "",
  616. "axisPlacement": "auto",
  617. "axisSoftMin": 0,
  618. "barAlignment": 0,
  619. "drawStyle": "line",
  620. "fillOpacity": 0,
  621. "gradientMode": "none",
  622. "hideFrom": {
  623. "legend": false,
  624. "tooltip": false,
  625. "viz": false
  626. },
  627. "lineInterpolation": "linear",
  628. "lineWidth": 1,
  629. "pointSize": 5,
  630. "scaleDistribution": {
  631. "type": "linear"
  632. },
  633. "showPoints": "never",
  634. "spanNulls": true,
  635. "stacking": {
  636. "group": "A",
  637. "mode": "none"
  638. },
  639. "thresholdsStyle": {
  640. "mode": "off"
  641. }
  642. },
  643. "mappings": [],
  644. "thresholds": {
  645. "mode": "absolute",
  646. "steps": [
  647. {
  648. "color": "green",
  649. "value": null
  650. },
  651. {
  652. "color": "red",
  653. "value": 80
  654. }
  655. ]
  656. },
  657. "unit": "decmbytes"
  658. },
  659. "overrides": []
  660. },
  661. "gridPos": {
  662. "h": 10,
  663. "w": 24,
  664. "x": 0,
  665. "y": 7
  666. },
  667. "id": 8,
  668. "options": {
  669. "legend": {
  670. "calcs": [],
  671. "displayMode": "list",
  672. "placement": "bottom"
  673. },
  674. "tooltip": {
  675. "mode": "single",
  676. "sort": "none"
  677. }
  678. },
  679. "targets": [
  680. {
  681. "appInsights": {
  682. "dimension": [],
  683. "metricName": "select",
  684. "timeGrain": "auto"
  685. },
  686. "azureLogAnalytics": {
  687. "query": "let startDateTime = $__timeFrom;\nlet endDateTime = $__timeTo;\nlet trendBinSize = (endDateTime - startDateTime)/100;\nlet summary = InsightsMetrics\n| where TimeGenerated between (startDateTime .. endDateTime)\n| where Origin == 'vm.azm.ms' and (Namespace == 'Memory' and Name == 'AvailableMB')\n| parse kind=regex tolower(_ResourceId) with 'resourcegroups/' resGroup '/p(.+)' *\n| where resGroup in~ ($rg)\n| extend ComputerId = iff(isempty(_ResourceId), Computer, _ResourceId)\n| summarize hint.shufflekey=ComputerId $agg by ComputerId, Computer\n| top 10 by score;\nlet computerList=(summary\n| project ComputerId, Computer);\nlet EmptyNodeIdentityAndProps = datatable(ComputerId: string, Computer:string, NodeId:string, NodeProps:dynamic, Priority: long) []; \nlet OmsNodeIdentityAndProps = computerList \n| extend NodeId = ComputerId \n| extend Priority = 1 \n| extend NodeProps = pack('type', 'StandAloneNode', 'name', Computer); \nlet ServiceMapNodeIdentityAndProps = VMComputer \n| where TimeGenerated >= startDateTime \n|where TimeGenerated < endDateTime \n| extend ResourceId = strcat('machines/', Machine) \n| extend tempComputerId=iff(isempty(_ResourceId), Computer, _ResourceId) \n| extend laResourceId = iff(isempty(_ResourceId),'', replace(@'virtualmachinescalesets/(.+)/virtualmachines/(\\\\d+)', @'virtualmachinescalesets/\\\\1/virtualmachines/\\\\1_\\\\2', _ResourceId))\n| extend oldLaResourceId=iff(isempty(_ResourceId),'',replace(@'virtualmachinescalesets/(.+)/virtualmachines/(\\\\d+)',@'virtualmachines/\\\\1_\\\\2', _ResourceId)) \n| where tempComputerId in~ (computerList) or laResourceId in (computerList) or oldLaResourceId in (computerList) \n| extend ComputerId = iff(laResourceId in (computerList), laResourceId, iff(oldLaResourceId in (computerList), oldLaResourceId, tempComputerId)) \n| summarize arg_max(TimeGenerated, *) by Machine \n| extend AzureCloudServiceNodeIdentity = iif(isnotempty(AzureCloudServiceName), strcat(AzureCloudServiceInstanceId, '|', AzureCloudServiceDeployment), ''), AzureScaleSetNodeIdentity = iif(isnotempty(AzureVmScaleSetName), strcat(AzureVmScaleSetInstanceId, '|', AzureVmScaleSetDeployment), ''), ComputerProps = pack('type', 'StandAloneNode', 'name', DisplayName, 'mappingResourceId', ResourceId, 'subscriptionId', AzureSubscriptionId, 'resourceGroup', AzureResourceGroup, 'azureResourceId', _ResourceId), AzureCloudServiceNodeProps = pack('type', 'AzureCloudServiceNode', 'cloudServiceInstanceId', AzureCloudServiceInstanceId, 'cloudServiceRoleName', AzureCloudServiceRoleName, 'cloudServiceDeploymentId', AzureCloudServiceDeployment, 'fullDisplayName', FullDisplayName, 'cloudServiceName', AzureCloudServiceName, 'mappingResourceId', ResourceId), AzureScaleSetNodeProps = pack('type', 'AzureScaleSetNode', 'scaleSetInstanceId', AzureResourceName, 'vmScaleSetDeploymentId', AzureVmScaleSetDeployment, 'vmScaleSetName', AzureVmScaleSetName, 'serviceFabricClusterName', AzureServiceFabricClusterName, 'vmScaleSetResourceId', AzureVmScaleSetResourceId, 'resourceGroupName', AzureResourceGroup, 'subscriptionId', AzureSubscriptionId, 'fullDisplayName', FullDisplayName, 'mappingResourceId', ResourceId) \n| project ComputerId, Computer, NodeId = case(isnotempty(AzureCloudServiceNodeIdentity), AzureCloudServiceNodeIdentity, isnotempty(AzureScaleSetNodeIdentity), AzureScaleSetNodeIdentity, Computer), NodeProps = case(isnotempty(AzureCloudServiceNodeIdentity), AzureCloudServiceNodeProps, isnotempty(AzureScaleSetNodeIdentity), AzureScaleSetNodeProps, ComputerProps), Priority = 2; \nlet NodeIdentityAndProps = union kind=inner isfuzzy = true EmptyNodeIdentityAndProps, OmsNodeIdentityAndProps, ServiceMapNodeIdentityAndProps \n| summarize arg_max(Priority, *) by ComputerId;\nsummary\n| join (InsightsMetrics\n| where TimeGenerated between (startDateTime .. endDateTime)\n| where Origin == 'vm.azm.ms' and (Namespace == 'Memory' and Name == 'AvailableMB')\n| extend ComputerId = iff(isempty(_ResourceId), Computer, _ResourceId)\n| where ComputerId in (computerList)\n| summarize $agg by bin(TimeGenerated, trendBinSize), ComputerId\n| sort by TimeGenerated asc) on ComputerId\n",
  688. "resource": "/subscriptions/$sub",
  689. "resultFormat": "table",
  690. "workspace": ""
  691. },
  692. "azureMonitor": {
  693. "aggOptions": [],
  694. "dimensionFilter": "*",
  695. "dimensionFilters": [],
  696. "timeGrain": "auto",
  697. "timeGrains": [],
  698. "top": "10"
  699. },
  700. "azureResourceGraph": {
  701. "resultFormat": "table"
  702. },
  703. "datasource": {
  704. "type": "grafana-azure-monitor-datasource",
  705. "uid": "${ds}"
  706. },
  707. "insightsAnalytics": {
  708. "query": "",
  709. "resultFormat": "time_series"
  710. },
  711. "queryType": "Azure Log Analytics",
  712. "refId": "A",
  713. "subscription": "",
  714. "subscriptions": []
  715. }
  716. ],
  717. "title": "${agg:text} Available Memory",
  718. "transformations": [
  719. {
  720. "id": "organize",
  721. "options": {
  722. "excludeByName": {
  723. "ComputerId": true,
  724. "ComputerId1": true,
  725. "P5th": true,
  726. "P95th": true,
  727. "score": true
  728. },
  729. "indexByName": {},
  730. "renameByName": {}
  731. }
  732. },
  733. {
  734. "id": "prepareTimeSeries",
  735. "options": {
  736. "format": "many"
  737. }
  738. },
  739. {
  740. "id": "renameByRegex",
  741. "options": {
  742. "regex": "(.+)\\s(.+)",
  743. "renamePattern": "$2"
  744. }
  745. }
  746. ],
  747. "type": "timeseries"
  748. },
  749. {
  750. "datasource": {
  751. "type": "grafana-azure-monitor-datasource",
  752. "uid": "${ds}"
  753. },
  754. "description": "The resource path for this panel uses multiple template variables which requires modifying the dashboard JSON directly. If you would like to do something similar please go to Settings > Save As. Edit as you'd like in your new copy by going to Settings > JSON Model.",
  755. "fieldConfig": {
  756. "defaults": {
  757. "color": {
  758. "mode": "thresholds"
  759. },
  760. "custom": {
  761. "align": "auto",
  762. "displayMode": "auto"
  763. },
  764. "mappings": [],
  765. "thresholds": {
  766. "mode": "absolute",
  767. "steps": [
  768. {
  769. "color": "green",
  770. "value": null
  771. },
  772. {
  773. "color": "red",
  774. "value": 80
  775. }
  776. ]
  777. }
  778. },
  779. "overrides": [
  780. {
  781. "matcher": {
  782. "id": "byName",
  783. "options": "Computer"
  784. },
  785. "properties": [
  786. {
  787. "id": "links",
  788. "value": [
  789. {
  790. "targetBlank": true,
  791. "title": "",
  792. "url": "https://ms.portal.azure.com/#@${__data.fields[\"Tenant ID\"]}/resource/subscriptions/${sub}/resourcegroups/${__data.fields[\"Resource Group\"]}/providers/microsoft.compute/${__data.fields.Type}/${__data.fields[\"Resource Name\"]}/infrainsights"
  793. }
  794. ]
  795. }
  796. ]
  797. },
  798. {
  799. "matcher": {
  800. "id": "byName",
  801. "options": "Min"
  802. },
  803. "properties": [
  804. {
  805. "id": "custom.width",
  806. "value": 94
  807. }
  808. ]
  809. },
  810. {
  811. "matcher": {
  812. "id": "byName",
  813. "options": "P5th"
  814. },
  815. "properties": [
  816. {
  817. "id": "custom.width",
  818. "value": 101
  819. }
  820. ]
  821. },
  822. {
  823. "matcher": {
  824. "id": "byName",
  825. "options": "P10th"
  826. },
  827. "properties": [
  828. {
  829. "id": "custom.width",
  830. "value": 95
  831. }
  832. ]
  833. }
  834. ]
  835. },
  836. "gridPos": {
  837. "h": 12,
  838. "w": 14,
  839. "x": 0,
  840. "y": 17
  841. },
  842. "id": 32,
  843. "options": {
  844. "footer": {
  845. "fields": "",
  846. "reducer": ["sum"],
  847. "show": false
  848. },
  849. "showHeader": true,
  850. "sortBy": []
  851. },
  852. "pluginVersion": "8.4.3",
  853. "targets": [
  854. {
  855. "azureLogAnalytics": {
  856. "query": "let startDateTime = $__timeFrom;\r\nlet endDateTime = $__timeTo;\r\nlet maxResultCount = 10;\r\nlet summaryPerComputer = InsightsMetrics\r\n| where TimeGenerated between (startDateTime .. endDateTime)\r\n| where Origin == 'vm.azm.ms' and (Namespace == 'Memory' and Name == 'AvailableMB')\r\n| parse kind=regex tolower(_ResourceId) with 'resourcegroups/' resGroup '/p(.+)' *\r\n| where resGroup in~ ($rg)\r\n| extend ComputerId = iff(isempty(_ResourceId), Computer, _ResourceId)\r\n| summarize hint.shufflekey = ComputerId Average = round(avg(Val), 2), Min = min(Val), percentiles(Val, 5, 10, 50, 80, 90, 95) by ComputerId, Computer, _ResourceId\r\n| project ComputerId, Computer, Average, Min, P5th = percentile_Val_5, P10th = percentile_Val_10, P50th = percentile_Val_50, P80th = percentile_Val_80,\r\nP90th = percentile_Val_90, P95th = percentile_Val_95, ResourceId = _ResourceId\r\n| top 10 by ${agg:text};\r\nlet computerList = summaryPerComputer\r\n| summarize by ComputerId, Computer;\r\nlet EmptyNodeIdentityAndProps = datatable(ComputerId: string, Computer:string, NodeId:string, NodeProps:dynamic, Priority: long) []; \r\nlet OmsNodeIdentityAndProps = computerList \r\n| extend NodeId = ComputerId \r\n| extend Priority = 1 \r\n| extend NodeProps = pack('type', 'StandAloneNode', 'name', Computer); \r\nlet ServiceMapNodeIdentityAndProps = VMComputer \r\n| where TimeGenerated >= startDateTime \r\n| where TimeGenerated < endDateTime \r\n| extend ResourceId = strcat('machines/', Machine) \r\n| extend tempComputerId=iff(isempty(_ResourceId), Computer, _ResourceId) \r\n| extend laResourceId = iff(isempty(_ResourceId),'', replace(@'virtualmachinescalesets/(.+)/virtualmachines/(\\\\d+)', @'virtualmachinescalesets/\\\\1/virtualmachines/\\\\1_\\\\2', _ResourceId)) \r\n| extend oldLaResourceId=iff(isempty(_ResourceId),'',replace(@'virtualmachinescalesets/(.+)/virtualmachines/(\\\\d+)',@'virtualmachines/\\\\1_\\\\2', _ResourceId)) \r\n| where tempComputerId in~ (computerList) or laResourceId in (computerList) or oldLaResourceId in (computerList) \r\n| extend ComputerId = iff(laResourceId in (computerList), laResourceId, iff(oldLaResourceId in (computerList), oldLaResourceId, tempComputerId)) \r\n| summarize arg_max(TimeGenerated, *) by Machine \r\n| extend AzureCloudServiceNodeIdentity = iif(isnotempty(AzureCloudServiceName), strcat(AzureCloudServiceInstanceId, '|', AzureCloudServiceDeployment), ''), AzureScaleSetNodeIdentity = iif(isnotempty(AzureVmScaleSetName), strcat(AzureVmScaleSetInstanceId, '|', AzureVmScaleSetDeployment), ''), ComputerProps = pack('type', 'StandAloneNode', 'name', DisplayName, 'mappingResourceId', ResourceId, 'subscriptionId', AzureSubscriptionId, 'resourceGroup', AzureResourceGroup, 'azureResourceId', _ResourceId), AzureCloudServiceNodeProps = pack('type', 'AzureCloudServiceNode', 'cloudServiceInstanceId', AzureCloudServiceInstanceId, 'cloudServiceRoleName', AzureCloudServiceRoleName, 'cloudServiceDeploymentId', AzureCloudServiceDeployment, 'fullDisplayName', FullDisplayName, 'cloudServiceName', AzureCloudServiceName, 'mappingResourceId', ResourceId), AzureScaleSetNodeProps = pack('type', 'AzureScaleSetNode', 'scaleSetInstanceId', AzureResourceName, 'vmScaleSetDeploymentId', AzureVmScaleSetDeployment, 'vmScaleSetName', AzureVmScaleSetName, 'serviceFabricClusterName', AzureServiceFabricClusterName, 'vmScaleSetResourceId', AzureVmScaleSetResourceId, 'resourceGroupName', AzureResourceGroup, 'subscriptionId', AzureSubscriptionId, 'fullDisplayName', FullDisplayName, 'mappingResourceId', ResourceId) \r\n| project ComputerId, Computer, NodeId = case(isnotempty(AzureCloudServiceNodeIdentity), AzureCloudServiceNodeIdentity, isnotempty(AzureScaleSetNodeIdentity), AzureScaleSetNodeIdentity, Computer), NodeProps = case(isnotempty(AzureCloudServiceNodeIdentity), AzureCloudServiceNodeProps, isnotempty(AzureScaleSetNodeIdentity), AzureScaleSetNodeProps, ComputerProps), Priority = 2; \r\nlet NodeIdentityAndProps = union kind=inner isfuzzy = true EmptyNodeIdentityAndProps, OmsNodeIdentityAndProps, ServiceMapNodeIdentityAndProps \r\n| summarize arg_max(Priority, *) by ComputerId;\r\nlet trend = InsightsMetrics\r\n| where TimeGenerated between (startDateTime .. endDateTime)\r\n| where Origin == 'vm.azm.ms' and (Namespace == 'Memory' and Name == 'AvailableMB')\r\n| extend ComputerId = iff(isempty(_ResourceId), Computer, _ResourceId)\r\n| where ComputerId in (computerList)\r\n| project ComputerId, Computer;\r\nsummaryPerComputer\r\n| join ( trend ) on ComputerId\r\n| join ( NodeIdentityAndProps ) on ComputerId\r\n| parse tolower(ResourceId) with * \"virtualmachinescalesets/\" scaleSetName \"/virtualmachines/\" vmNameScale\r\n| parse tolower(ResourceId) with * \"virtualmachines/\" vmName\r\n| parse tolower(ResourceId) with * \"resourcegroups/\" resourceGroup \"/providers/microsoft.compute/\" typeVM \"/\" nameVM\r\n| parse tolower(ResourceId) with * \"microsoft.compute/\" typeScale \"/\" nameScale \"/virtualmachines\" remaining\r\n| project resourceGroup, Min, Average, P5th, P10th, P50th, Computer, Type = iff(isnotempty(typeScale), typeScale, typeVM), Name = iff(isnotempty(nameScale), nameScale, nameVM)\r\n\r\n",
  857. "resource": "/subscriptions/$sub",
  858. "resultFormat": "table"
  859. },
  860. "azureMonitor": {
  861. "timeGrain": "auto"
  862. },
  863. "datasource": {
  864. "type": "grafana-azure-monitor-datasource",
  865. "uid": "${ds}"
  866. },
  867. "queryType": "Azure Log Analytics",
  868. "refId": "A",
  869. "subscription": ""
  870. },
  871. {
  872. "azureMonitor": {
  873. "dimensionFilters": [],
  874. "timeGrain": "auto"
  875. },
  876. "azureResourceGraph": {
  877. "query": "resources\r\n| where tolower(type) contains \"virtualmachines\" and resourceGroup in~ ($rg) \r\n| project Name = tolower(name), tenantId, resourceGroup"
  878. },
  879. "datasource": {
  880. "type": "grafana-azure-monitor-datasource",
  881. "uid": "${ds}"
  882. },
  883. "hide": false,
  884. "queryType": "Azure Resource Graph",
  885. "refId": "B",
  886. "subscription": "",
  887. "subscriptions": ["$sub"]
  888. }
  889. ],
  890. "title": "Available Memory Statistics",
  891. "transformations": [
  892. {
  893. "id": "merge",
  894. "options": {}
  895. },
  896. {
  897. "id": "organize",
  898. "options": {
  899. "excludeByName": {
  900. "NodeId": true,
  901. "NodeProps": true,
  902. "ResourceId": true,
  903. "UseRelativeScale": true,
  904. "list_TrendPoint": true
  905. },
  906. "indexByName": {
  907. "Average": 6,
  908. "Computer": 0,
  909. "Min": 2,
  910. "Name": 8,
  911. "P10th": 4,
  912. "P50th": 5,
  913. "P5th": 3,
  914. "Type": 7,
  915. "resourceGroup": 1,
  916. "tenantId": 9
  917. },
  918. "renameByName": {
  919. "Name": "Resource Name",
  920. "Type": "",
  921. "list_TrendPoint": "P5th Trend",
  922. "resGroup": "Resource Group",
  923. "resourceGroup": "Resource Group",
  924. "tenantId": "Tenant ID",
  925. "typeName": "Type/Name"
  926. }
  927. }
  928. },
  929. {
  930. "id": "filterByValue",
  931. "options": {
  932. "filters": [
  933. {
  934. "config": {
  935. "id": "isNotNull",
  936. "options": {}
  937. },
  938. "fieldName": "Computer"
  939. }
  940. ],
  941. "match": "all",
  942. "type": "include"
  943. }
  944. }
  945. ],
  946. "type": "table"
  947. },
  948. {
  949. "datasource": {
  950. "type": "grafana-azure-monitor-datasource",
  951. "uid": "${ds}"
  952. },
  953. "description": "The resource path for this panel uses multiple template variables which requires modifying the dashboard JSON directly. If you would like to do something similar please go to Settings > Save As. Edit as you'd like in your new copy by going to Settings > JSON Model.",
  954. "fieldConfig": {
  955. "defaults": {
  956. "color": {
  957. "fixedColor": "light-green",
  958. "mode": "fixed"
  959. },
  960. "mappings": [],
  961. "thresholds": {
  962. "mode": "absolute",
  963. "steps": [
  964. {
  965. "color": "green",
  966. "value": null
  967. },
  968. {
  969. "color": "red",
  970. "value": 80
  971. }
  972. ]
  973. }
  974. },
  975. "overrides": []
  976. },
  977. "gridPos": {
  978. "h": 12,
  979. "w": 10,
  980. "x": 14,
  981. "y": 17
  982. },
  983. "id": 44,
  984. "options": {
  985. "colorMode": "value",
  986. "graphMode": "area",
  987. "justifyMode": "auto",
  988. "orientation": "auto",
  989. "reduceOptions": {
  990. "calcs": ["min"],
  991. "fields": "",
  992. "values": false
  993. },
  994. "text": {},
  995. "textMode": "value_and_name"
  996. },
  997. "pluginVersion": "8.4.3",
  998. "targets": [
  999. {
  1000. "azureLogAnalytics": {
  1001. "query": "let startDateTime = $__timeFrom;\r\nlet endDateTime = $__timeTo;\r\nlet trendBinSize = (endDateTime - startDateTime)/100;\r\nlet summary = InsightsMetrics\r\n| where TimeGenerated between (startDateTime .. endDateTime)\r\n| where Origin == 'vm.azm.ms' and (Namespace == 'Memory' and Name == 'AvailableMB')\r\n| parse kind=regex tolower(_ResourceId) with 'resourcegroups/' resGroup '/p(.+)' *\r\n| where resGroup in~ ($rg)\r\n| extend ComputerId = iff(isempty(_ResourceId), Computer, _ResourceId)\r\n| summarize hint.shufflekey=ComputerId Average = avg(Val), Min = min(Val),P5th = round(percentile(Val, 5), 2), P10th = round(percentile(Val, 10), 2), \r\nP50th = round(percentile(Val, 50), 2), P80th = round(percentile(Val, 80), 2),\r\nP90th = round(percentile(Val, 90), 2), P95th = round(percentile(Val, 95), 2) by ComputerId, Computer\r\n| top 10 by ${agg:text};\r\nlet computerList=(summary\r\n| project ComputerId, Computer);\r\nlet EmptyNodeIdentityAndProps = datatable(ComputerId: string, Computer:string, NodeId:string, NodeProps:dynamic, Priority: long) []; \r\nlet OmsNodeIdentityAndProps = computerList \r\n| extend NodeId = ComputerId \r\n| extend Priority = 1 \r\n| extend NodeProps = pack('type', 'StandAloneNode', 'name', Computer); \r\nlet ServiceMapNodeIdentityAndProps = VMComputer \r\n| where TimeGenerated >= startDateTime \r\n|where TimeGenerated < endDateTime \r\n| extend ResourceId = strcat('machines/', Machine) \r\n| extend tempComputerId=iff(isempty(_ResourceId), Computer, _ResourceId) \r\n| extend laResourceId = iff(isempty(_ResourceId),'', replace(@'virtualmachinescalesets/(.+)/virtualmachines/(\\\\d+)', @'virtualmachinescalesets/\\\\1/virtualmachines/\\\\1_\\\\2', _ResourceId))\r\n| extend oldLaResourceId=iff(isempty(_ResourceId),'',replace(@'virtualmachinescalesets/(.+)/virtualmachines/(\\\\d+)',@'virtualmachines/\\\\1_\\\\2', _ResourceId)) \r\n| where tempComputerId in~ (computerList) or laResourceId in (computerList) or oldLaResourceId in (computerList) \r\n| extend ComputerId = iff(laResourceId in (computerList), laResourceId, iff(oldLaResourceId in (computerList), oldLaResourceId, tempComputerId)) \r\n| summarize arg_max(TimeGenerated, *) by Machine \r\n| extend AzureCloudServiceNodeIdentity = iif(isnotempty(AzureCloudServiceName), strcat(AzureCloudServiceInstanceId, '|', AzureCloudServiceDeployment), ''), AzureScaleSetNodeIdentity = iif(isnotempty(AzureVmScaleSetName), strcat(AzureVmScaleSetInstanceId, '|', AzureVmScaleSetDeployment), ''), ComputerProps = pack('type', 'StandAloneNode', 'name', DisplayName, 'mappingResourceId', ResourceId, 'subscriptionId', AzureSubscriptionId, 'resourceGroup', AzureResourceGroup, 'azureResourceId', _ResourceId), AzureCloudServiceNodeProps = pack('type', 'AzureCloudServiceNode', 'cloudServiceInstanceId', AzureCloudServiceInstanceId, 'cloudServiceRoleName', AzureCloudServiceRoleName, 'cloudServiceDeploymentId', AzureCloudServiceDeployment, 'fullDisplayName', FullDisplayName, 'cloudServiceName', AzureCloudServiceName, 'mappingResourceId', ResourceId), AzureScaleSetNodeProps = pack('type', 'AzureScaleSetNode', 'scaleSetInstanceId', AzureResourceName, 'vmScaleSetDeploymentId', AzureVmScaleSetDeployment, 'vmScaleSetName', AzureVmScaleSetName, 'serviceFabricClusterName', AzureServiceFabricClusterName, 'vmScaleSetResourceId', AzureVmScaleSetResourceId, 'resourceGroupName', AzureResourceGroup, 'subscriptionId', AzureSubscriptionId, 'fullDisplayName', FullDisplayName, 'mappingResourceId', ResourceId) \r\n| project ComputerId, Computer, NodeId = case(isnotempty(AzureCloudServiceNodeIdentity), AzureCloudServiceNodeIdentity, isnotempty(AzureScaleSetNodeIdentity), AzureScaleSetNodeIdentity, Computer), NodeProps = case(isnotempty(AzureCloudServiceNodeIdentity), AzureCloudServiceNodeProps, isnotempty(AzureScaleSetNodeIdentity), AzureScaleSetNodeProps, ComputerProps), Priority = 2; \r\nlet NodeIdentityAndProps = union kind=inner isfuzzy = true EmptyNodeIdentityAndProps, OmsNodeIdentityAndProps, ServiceMapNodeIdentityAndProps \r\n| summarize arg_max(Priority, *) by ComputerId;\r\nsummary\r\n| join (InsightsMetrics\r\n| where TimeGenerated between (startDateTime .. endDateTime)\r\n| where Origin == 'vm.azm.ms' and (Namespace == 'Memory' and Name == 'AvailableMB')\r\n| extend ComputerId = iff(isempty(_ResourceId), Computer, _ResourceId)\r\n| where ComputerId in (computerList)\r\n| summarize Min = min(Val) by bin(TimeGenerated, trendBinSize), ComputerId\r\n| sort by TimeGenerated asc) on ComputerId\r\n",
  1002. "resource": "/subscriptions/$sub",
  1003. "resultFormat": "table"
  1004. },
  1005. "azureMonitor": {
  1006. "timeGrain": "auto"
  1007. },
  1008. "datasource": {
  1009. "type": "grafana-azure-monitor-datasource",
  1010. "uid": "${ds}"
  1011. },
  1012. "queryType": "Azure Log Analytics",
  1013. "refId": "A"
  1014. }
  1015. ],
  1016. "title": "Min Available Memory and Trend Line",
  1017. "transformations": [
  1018. {
  1019. "id": "organize",
  1020. "options": {
  1021. "excludeByName": {
  1022. "Average": true,
  1023. "ComputerId": true,
  1024. "ComputerId1": true,
  1025. "Min": true,
  1026. "P10th": true,
  1027. "P50th": true,
  1028. "P5th": true,
  1029. "P80th": true,
  1030. "P90th": true,
  1031. "P95th": true
  1032. },
  1033. "indexByName": {},
  1034. "renameByName": {}
  1035. }
  1036. },
  1037. {
  1038. "id": "prepareTimeSeries",
  1039. "options": {
  1040. "format": "many"
  1041. }
  1042. },
  1043. {
  1044. "id": "renameByRegex",
  1045. "options": {
  1046. "regex": "(.+)\\s(.+)",
  1047. "renamePattern": "$2"
  1048. }
  1049. }
  1050. ],
  1051. "type": "stat"
  1052. }
  1053. ],
  1054. "title": "Available Memory",
  1055. "type": "row"
  1056. },
  1057. {
  1058. "collapsed": true,
  1059. "gridPos": {
  1060. "h": 1,
  1061. "w": 24,
  1062. "x": 0,
  1063. "y": 29
  1064. },
  1065. "id": 22,
  1066. "panels": [
  1067. {
  1068. "datasource": {
  1069. "uid": "${ds}"
  1070. },
  1071. "description": "The resource path for this panel uses multiple template variables which requires modifying the dashboard JSON directly. If you would like to do something similar please go to Settings > Save As. Edit as you'd like in your new copy by going to Settings > JSON Model.",
  1072. "fieldConfig": {
  1073. "defaults": {
  1074. "color": {
  1075. "mode": "palette-classic"
  1076. },
  1077. "custom": {
  1078. "axisGridShow": true,
  1079. "axisLabel": "",
  1080. "axisPlacement": "auto",
  1081. "axisSoftMin": 0,
  1082. "barAlignment": 0,
  1083. "drawStyle": "line",
  1084. "fillOpacity": 0,
  1085. "gradientMode": "none",
  1086. "hideFrom": {
  1087. "legend": false,
  1088. "tooltip": false,
  1089. "viz": false
  1090. },
  1091. "lineInterpolation": "linear",
  1092. "lineWidth": 1,
  1093. "pointSize": 5,
  1094. "scaleDistribution": {
  1095. "type": "linear"
  1096. },
  1097. "showPoints": "never",
  1098. "spanNulls": true,
  1099. "stacking": {
  1100. "group": "A",
  1101. "mode": "none"
  1102. },
  1103. "thresholdsStyle": {
  1104. "mode": "off"
  1105. }
  1106. },
  1107. "mappings": [],
  1108. "thresholds": {
  1109. "mode": "absolute",
  1110. "steps": [
  1111. {
  1112. "color": "green",
  1113. "value": null
  1114. },
  1115. {
  1116. "color": "red",
  1117. "value": 80
  1118. }
  1119. ]
  1120. },
  1121. "unit": "Bps"
  1122. },
  1123. "overrides": []
  1124. },
  1125. "gridPos": {
  1126. "h": 11,
  1127. "w": 24,
  1128. "x": 0,
  1129. "y": 8
  1130. },
  1131. "id": 12,
  1132. "options": {
  1133. "legend": {
  1134. "calcs": [],
  1135. "displayMode": "list",
  1136. "placement": "bottom"
  1137. },
  1138. "tooltip": {
  1139. "mode": "single",
  1140. "sort": "none"
  1141. }
  1142. },
  1143. "targets": [
  1144. {
  1145. "appInsights": {
  1146. "dimension": [],
  1147. "metricName": "select",
  1148. "timeGrain": "auto"
  1149. },
  1150. "azureLogAnalytics": {
  1151. "query": "let startDateTime = $__timeFrom;\nlet endDateTime = $__timeTo;\nlet trendBinSize = (endDateTime - startDateTime)/100;\nlet MaxListSize = 1000;\nlet summary = InsightsMetrics\n| where TimeGenerated between (startDateTime .. endDateTime)\n| where Origin == 'vm.azm.ms' and (Namespace == 'Network' and Name == 'WriteBytesPerSecond')\n| parse kind=regex tolower(_ResourceId) with 'resourcegroups/' resGroup '/p(.+)' *\n| where resGroup in~ ($rg)\n| extend ComputerId = iff(isempty(_ResourceId), Computer, _ResourceId)\n| summarize Val = sum(Val) by bin(TimeGenerated, trendBinSize), ComputerId, Computer\n| summarize hint.shufflekey=ComputerId $agg by ComputerId, Computer\n| top 10 by score;\nlet computerList=(summary\n| project ComputerId, Computer);\nlet EmptyNodeIdentityAndProps = datatable(ComputerId: string, Computer:string, NodeId:string, NodeProps:dynamic, Priority: long) []; \nlet OmsNodeIdentityAndProps = computerList \n| extend NodeId = ComputerId \n| extend Priority = 1 \n| extend NodeProps = pack('type', 'StandAloneNode', 'name', Computer); let ServiceMapNodeIdentityAndProps = VMComputer \n| where TimeGenerated >= startDateTime \n| where TimeGenerated < endDateTime \n| extend ResourceId = strcat('machines/', Machine) \n| extend tempComputerId=iff(isempty(_ResourceId), Computer, _ResourceId) \n| extend laResourceId = iff(isempty(_ResourceId),'', replace(@'virtualmachinescalesets/(.+)/virtualmachines/(\\\\d+)', @'virtualmachinescalesets/\\\\1/virtualmachines/\\\\1_\\\\2', _ResourceId))\n| extend oldLaResourceId=iff(isempty(_ResourceId),'',replace(@'virtualmachinescalesets/(.+)/virtualmachines/(\\\\d+)',@'virtualmachines/\\\\1_\\\\2', _ResourceId)) \n| where tempComputerId in~ (computerList) or laResourceId in (computerList) or oldLaResourceId in (computerList) \n| extend ComputerId = iff(laResourceId in (computerList), laResourceId, iff(oldLaResourceId in (computerList), oldLaResourceId, tempComputerId)) \n| summarize arg_max(TimeGenerated, *) by Machine \n| extend AzureCloudServiceNodeIdentity = iif(isnotempty(AzureCloudServiceName), strcat(AzureCloudServiceInstanceId, '|', AzureCloudServiceDeployment), ''), AzureScaleSetNodeIdentity = iif(isnotempty(AzureVmScaleSetName), strcat(AzureVmScaleSetInstanceId, '|', AzureVmScaleSetDeployment), ''), ComputerProps = pack('type', 'StandAloneNode', 'name', DisplayName, 'mappingResourceId', ResourceId, 'subscriptionId', AzureSubscriptionId, 'resourceGroup', AzureResourceGroup, 'azureResourceId', _ResourceId), AzureCloudServiceNodeProps = pack('type', 'AzureCloudServiceNode', 'cloudServiceInstanceId', AzureCloudServiceInstanceId, 'cloudServiceRoleName', AzureCloudServiceRoleName, 'cloudServiceDeploymentId', AzureCloudServiceDeployment, 'fullDisplayName', FullDisplayName, 'cloudServiceName', AzureCloudServiceName, 'mappingResourceId', ResourceId), AzureScaleSetNodeProps = pack('type', 'AzureScaleSetNode', 'scaleSetInstanceId', AzureResourceName, 'vmScaleSetDeploymentId', AzureVmScaleSetDeployment, 'vmScaleSetName', AzureVmScaleSetName, 'serviceFabricClusterName', AzureServiceFabricClusterName, 'vmScaleSetResourceId', AzureVmScaleSetResourceId, 'resourceGroupName', AzureResourceGroup, 'subscriptionId', AzureSubscriptionId, 'fullDisplayName', FullDisplayName, 'mappingResourceId', ResourceId) \n| project ComputerId, Computer, NodeId = case(isnotempty(AzureCloudServiceNodeIdentity), AzureCloudServiceNodeIdentity, isnotempty(AzureScaleSetNodeIdentity), AzureScaleSetNodeIdentity, Computer), NodeProps = case(isnotempty(AzureCloudServiceNodeIdentity), AzureCloudServiceNodeProps, isnotempty(AzureScaleSetNodeIdentity), AzureScaleSetNodeProps, ComputerProps), Priority = 2; let NodeIdentityAndProps = union kind=inner isfuzzy = true EmptyNodeIdentityAndProps, OmsNodeIdentityAndProps, ServiceMapNodeIdentityAndProps \n| summarize arg_max(Priority, *) by ComputerId;summary\n| join (InsightsMetrics\n| where TimeGenerated between (startDateTime .. endDateTime)\n| where Origin == 'vm.azm.ms' and (Namespace == 'Network' and Name == 'WriteBytesPerSecond')\n| extend ComputerId = iff(isempty(_ResourceId), Computer, _ResourceId)\n| where ComputerId in (computerList)\n| summarize Val = sum(Val) by bin(TimeGenerated, trendBinSize), ComputerId, Computer\n| summarize $agg by bin(TimeGenerated, trendBinSize), ComputerId\n| sort by TimeGenerated asc) on ComputerId\n",
  1152. "resource": "/subscriptions/$sub",
  1153. "resultFormat": "table",
  1154. "workspace": ""
  1155. },
  1156. "azureMonitor": {
  1157. "aggOptions": [],
  1158. "dimensionFilter": "*",
  1159. "dimensionFilters": [],
  1160. "timeGrain": "auto",
  1161. "timeGrains": [],
  1162. "top": "10"
  1163. },
  1164. "azureResourceGraph": {
  1165. "resultFormat": "table"
  1166. },
  1167. "insightsAnalytics": {
  1168. "query": "",
  1169. "resultFormat": "time_series"
  1170. },
  1171. "queryType": "Azure Log Analytics",
  1172. "refId": "A",
  1173. "subscription": "",
  1174. "subscriptions": []
  1175. }
  1176. ],
  1177. "title": "${agg:text} Bytes Sent Rate",
  1178. "transformations": [
  1179. {
  1180. "id": "organize",
  1181. "options": {
  1182. "excludeByName": {
  1183. "Computer": false,
  1184. "ComputerId": true,
  1185. "ComputerId1": true,
  1186. "P5th": true,
  1187. "P95th": true,
  1188. "score": true
  1189. },
  1190. "indexByName": {},
  1191. "renameByName": {}
  1192. }
  1193. },
  1194. {
  1195. "id": "prepareTimeSeries",
  1196. "options": {
  1197. "format": "many"
  1198. }
  1199. },
  1200. {
  1201. "id": "renameByRegex",
  1202. "options": {
  1203. "regex": "(.+)\\s(.+)",
  1204. "renamePattern": "$2"
  1205. }
  1206. }
  1207. ],
  1208. "type": "timeseries"
  1209. },
  1210. {
  1211. "datasource": {
  1212. "type": "grafana-azure-monitor-datasource",
  1213. "uid": "${ds}"
  1214. },
  1215. "description": "The resource path for this panel uses multiple template variables which requires modifying the dashboard JSON directly. If you would like to do something similar please go to Settings > Save As. Edit as you'd like in your new copy by going to Settings > JSON Model.",
  1216. "fieldConfig": {
  1217. "defaults": {
  1218. "color": {
  1219. "mode": "thresholds"
  1220. },
  1221. "custom": {
  1222. "align": "auto",
  1223. "displayMode": "auto"
  1224. },
  1225. "mappings": [],
  1226. "thresholds": {
  1227. "mode": "absolute",
  1228. "steps": [
  1229. {
  1230. "color": "green",
  1231. "value": null
  1232. },
  1233. {
  1234. "color": "red",
  1235. "value": 80
  1236. }
  1237. ]
  1238. }
  1239. },
  1240. "overrides": [
  1241. {
  1242. "matcher": {
  1243. "id": "byName",
  1244. "options": "Computer"
  1245. },
  1246. "properties": [
  1247. {
  1248. "id": "links",
  1249. "value": [
  1250. {
  1251. "targetBlank": true,
  1252. "title": "",
  1253. "url": "https://ms.portal.azure.com/#@${__data.fields[\"Tenant ID\"]}/resource/subscriptions/${sub}/resourcegroups/${__data.fields[\"Resource Group\"]}/providers/microsoft.compute/${__data.fields.Type}/${__data.fields[\"Resource Name\"]}/infrainsights"
  1254. }
  1255. ]
  1256. }
  1257. ]
  1258. },
  1259. {
  1260. "matcher": {
  1261. "id": "byName",
  1262. "options": "Average"
  1263. },
  1264. "properties": [
  1265. {
  1266. "id": "custom.width",
  1267. "value": 97
  1268. }
  1269. ]
  1270. },
  1271. {
  1272. "matcher": {
  1273. "id": "byName",
  1274. "options": "P50th"
  1275. },
  1276. "properties": [
  1277. {
  1278. "id": "custom.width",
  1279. "value": 108
  1280. }
  1281. ]
  1282. },
  1283. {
  1284. "matcher": {
  1285. "id": "byName",
  1286. "options": "P90th"
  1287. },
  1288. "properties": [
  1289. {
  1290. "id": "custom.width",
  1291. "value": 114
  1292. }
  1293. ]
  1294. },
  1295. {
  1296. "matcher": {
  1297. "id": "byName",
  1298. "options": "P95th"
  1299. },
  1300. "properties": [
  1301. {
  1302. "id": "custom.width",
  1303. "value": 104
  1304. }
  1305. ]
  1306. },
  1307. {
  1308. "matcher": {
  1309. "id": "byName",
  1310. "options": "Max"
  1311. },
  1312. "properties": [
  1313. {
  1314. "id": "custom.width",
  1315. "value": 106
  1316. }
  1317. ]
  1318. }
  1319. ]
  1320. },
  1321. "gridPos": {
  1322. "h": 12,
  1323. "w": 14,
  1324. "x": 0,
  1325. "y": 19
  1326. },
  1327. "id": 34,
  1328. "options": {
  1329. "footer": {
  1330. "fields": "",
  1331. "reducer": ["sum"],
  1332. "show": false
  1333. },
  1334. "showHeader": true,
  1335. "sortBy": []
  1336. },
  1337. "pluginVersion": "8.4.3",
  1338. "targets": [
  1339. {
  1340. "azureLogAnalytics": {
  1341. "query": "let startDateTime = $__timeFrom;\r\nlet endDateTime = $__timeTo;\r\nlet trendBinSize = 5m;\r\nlet maxResultCount = 10;\r\nlet summaryPerComputer = InsightsMetrics\r\n| where TimeGenerated between (startDateTime .. endDateTime)\r\n| where Origin == 'vm.azm.ms' and (Namespace == 'Network' and Name == 'WriteBytesPerSecond')\r\n| extend ComputerId = iff(isempty(_ResourceId), Computer, _ResourceId)\r\n| summarize Val = sum(Val) by bin(TimeGenerated, 1m), ComputerId, Computer, _ResourceId\r\n| summarize hint.shufflekey = ComputerId Average = avg(Val), Max = max(Val), percentiles(Val, 5, 10, 50, 90, 95) by ComputerId, Computer, _ResourceId\r\n| project ComputerId, Computer, Average, Max, P5th = percentile_Val_5, P10th = percentile_Val_10, P50th = percentile_Val_50, P90th = percentile_Val_90, P95th = percentile_Val_95, ResourceId = _ResourceId\r\n| top 10 by ${agg:text};\r\nlet computerList = summaryPerComputer\r\n| summarize by ComputerId, Computer;\r\nlet EmptyNodeIdentityAndProps = datatable(ComputerId: string, Computer:string, NodeId:string, NodeProps:dynamic, Priority: long) []; \r\nlet OmsNodeIdentityAndProps = computerList \r\n| extend NodeId = ComputerId \r\n| extend Priority = 1 \r\n| extend NodeProps = pack('type', 'StandAloneNode', 'name', Computer); \r\nlet ServiceMapNodeIdentityAndProps = VMComputer \r\n| where TimeGenerated >= startDateTime \r\n| where TimeGenerated < endDateTime \r\n| extend ResourceId = strcat('machines/', Machine) \r\n| extend tempComputerId=iff(isempty(_ResourceId), Computer, _ResourceId) \r\n| extend laResourceId = iff(isempty(_ResourceId),'', replace(@'virtualmachinescalesets/(.+)/virtualmachines/(\\\\d+)', @'virtualmachinescalesets/\\\\1/virtualmachines/\\\\1_\\\\2', _ResourceId)) \r\n| extend oldLaResourceId=iff(isempty(_ResourceId),'',replace(@'virtualmachinescalesets/(.+)/virtualmachines/(\\\\d+)',@'virtualmachines/\\\\1_\\\\2', _ResourceId)) \r\n| where tempComputerId in~ (computerList) or laResourceId in (computerList) or oldLaResourceId in (computerList) \r\n| extend ComputerId = iff(laResourceId in (computerList), laResourceId, iff(oldLaResourceId in (computerList), oldLaResourceId, tempComputerId)) \r\n| summarize arg_max(TimeGenerated, *) by Machine \r\n| extend AzureCloudServiceNodeIdentity = iif(isnotempty(AzureCloudServiceName), strcat(AzureCloudServiceInstanceId, '|', AzureCloudServiceDeployment), ''), AzureScaleSetNodeIdentity = iif(isnotempty(AzureVmScaleSetName), strcat(AzureVmScaleSetInstanceId, '|', AzureVmScaleSetDeployment), ''), ComputerProps = pack('type', 'StandAloneNode', 'name', DisplayName, 'mappingResourceId', ResourceId, 'subscriptionId', AzureSubscriptionId, 'resourceGroup', AzureResourceGroup, 'azureResourceId', _ResourceId), AzureCloudServiceNodeProps = pack('type', 'AzureCloudServiceNode', 'cloudServiceInstanceId', AzureCloudServiceInstanceId, 'cloudServiceRoleName', AzureCloudServiceRoleName, 'cloudServiceDeploymentId', AzureCloudServiceDeployment, 'fullDisplayName', FullDisplayName, 'cloudServiceName', AzureCloudServiceName, 'mappingResourceId', ResourceId), AzureScaleSetNodeProps = pack('type', 'AzureScaleSetNode', 'scaleSetInstanceId', AzureResourceName, 'vmScaleSetDeploymentId', AzureVmScaleSetDeployment, 'vmScaleSetName', AzureVmScaleSetName, 'serviceFabricClusterName', AzureServiceFabricClusterName, 'vmScaleSetResourceId', AzureVmScaleSetResourceId, 'resourceGroupName', AzureResourceGroup, 'subscriptionId', AzureSubscriptionId, 'fullDisplayName', FullDisplayName, 'mappingResourceId', ResourceId) \r\n| project ComputerId, Computer, NodeId = case(isnotempty(AzureCloudServiceNodeIdentity), AzureCloudServiceNodeIdentity, isnotempty(AzureScaleSetNodeIdentity), AzureScaleSetNodeIdentity, Computer), NodeProps = case(isnotempty(AzureCloudServiceNodeIdentity), AzureCloudServiceNodeProps, isnotempty(AzureScaleSetNodeIdentity), AzureScaleSetNodeProps, ComputerProps), Priority = 2; \r\nlet NodeIdentityAndProps = union kind=inner isfuzzy = true EmptyNodeIdentityAndProps, OmsNodeIdentityAndProps, ServiceMapNodeIdentityAndProps \r\n| summarize arg_max(Priority, *) by ComputerId;\r\nlet trend = InsightsMetrics\r\n| where TimeGenerated between (startDateTime .. endDateTime)\r\n| where Origin == 'vm.azm.ms' and (Namespace == 'Network' and Name == 'WriteBytesPerSecond')\r\n| extend ComputerId = iff(isempty(_ResourceId), Computer, _ResourceId)\r\n| where ComputerId in (computerList)\r\n| summarize Val = sum(Val) by bin(TimeGenerated, 1m), ComputerId, Computer, _ResourceId\r\n| summarize hint.shufflekey = ComputerId TrendValue = percentile(Val, 95) by ComputerId, Computer, bin(TimeGenerated, trendBinSize)\r\n| project ComputerId, Computer\r\n| summarize hint.shufflekey = ComputerId by ComputerId, Computer;\r\nsummaryPerComputer\r\n| join ( trend ) on ComputerId\r\n| join ( NodeIdentityAndProps ) on ComputerId\r\n| parse tolower(ResourceId) with * \"virtualmachinescalesets/\" scaleSetName \"/virtualmachines/\" vmNameScale\r\n| parse tolower(ResourceId) with * \"virtualmachines/\" vmName\r\n| parse tolower(ResourceId) with * \"resourcegroups/\" resourceGroup \"/providers/microsoft.compute/\" typeVM \"/\" nameVM\r\n| parse tolower(ResourceId) with * \"microsoft.compute/\" typeScale \"/\" nameScale \"/virtualmachines\" remaining\r\n| project resourceGroup, Average, P50th, P90th, P95th, Max, Computer, Type = iff(isnotempty(typeScale), typeScale, typeVM), Name = iff(isnotempty(nameScale), nameScale, nameVM)\r\n",
  1342. "resource": "/subscriptions/$sub",
  1343. "resultFormat": "table"
  1344. },
  1345. "azureMonitor": {
  1346. "timeGrain": "auto"
  1347. },
  1348. "datasource": {
  1349. "type": "grafana-azure-monitor-datasource",
  1350. "uid": "${ds}"
  1351. },
  1352. "queryType": "Azure Log Analytics",
  1353. "refId": "A",
  1354. "subscription": ""
  1355. },
  1356. {
  1357. "azureMonitor": {
  1358. "dimensionFilters": [],
  1359. "timeGrain": "auto"
  1360. },
  1361. "azureResourceGraph": {
  1362. "query": "resources\r\n| where tolower(type) contains \"virtualmachines\" and resourceGroup in~ ($rg) \r\n| project Name = tolower(name), tenantId, resourceGroup"
  1363. },
  1364. "datasource": {
  1365. "type": "grafana-azure-monitor-datasource",
  1366. "uid": "${ds}"
  1367. },
  1368. "hide": false,
  1369. "queryType": "Azure Resource Graph",
  1370. "refId": "B",
  1371. "subscription": "",
  1372. "subscriptions": ["$sub"]
  1373. }
  1374. ],
  1375. "title": "Available Bytes Sent Statistics",
  1376. "transformations": [
  1377. {
  1378. "id": "merge",
  1379. "options": {}
  1380. },
  1381. {
  1382. "id": "organize",
  1383. "options": {
  1384. "excludeByName": {
  1385. "NodeId": true,
  1386. "NodeProps": true,
  1387. "ResourceId": true,
  1388. "UseRelativeScale": true
  1389. },
  1390. "indexByName": {
  1391. "Average": 2,
  1392. "Computer": 0,
  1393. "Max": 6,
  1394. "Name": 8,
  1395. "P50th": 3,
  1396. "P90th": 4,
  1397. "P95th": 5,
  1398. "Type": 7,
  1399. "resourceGroup": 1,
  1400. "tenantId": 9
  1401. },
  1402. "renameByName": {
  1403. "Name": "Resource Name",
  1404. "list_TrendPoint": "Trend 95th",
  1405. "resGroup": "Resource Group",
  1406. "resourceGroup": "Resource Group",
  1407. "tenantId": "Tenant ID",
  1408. "typeName": "Type/Name"
  1409. }
  1410. }
  1411. },
  1412. {
  1413. "id": "filterByValue",
  1414. "options": {
  1415. "filters": [
  1416. {
  1417. "config": {
  1418. "id": "isNotNull",
  1419. "options": {}
  1420. },
  1421. "fieldName": "Computer"
  1422. }
  1423. ],
  1424. "match": "all",
  1425. "type": "include"
  1426. }
  1427. }
  1428. ],
  1429. "type": "table"
  1430. },
  1431. {
  1432. "datasource": {
  1433. "type": "grafana-azure-monitor-datasource",
  1434. "uid": "${ds}"
  1435. },
  1436. "description": "The resource path for this panel uses multiple template variables which requires modifying the dashboard JSON directly. If you would like to do something similar please go to Settings > Save As. Edit as you'd like in your new copy by going to Settings > JSON Model.",
  1437. "fieldConfig": {
  1438. "defaults": {
  1439. "color": {
  1440. "fixedColor": "light-green",
  1441. "mode": "fixed"
  1442. },
  1443. "mappings": [],
  1444. "thresholds": {
  1445. "mode": "absolute",
  1446. "steps": [
  1447. {
  1448. "color": "green",
  1449. "value": null
  1450. },
  1451. {
  1452. "color": "red",
  1453. "value": 80
  1454. }
  1455. ]
  1456. }
  1457. },
  1458. "overrides": []
  1459. },
  1460. "gridPos": {
  1461. "h": 12,
  1462. "w": 10,
  1463. "x": 14,
  1464. "y": 19
  1465. },
  1466. "id": 48,
  1467. "options": {
  1468. "colorMode": "value",
  1469. "graphMode": "area",
  1470. "justifyMode": "auto",
  1471. "orientation": "auto",
  1472. "reduceOptions": {
  1473. "calcs": ["max"],
  1474. "fields": "",
  1475. "values": false
  1476. },
  1477. "text": {},
  1478. "textMode": "auto"
  1479. },
  1480. "pluginVersion": "8.4.3",
  1481. "targets": [
  1482. {
  1483. "azureLogAnalytics": {
  1484. "query": "let startDateTime = $__timeFrom;\r\nlet endDateTime = $__timeTo;\r\nlet trendBinSize = (endDateTime - startDateTime)/100;\r\nlet MaxListSize = 1000;\r\nlet summary = InsightsMetrics\r\n| where TimeGenerated between (startDateTime .. endDateTime)\r\n| where Origin == 'vm.azm.ms' and (Namespace == 'Network' and Name == 'WriteBytesPerSecond')\r\n| parse kind=regex tolower(_ResourceId) with 'resourcegroups/' resGroup '/p(.+)' *\r\n| where resGroup in~ ($rg)\r\n| extend ComputerId = iff(isempty(_ResourceId), Computer, _ResourceId)\r\n| summarize Val = sum(Val) by bin(TimeGenerated, trendBinSize), ComputerId, Computer\r\n| summarize hint.shufflekey=ComputerId Average = avg(Val), Min = min(Val),P5th = round(percentile(Val, 5), 2), P10th = round(percentile(Val, 10), 2), \r\nP50th = round(percentile(Val, 50), 2), P80th = round(percentile(Val, 80), 2),\r\nP90th = round(percentile(Val, 90), 2), P95th = round(percentile(Val, 95), 2) by ComputerId, Computer\r\n| top 10 by ${agg:text};\r\nlet computerList=(summary\r\n| project ComputerId, Computer);\r\nlet EmptyNodeIdentityAndProps = datatable(ComputerId: string, Computer:string, NodeId:string, NodeProps:dynamic, Priority: long) []; \r\nlet OmsNodeIdentityAndProps = computerList \r\n| extend NodeId = ComputerId \r\n| extend Priority = 1 \r\n| extend NodeProps = pack('type', 'StandAloneNode', 'name', Computer); let ServiceMapNodeIdentityAndProps = VMComputer \r\n| where TimeGenerated >= startDateTime \r\n| where TimeGenerated < endDateTime \r\n| extend ResourceId = strcat('machines/', Machine) \r\n| extend tempComputerId=iff(isempty(_ResourceId), Computer, _ResourceId) \r\n| extend laResourceId = iff(isempty(_ResourceId),'', replace(@'virtualmachinescalesets/(.+)/virtualmachines/(\\\\d+)', @'virtualmachinescalesets/\\\\1/virtualmachines/\\\\1_\\\\2', _ResourceId))\r\n| extend oldLaResourceId=iff(isempty(_ResourceId),'',replace(@'virtualmachinescalesets/(.+)/virtualmachines/(\\\\d+)',@'virtualmachines/\\\\1_\\\\2', _ResourceId)) \r\n| where tempComputerId in~ (computerList) or laResourceId in (computerList) or oldLaResourceId in (computerList) \r\n| extend ComputerId = iff(laResourceId in (computerList), laResourceId, iff(oldLaResourceId in (computerList), oldLaResourceId, tempComputerId)) \r\n| summarize arg_max(TimeGenerated, *) by Machine \r\n| extend AzureCloudServiceNodeIdentity = iif(isnotempty(AzureCloudServiceName), strcat(AzureCloudServiceInstanceId, '|', AzureCloudServiceDeployment), ''), AzureScaleSetNodeIdentity = iif(isnotempty(AzureVmScaleSetName), strcat(AzureVmScaleSetInstanceId, '|', AzureVmScaleSetDeployment), ''), ComputerProps = pack('type', 'StandAloneNode', 'name', DisplayName, 'mappingResourceId', ResourceId, 'subscriptionId', AzureSubscriptionId, 'resourceGroup', AzureResourceGroup, 'azureResourceId', _ResourceId), AzureCloudServiceNodeProps = pack('type', 'AzureCloudServiceNode', 'cloudServiceInstanceId', AzureCloudServiceInstanceId, 'cloudServiceRoleName', AzureCloudServiceRoleName, 'cloudServiceDeploymentId', AzureCloudServiceDeployment, 'fullDisplayName', FullDisplayName, 'cloudServiceName', AzureCloudServiceName, 'mappingResourceId', ResourceId), AzureScaleSetNodeProps = pack('type', 'AzureScaleSetNode', 'scaleSetInstanceId', AzureResourceName, 'vmScaleSetDeploymentId', AzureVmScaleSetDeployment, 'vmScaleSetName', AzureVmScaleSetName, 'serviceFabricClusterName', AzureServiceFabricClusterName, 'vmScaleSetResourceId', AzureVmScaleSetResourceId, 'resourceGroupName', AzureResourceGroup, 'subscriptionId', AzureSubscriptionId, 'fullDisplayName', FullDisplayName, 'mappingResourceId', ResourceId) \r\n| project ComputerId, Computer, NodeId = case(isnotempty(AzureCloudServiceNodeIdentity), AzureCloudServiceNodeIdentity, isnotempty(AzureScaleSetNodeIdentity), AzureScaleSetNodeIdentity, Computer), NodeProps = case(isnotempty(AzureCloudServiceNodeIdentity), AzureCloudServiceNodeProps, isnotempty(AzureScaleSetNodeIdentity), AzureScaleSetNodeProps, ComputerProps), Priority = 2; let NodeIdentityAndProps = union kind=inner isfuzzy = true EmptyNodeIdentityAndProps, OmsNodeIdentityAndProps, ServiceMapNodeIdentityAndProps \r\n| summarize arg_max(Priority, *) by ComputerId;summary\r\n| join (InsightsMetrics\r\n| where TimeGenerated between (startDateTime .. endDateTime)\r\n| where Origin == 'vm.azm.ms' and (Namespace == 'Network' and Name == 'WriteBytesPerSecond')\r\n| extend ComputerId = iff(isempty(_ResourceId), Computer, _ResourceId)\r\n| where ComputerId in (computerList)\r\n| summarize Val = sum(Val) by bin(TimeGenerated, trendBinSize), ComputerId, Computer\r\n| summarize Max = max(Val) by bin(TimeGenerated, trendBinSize), ComputerId\r\n| sort by TimeGenerated asc) on ComputerId\r\n",
  1485. "resource": "/subscriptions/$sub",
  1486. "resultFormat": "table"
  1487. },
  1488. "azureMonitor": {
  1489. "timeGrain": "auto"
  1490. },
  1491. "datasource": {
  1492. "type": "grafana-azure-monitor-datasource",
  1493. "uid": "${ds}"
  1494. },
  1495. "queryType": "Azure Log Analytics",
  1496. "refId": "A",
  1497. "subscription": ""
  1498. }
  1499. ],
  1500. "title": "Max Available Bytes Sent and Trend Line",
  1501. "transformations": [
  1502. {
  1503. "id": "organize",
  1504. "options": {
  1505. "excludeByName": {
  1506. "Average": true,
  1507. "ComputerId": true,
  1508. "ComputerId1": true,
  1509. "Min": true,
  1510. "P10th": true,
  1511. "P50th": true,
  1512. "P5th": true,
  1513. "P80th": true,
  1514. "P90th": true,
  1515. "P95th": true
  1516. },
  1517. "indexByName": {},
  1518. "renameByName": {}
  1519. }
  1520. },
  1521. {
  1522. "id": "prepareTimeSeries",
  1523. "options": {
  1524. "format": "many"
  1525. }
  1526. },
  1527. {
  1528. "id": "renameByRegex",
  1529. "options": {
  1530. "regex": "(.+)\\s(.+)",
  1531. "renamePattern": "$2"
  1532. }
  1533. }
  1534. ],
  1535. "type": "stat"
  1536. }
  1537. ],
  1538. "title": "Network Bytes Sent",
  1539. "type": "row"
  1540. },
  1541. {
  1542. "collapsed": true,
  1543. "gridPos": {
  1544. "h": 1,
  1545. "w": 24,
  1546. "x": 0,
  1547. "y": 30
  1548. },
  1549. "id": 36,
  1550. "panels": [
  1551. {
  1552. "datasource": {
  1553. "uid": "${ds}"
  1554. },
  1555. "description": "The resource path for this panel uses multiple template variables which requires modifying the dashboard JSON directly. If you would like to do something similar please go to Settings > Save As. Edit as you'd like in your new copy by going to Settings > JSON Model.",
  1556. "fieldConfig": {
  1557. "defaults": {
  1558. "color": {
  1559. "mode": "palette-classic"
  1560. },
  1561. "custom": {
  1562. "axisGridShow": true,
  1563. "axisLabel": "",
  1564. "axisPlacement": "auto",
  1565. "axisSoftMin": 0,
  1566. "barAlignment": 0,
  1567. "drawStyle": "line",
  1568. "fillOpacity": 0,
  1569. "gradientMode": "none",
  1570. "hideFrom": {
  1571. "legend": false,
  1572. "tooltip": false,
  1573. "viz": false
  1574. },
  1575. "lineInterpolation": "linear",
  1576. "lineWidth": 1,
  1577. "pointSize": 5,
  1578. "scaleDistribution": {
  1579. "type": "linear"
  1580. },
  1581. "showPoints": "never",
  1582. "spanNulls": true,
  1583. "stacking": {
  1584. "group": "A",
  1585. "mode": "none"
  1586. },
  1587. "thresholdsStyle": {
  1588. "mode": "off"
  1589. }
  1590. },
  1591. "mappings": [],
  1592. "thresholds": {
  1593. "mode": "absolute",
  1594. "steps": [
  1595. {
  1596. "color": "green",
  1597. "value": null
  1598. },
  1599. {
  1600. "color": "red",
  1601. "value": 80
  1602. }
  1603. ]
  1604. },
  1605. "unit": "Bps"
  1606. },
  1607. "overrides": []
  1608. },
  1609. "gridPos": {
  1610. "h": 11,
  1611. "w": 24,
  1612. "x": 0,
  1613. "y": 9
  1614. },
  1615. "id": 16,
  1616. "options": {
  1617. "legend": {
  1618. "calcs": [],
  1619. "displayMode": "list",
  1620. "placement": "bottom"
  1621. },
  1622. "tooltip": {
  1623. "mode": "single",
  1624. "sort": "none"
  1625. }
  1626. },
  1627. "targets": [
  1628. {
  1629. "appInsights": {
  1630. "dimension": [],
  1631. "metricName": "select",
  1632. "timeGrain": "auto"
  1633. },
  1634. "azureLogAnalytics": {
  1635. "query": "let startDateTime = $__timeFrom;\nlet endDateTime = $__timeTo;\nlet trendBinSize = (endDateTime - startDateTime)/100;\nlet MaxListSize = 1000;\nlet summary = InsightsMetrics\n| where TimeGenerated between (startDateTime .. endDateTime)\n| where Origin == 'vm.azm.ms' and (Namespace == 'Network' and Name == 'ReadBytesPerSecond')\n| parse kind=regex tolower(_ResourceId) with 'resourcegroups/' resGroup '/p(.+)' *\n| where resGroup in~ ($rg)\n| extend ComputerId = iff(isempty(_ResourceId), Computer, _ResourceId)\n| summarize Val = sum(Val) by bin(TimeGenerated, trendBinSize), ComputerId, Computer\n| summarize hint.shufflekey=ComputerId $agg by ComputerId, Computer\n| top 10 by score;\nlet computerList=(summary\n| project ComputerId, Computer);\nlet EmptyNodeIdentityAndProps = datatable(ComputerId: string, Computer:string, NodeId:string, NodeProps:dynamic, Priority: long) []; let OmsNodeIdentityAndProps = computerList \n| extend NodeId = ComputerId \n| extend Priority = 1 \n| extend NodeProps = pack('type', 'StandAloneNode', 'name', Computer); \nlet ServiceMapNodeIdentityAndProps = VMComputer \n| where TimeGenerated >= startDateTime \n| where TimeGenerated < endDateTime \n| extend ResourceId = strcat('machines/', Machine) \n| extend tempComputerId=iff(isempty(_ResourceId), Computer, _ResourceId) \n| extend laResourceId = iff(isempty(_ResourceId),'', replace(@'virtualmachinescalesets/(.+)/virtualmachines/(\\\\d+)', @'virtualmachinescalesets/\\\\1/virtualmachines/\\\\1_\\\\2', _ResourceId))\n| extend oldLaResourceId=iff(isempty(_ResourceId),'',replace(@'virtualmachinescalesets/(.+)/virtualmachines/(\\\\d+)',@'virtualmachines/\\\\1_\\\\2', _ResourceId)) \n| where tempComputerId in~ (computerList) or laResourceId in (computerList) or oldLaResourceId in (computerList) \n| extend ComputerId = iff(laResourceId in (computerList), laResourceId, iff(oldLaResourceId in (computerList), oldLaResourceId, tempComputerId)) \n| summarize arg_max(TimeGenerated, *) by Machine \n| extend AzureCloudServiceNodeIdentity = iif(isnotempty(AzureCloudServiceName), strcat(AzureCloudServiceInstanceId, '|', AzureCloudServiceDeployment), ''), AzureScaleSetNodeIdentity = iif(isnotempty(AzureVmScaleSetName), strcat(AzureVmScaleSetInstanceId, '|', AzureVmScaleSetDeployment), ''), ComputerProps = pack('type', 'StandAloneNode', 'name', DisplayName, 'mappingResourceId', ResourceId, 'subscriptionId', AzureSubscriptionId, 'resourceGroup', AzureResourceGroup, 'azureResourceId', _ResourceId), AzureCloudServiceNodeProps = pack('type', 'AzureCloudServiceNode', 'cloudServiceInstanceId', AzureCloudServiceInstanceId, 'cloudServiceRoleName', AzureCloudServiceRoleName, 'cloudServiceDeploymentId', AzureCloudServiceDeployment, 'fullDisplayName', FullDisplayName, 'cloudServiceName', AzureCloudServiceName, 'mappingResourceId', ResourceId), AzureScaleSetNodeProps = pack('type', 'AzureScaleSetNode', 'scaleSetInstanceId', AzureResourceName, 'vmScaleSetDeploymentId', AzureVmScaleSetDeployment, 'vmScaleSetName', AzureVmScaleSetName, 'serviceFabricClusterName', AzureServiceFabricClusterName, 'vmScaleSetResourceId', AzureVmScaleSetResourceId, 'resourceGroupName', AzureResourceGroup, 'subscriptionId', AzureSubscriptionId, 'fullDisplayName', FullDisplayName, 'mappingResourceId', ResourceId) \n| project ComputerId, Computer, NodeId = case(isnotempty(AzureCloudServiceNodeIdentity), AzureCloudServiceNodeIdentity, isnotempty(AzureScaleSetNodeIdentity), AzureScaleSetNodeIdentity, Computer), NodeProps = case(isnotempty(AzureCloudServiceNodeIdentity), AzureCloudServiceNodeProps, isnotempty(AzureScaleSetNodeIdentity), AzureScaleSetNodeProps, ComputerProps), Priority = 2; let NodeIdentityAndProps = union kind=inner isfuzzy = true EmptyNodeIdentityAndProps, OmsNodeIdentityAndProps, ServiceMapNodeIdentityAndProps \n| summarize arg_max(Priority, *) by ComputerId;\nsummary\n| join (InsightsMetrics\n| where TimeGenerated between (startDateTime .. endDateTime)\n| where Origin == 'vm.azm.ms' and (Namespace == 'Network' and Name == 'ReadBytesPerSecond')\n| extend ComputerId = iff(isempty(_ResourceId), Computer, _ResourceId)\n| where ComputerId in (computerList)\n| summarize Val = sum(Val) by bin(TimeGenerated, trendBinSize), ComputerId, \nComputer\n| summarize $agg by bin(TimeGenerated, trendBinSize), ComputerId\n| sort by TimeGenerated asc) on ComputerId\n",
  1636. "resource": "/subscriptions/$sub",
  1637. "resultFormat": "table",
  1638. "workspace": ""
  1639. },
  1640. "azureMonitor": {
  1641. "aggOptions": [],
  1642. "dimensionFilter": "*",
  1643. "dimensionFilters": [],
  1644. "timeGrain": "auto",
  1645. "timeGrains": [],
  1646. "top": "10"
  1647. },
  1648. "azureResourceGraph": {
  1649. "resultFormat": "table"
  1650. },
  1651. "insightsAnalytics": {
  1652. "query": "",
  1653. "resultFormat": "time_series"
  1654. },
  1655. "queryType": "Azure Log Analytics",
  1656. "refId": "A",
  1657. "subscription": "",
  1658. "subscriptions": []
  1659. }
  1660. ],
  1661. "title": "${agg:text} Bytes Received Rate",
  1662. "transformations": [
  1663. {
  1664. "id": "organize",
  1665. "options": {
  1666. "excludeByName": {
  1667. "ComputerId": true,
  1668. "ComputerId1": true,
  1669. "P95th": true,
  1670. "score": true
  1671. },
  1672. "indexByName": {},
  1673. "renameByName": {}
  1674. }
  1675. },
  1676. {
  1677. "id": "prepareTimeSeries",
  1678. "options": {
  1679. "format": "many"
  1680. }
  1681. },
  1682. {
  1683. "id": "renameByRegex",
  1684. "options": {
  1685. "regex": "(.+)\\s(.+)",
  1686. "renamePattern": "$2"
  1687. }
  1688. }
  1689. ],
  1690. "type": "timeseries"
  1691. },
  1692. {
  1693. "datasource": {
  1694. "type": "grafana-azure-monitor-datasource",
  1695. "uid": "${ds}"
  1696. },
  1697. "description": "The resource path for this panel uses multiple template variables which requires modifying the dashboard JSON directly. If you would like to do something similar please go to Settings > Save As. Edit as you'd like in your new copy by going to Settings > JSON Model.",
  1698. "fieldConfig": {
  1699. "defaults": {
  1700. "color": {
  1701. "mode": "thresholds"
  1702. },
  1703. "custom": {
  1704. "align": "auto",
  1705. "displayMode": "auto"
  1706. },
  1707. "mappings": [],
  1708. "thresholds": {
  1709. "mode": "absolute",
  1710. "steps": [
  1711. {
  1712. "color": "green",
  1713. "value": null
  1714. },
  1715. {
  1716. "color": "red",
  1717. "value": 80
  1718. }
  1719. ]
  1720. }
  1721. },
  1722. "overrides": [
  1723. {
  1724. "matcher": {
  1725. "id": "byName",
  1726. "options": "Computer"
  1727. },
  1728. "properties": [
  1729. {
  1730. "id": "links",
  1731. "value": [
  1732. {
  1733. "targetBlank": true,
  1734. "title": "",
  1735. "url": "https://ms.portal.azure.com/#@${__data.fields[\"Tenant ID\"]}/resource/subscriptions/${sub}/resourcegroups/${__data.fields[\"Resource Group\"]}/providers/microsoft.compute/${__data.fields.Type}/${__data.fields[\"Resource Name\"]}/infrainsights"
  1736. }
  1737. ]
  1738. }
  1739. ]
  1740. },
  1741. {
  1742. "matcher": {
  1743. "id": "byName",
  1744. "options": "Average"
  1745. },
  1746. "properties": [
  1747. {
  1748. "id": "custom.width",
  1749. "value": 103
  1750. }
  1751. ]
  1752. },
  1753. {
  1754. "matcher": {
  1755. "id": "byName",
  1756. "options": "P50th"
  1757. },
  1758. "properties": [
  1759. {
  1760. "id": "custom.width",
  1761. "value": 95
  1762. }
  1763. ]
  1764. },
  1765. {
  1766. "matcher": {
  1767. "id": "byName",
  1768. "options": "P90th"
  1769. },
  1770. "properties": [
  1771. {
  1772. "id": "custom.width",
  1773. "value": 105
  1774. }
  1775. ]
  1776. },
  1777. {
  1778. "matcher": {
  1779. "id": "byName",
  1780. "options": "P95th"
  1781. },
  1782. "properties": [
  1783. {
  1784. "id": "custom.width",
  1785. "value": 102
  1786. }
  1787. ]
  1788. },
  1789. {
  1790. "matcher": {
  1791. "id": "byName",
  1792. "options": "Max"
  1793. },
  1794. "properties": [
  1795. {
  1796. "id": "custom.width",
  1797. "value": 107
  1798. }
  1799. ]
  1800. }
  1801. ]
  1802. },
  1803. "gridPos": {
  1804. "h": 12,
  1805. "w": 14,
  1806. "x": 0,
  1807. "y": 20
  1808. },
  1809. "id": 38,
  1810. "options": {
  1811. "footer": {
  1812. "fields": "",
  1813. "reducer": ["sum"],
  1814. "show": false
  1815. },
  1816. "showHeader": true,
  1817. "sortBy": []
  1818. },
  1819. "pluginVersion": "8.4.3",
  1820. "targets": [
  1821. {
  1822. "azureLogAnalytics": {
  1823. "query": "let startDateTime = $__timeFrom;\r\nlet endDateTime = $__timeTo;\r\nlet trendBinSize = 5m;\r\nlet maxResultCount = 10;\r\nlet summaryPerComputer = InsightsMetrics\r\n| where TimeGenerated between (startDateTime .. endDateTime) \r\n| where Origin == 'vm.azm.ms' and (Namespace == 'Network' and Name == 'ReadBytesPerSecond')\r\n| extend ComputerId = iff(isempty(_ResourceId), Computer, _ResourceId)\r\n| summarize Val = sum(Val) by bin(TimeGenerated, 1m), ComputerId, Computer, _ResourceId\r\n| summarize hint.shufflekey = ComputerId Average = avg(Val), Max = max(Val), percentiles(Val, 5, 10, 50, 90, 95) by ComputerId, Computer, _ResourceId\r\n| project ComputerId, Computer, Average, Max, P5th = percentile_Val_5, P10th = percentile_Val_10, P50th = percentile_Val_50, P90th = percentile_Val_90, P95th = percentile_Val_95, ResourceId = _ResourceId\r\n| top 10 by ${agg:text};\r\nlet computerList = summaryPerComputer\r\n| summarize by ComputerId, Computer;\r\nlet EmptyNodeIdentityAndProps = datatable(ComputerId: string, Computer:string, NodeId:string, NodeProps:dynamic, Priority: long) []; \r\nlet OmsNodeIdentityAndProps = computerList \r\n| extend NodeId = ComputerId \r\n| extend Priority = 1 \r\n| extend NodeProps = pack('type', 'StandAloneNode', 'name', Computer); \r\nlet ServiceMapNodeIdentityAndProps = VMComputer \r\n| where TimeGenerated >= startDateTime \r\n| where TimeGenerated < endDateTime \r\n| extend ResourceId = strcat('machines/', Machine) \r\n| extend tempComputerId=iff(isempty(_ResourceId), Computer, _ResourceId) \r\n| extend laResourceId = iff(isempty(_ResourceId),'', replace(@'virtualmachinescalesets/(.+)/virtualmachines/(\\\\d+)', @'virtualmachinescalesets/\\\\1/virtualmachines/\\\\1_\\\\2', _ResourceId)) \r\n| extend oldLaResourceId=iff(isempty(_ResourceId),'',replace(@'virtualmachinescalesets/(.+)/virtualmachines/(\\\\d+)',@'virtualmachines/\\\\1_\\\\2', _ResourceId)) \r\n| where tempComputerId in~ (computerList) or laResourceId in (computerList) or oldLaResourceId in (computerList) \r\n| extend ComputerId = iff(laResourceId in (computerList), laResourceId, iff(oldLaResourceId in (computerList), oldLaResourceId, tempComputerId)) \r\n| summarize arg_max(TimeGenerated, *) by Machine \r\n| extend AzureCloudServiceNodeIdentity = iif(isnotempty(AzureCloudServiceName), strcat(AzureCloudServiceInstanceId, '|', AzureCloudServiceDeployment), ''), AzureScaleSetNodeIdentity = iif(isnotempty(AzureVmScaleSetName), strcat(AzureVmScaleSetInstanceId, '|', AzureVmScaleSetDeployment), ''), ComputerProps = pack('type', 'StandAloneNode', 'name', DisplayName, 'mappingResourceId', ResourceId, 'subscriptionId', AzureSubscriptionId, 'resourceGroup', AzureResourceGroup, 'azureResourceId', _ResourceId), AzureCloudServiceNodeProps = pack('type', 'AzureCloudServiceNode', 'cloudServiceInstanceId', AzureCloudServiceInstanceId, 'cloudServiceRoleName', AzureCloudServiceRoleName, 'cloudServiceDeploymentId', AzureCloudServiceDeployment, 'fullDisplayName', FullDisplayName, 'cloudServiceName', AzureCloudServiceName, 'mappingResourceId', ResourceId), AzureScaleSetNodeProps = pack('type', 'AzureScaleSetNode', 'scaleSetInstanceId', AzureResourceName, 'vmScaleSetDeploymentId', AzureVmScaleSetDeployment, 'vmScaleSetName', AzureVmScaleSetName, 'serviceFabricClusterName', AzureServiceFabricClusterName, 'vmScaleSetResourceId', AzureVmScaleSetResourceId, 'resourceGroupName', AzureResourceGroup, 'subscriptionId', AzureSubscriptionId, 'fullDisplayName', FullDisplayName, 'mappingResourceId', ResourceId) \r\n| project ComputerId, Computer, NodeId = case(isnotempty(AzureCloudServiceNodeIdentity), AzureCloudServiceNodeIdentity, isnotempty(AzureScaleSetNodeIdentity), AzureScaleSetNodeIdentity, Computer), NodeProps = case(isnotempty(AzureCloudServiceNodeIdentity), AzureCloudServiceNodeProps, isnotempty(AzureScaleSetNodeIdentity), AzureScaleSetNodeProps, ComputerProps), Priority = 2; \r\nlet NodeIdentityAndProps = union kind=inner isfuzzy = true EmptyNodeIdentityAndProps, OmsNodeIdentityAndProps, ServiceMapNodeIdentityAndProps \r\n| summarize arg_max(Priority, *) by ComputerId;\r\nlet trend = InsightsMetrics\r\n| where TimeGenerated between (startDateTime .. endDateTime)\r\n| where Origin == 'vm.azm.ms' and (Namespace == 'Network' and Name == 'ReadBytesPerSecond')\r\n| extend ComputerId = iff(isempty(_ResourceId), Computer, _ResourceId)\r\n| where ComputerId in (computerList)\r\n| summarize Val = sum(Val) by bin(TimeGenerated, 1m), ComputerId, Computer, _ResourceId\r\n| summarize hint.shufflekey = ComputerId TrendValue = percentile(Val, 95) by ComputerId, Computer, bin(TimeGenerated, trendBinSize)\r\n| project ComputerId, Computer\r\n| summarize hint.shufflekey = ComputerId by ComputerId, Computer;summaryPerComputer\r\n| join ( trend ) on ComputerId\r\n| join ( NodeIdentityAndProps ) on ComputerId\r\n| parse tolower(ResourceId) with * \"virtualmachinescalesets/\" scaleSetName \"/virtualmachines/\" vmNameScale\r\n| parse tolower(ResourceId) with * \"virtualmachines/\" vmName\r\n| parse tolower(ResourceId) with * \"resourcegroups/\" resourceGroup \"/providers/microsoft.compute/\" typeVM \"/\" nameVM\r\n| parse tolower(ResourceId) with * \"microsoft.compute/\" typeScale \"/\" nameScale \"/virtualmachines\" remaining\r\n| project resourceGroup, Average, P50th, P90th, P95th, Max, Computer, Type = iff(isnotempty(typeScale), typeScale, typeVM), Name = iff(isnotempty(nameScale), nameScale, nameVM)",
  1824. "resource": "/subscriptions/$sub",
  1825. "resultFormat": "table"
  1826. },
  1827. "azureMonitor": {
  1828. "timeGrain": "auto"
  1829. },
  1830. "datasource": {
  1831. "type": "grafana-azure-monitor-datasource",
  1832. "uid": "${ds}"
  1833. },
  1834. "queryType": "Azure Log Analytics",
  1835. "refId": "A",
  1836. "subscription": ""
  1837. },
  1838. {
  1839. "azureMonitor": {
  1840. "dimensionFilters": [],
  1841. "timeGrain": "auto"
  1842. },
  1843. "azureResourceGraph": {
  1844. "query": "resources\r\n| where tolower(type) contains \"virtualmachines\" and resourceGroup in~ ($rg) \r\n| project Name = tolower(name), tenantId, resourceGroup"
  1845. },
  1846. "datasource": {
  1847. "type": "grafana-azure-monitor-datasource",
  1848. "uid": "${ds}"
  1849. },
  1850. "hide": false,
  1851. "queryType": "Azure Resource Graph",
  1852. "refId": "B",
  1853. "subscription": "",
  1854. "subscriptions": ["$sub"]
  1855. }
  1856. ],
  1857. "title": "Available Bytes Received Statistics",
  1858. "transformations": [
  1859. {
  1860. "id": "merge",
  1861. "options": {}
  1862. },
  1863. {
  1864. "id": "organize",
  1865. "options": {
  1866. "excludeByName": {
  1867. "NodeId": true,
  1868. "NodeProps": true,
  1869. "ResourceId": true,
  1870. "UseRelativeScale": true
  1871. },
  1872. "indexByName": {
  1873. "Average": 2,
  1874. "Computer": 0,
  1875. "Max": 6,
  1876. "Name": 8,
  1877. "P50th": 3,
  1878. "P90th": 4,
  1879. "P95th": 5,
  1880. "Type": 7,
  1881. "resourceGroup": 1,
  1882. "tenantId": 9
  1883. },
  1884. "renameByName": {
  1885. "Name": "Resource Name",
  1886. "list_TrendPoint": "Trend 95th",
  1887. "resGroup": "Resource Group",
  1888. "resourceGroup": "Resource Group",
  1889. "tenantId": "Tenant ID",
  1890. "typeName": "Type/Name"
  1891. }
  1892. }
  1893. },
  1894. {
  1895. "id": "filterByValue",
  1896. "options": {
  1897. "filters": [
  1898. {
  1899. "config": {
  1900. "id": "isNotNull",
  1901. "options": {}
  1902. },
  1903. "fieldName": "Computer"
  1904. }
  1905. ],
  1906. "match": "all",
  1907. "type": "include"
  1908. }
  1909. }
  1910. ],
  1911. "type": "table"
  1912. },
  1913. {
  1914. "datasource": {
  1915. "type": "grafana-azure-monitor-datasource",
  1916. "uid": "${ds}"
  1917. },
  1918. "description": "The resource path for this panel uses multiple template variables which requires modifying the dashboard JSON directly. If you would like to do something similar please go to Settings > Save As. Edit as you'd like in your new copy by going to Settings > JSON Model.",
  1919. "fieldConfig": {
  1920. "defaults": {
  1921. "color": {
  1922. "fixedColor": "light-green",
  1923. "mode": "fixed"
  1924. },
  1925. "mappings": [],
  1926. "thresholds": {
  1927. "mode": "absolute",
  1928. "steps": [
  1929. {
  1930. "color": "green",
  1931. "value": null
  1932. },
  1933. {
  1934. "color": "red",
  1935. "value": 80
  1936. }
  1937. ]
  1938. }
  1939. },
  1940. "overrides": []
  1941. },
  1942. "gridPos": {
  1943. "h": 12,
  1944. "w": 10,
  1945. "x": 14,
  1946. "y": 20
  1947. },
  1948. "id": 50,
  1949. "options": {
  1950. "colorMode": "value",
  1951. "graphMode": "area",
  1952. "justifyMode": "auto",
  1953. "orientation": "auto",
  1954. "reduceOptions": {
  1955. "calcs": ["max"],
  1956. "fields": "",
  1957. "values": false
  1958. },
  1959. "text": {},
  1960. "textMode": "auto"
  1961. },
  1962. "pluginVersion": "8.4.3",
  1963. "targets": [
  1964. {
  1965. "azureLogAnalytics": {
  1966. "query": "let startDateTime = $__timeFrom;\r\nlet endDateTime = $__timeTo;\r\nlet trendBinSize = (endDateTime - startDateTime)/100;\r\nlet MaxListSize = 1000;\r\nlet summary = InsightsMetrics\r\n| where TimeGenerated between (startDateTime .. endDateTime)\r\n| where Origin == 'vm.azm.ms' and (Namespace == 'Network' and Name == 'ReadBytesPerSecond')\r\n| parse kind=regex tolower(_ResourceId) with 'resourcegroups/' resGroup '/p(.+)' *\r\n| where resGroup in~ ($rg)\r\n| extend ComputerId = iff(isempty(_ResourceId), Computer, _ResourceId)\r\n| summarize Val = sum(Val) by bin(TimeGenerated, trendBinSize), ComputerId, Computer\r\n| summarize hint.shufflekey=ComputerId Average = avg(Val), Min = min(Val),P5th = round(percentile(Val, 5), 2), P10th = round(percentile(Val, 10), 2), \r\nP50th = round(percentile(Val, 50), 2), P80th = round(percentile(Val, 80), 2),\r\nP90th = round(percentile(Val, 90), 2), P95th = round(percentile(Val, 95), 2) by ComputerId, Computer\r\n| top 10 by ${agg:text};\r\nlet computerList=(summary\r\n| project ComputerId, Computer);\r\nlet EmptyNodeIdentityAndProps = datatable(ComputerId: string, Computer:string, NodeId:string, NodeProps:dynamic, Priority: long) []; let OmsNodeIdentityAndProps = computerList \r\n| extend NodeId = ComputerId \r\n| extend Priority = 1 \r\n| extend NodeProps = pack('type', 'StandAloneNode', 'name', Computer); \r\nlet ServiceMapNodeIdentityAndProps = VMComputer \r\n| where TimeGenerated >= startDateTime \r\n| where TimeGenerated < endDateTime \r\n| extend ResourceId = strcat('machines/', Machine) \r\n| extend tempComputerId=iff(isempty(_ResourceId), Computer, _ResourceId) \r\n| extend laResourceId = iff(isempty(_ResourceId),'', replace(@'virtualmachinescalesets/(.+)/virtualmachines/(\\\\d+)', @'virtualmachinescalesets/\\\\1/virtualmachines/\\\\1_\\\\2', _ResourceId))\r\n| extend oldLaResourceId=iff(isempty(_ResourceId),'',replace(@'virtualmachinescalesets/(.+)/virtualmachines/(\\\\d+)',@'virtualmachines/\\\\1_\\\\2', _ResourceId)) \r\n| where tempComputerId in~ (computerList) or laResourceId in (computerList) or oldLaResourceId in (computerList) \r\n| extend ComputerId = iff(laResourceId in (computerList), laResourceId, iff(oldLaResourceId in (computerList), oldLaResourceId, tempComputerId)) \r\n| summarize arg_max(TimeGenerated, *) by Machine \r\n| extend AzureCloudServiceNodeIdentity = iif(isnotempty(AzureCloudServiceName), strcat(AzureCloudServiceInstanceId, '|', AzureCloudServiceDeployment), ''), AzureScaleSetNodeIdentity = iif(isnotempty(AzureVmScaleSetName), strcat(AzureVmScaleSetInstanceId, '|', AzureVmScaleSetDeployment), ''), ComputerProps = pack('type', 'StandAloneNode', 'name', DisplayName, 'mappingResourceId', ResourceId, 'subscriptionId', AzureSubscriptionId, 'resourceGroup', AzureResourceGroup, 'azureResourceId', _ResourceId), AzureCloudServiceNodeProps = pack('type', 'AzureCloudServiceNode', 'cloudServiceInstanceId', AzureCloudServiceInstanceId, 'cloudServiceRoleName', AzureCloudServiceRoleName, 'cloudServiceDeploymentId', AzureCloudServiceDeployment, 'fullDisplayName', FullDisplayName, 'cloudServiceName', AzureCloudServiceName, 'mappingResourceId', ResourceId), AzureScaleSetNodeProps = pack('type', 'AzureScaleSetNode', 'scaleSetInstanceId', AzureResourceName, 'vmScaleSetDeploymentId', AzureVmScaleSetDeployment, 'vmScaleSetName', AzureVmScaleSetName, 'serviceFabricClusterName', AzureServiceFabricClusterName, 'vmScaleSetResourceId', AzureVmScaleSetResourceId, 'resourceGroupName', AzureResourceGroup, 'subscriptionId', AzureSubscriptionId, 'fullDisplayName', FullDisplayName, 'mappingResourceId', ResourceId) \r\n| project ComputerId, Computer, NodeId = case(isnotempty(AzureCloudServiceNodeIdentity), AzureCloudServiceNodeIdentity, isnotempty(AzureScaleSetNodeIdentity), AzureScaleSetNodeIdentity, Computer), NodeProps = case(isnotempty(AzureCloudServiceNodeIdentity), AzureCloudServiceNodeProps, isnotempty(AzureScaleSetNodeIdentity), AzureScaleSetNodeProps, ComputerProps), Priority = 2; let NodeIdentityAndProps = union kind=inner isfuzzy = true EmptyNodeIdentityAndProps, OmsNodeIdentityAndProps, ServiceMapNodeIdentityAndProps \r\n| summarize arg_max(Priority, *) by ComputerId;\r\nsummary\r\n| join (InsightsMetrics\r\n| where TimeGenerated between (startDateTime .. endDateTime)\r\n| where Origin == 'vm.azm.ms' and (Namespace == 'Network' and Name == 'ReadBytesPerSecond')\r\n| extend ComputerId = iff(isempty(_ResourceId), Computer, _ResourceId)\r\n| where ComputerId in (computerList)\r\n| summarize Val = sum(Val) by bin(TimeGenerated, trendBinSize), ComputerId, \r\nComputer\r\n| summarize Max = max(Val) by bin(TimeGenerated, trendBinSize), ComputerId\r\n| sort by TimeGenerated asc) on ComputerId\r\n",
  1967. "resource": "/subscriptions/$sub",
  1968. "resultFormat": "table"
  1969. },
  1970. "azureMonitor": {
  1971. "timeGrain": "auto"
  1972. },
  1973. "datasource": {
  1974. "type": "grafana-azure-monitor-datasource",
  1975. "uid": "${ds}"
  1976. },
  1977. "queryType": "Azure Log Analytics",
  1978. "refId": "A",
  1979. "subscription": ""
  1980. }
  1981. ],
  1982. "title": "Max Available Bytes Received and Trend Line",
  1983. "transformations": [
  1984. {
  1985. "id": "organize",
  1986. "options": {
  1987. "excludeByName": {
  1988. "Average": true,
  1989. "ComputerId": true,
  1990. "ComputerId1": true,
  1991. "Min": true,
  1992. "P10th": true,
  1993. "P50th": true,
  1994. "P5th": true,
  1995. "P80th": true,
  1996. "P90th": true,
  1997. "P95th": true
  1998. },
  1999. "indexByName": {},
  2000. "renameByName": {}
  2001. }
  2002. },
  2003. {
  2004. "id": "prepareTimeSeries",
  2005. "options": {
  2006. "format": "many"
  2007. }
  2008. },
  2009. {
  2010. "id": "renameByRegex",
  2011. "options": {
  2012. "regex": "(.+)\\s(.+)",
  2013. "renamePattern": "$2"
  2014. }
  2015. }
  2016. ],
  2017. "type": "stat"
  2018. }
  2019. ],
  2020. "title": "Network Bytes Received",
  2021. "type": "row"
  2022. },
  2023. {
  2024. "collapsed": true,
  2025. "gridPos": {
  2026. "h": 1,
  2027. "w": 24,
  2028. "x": 0,
  2029. "y": 31
  2030. },
  2031. "id": 40,
  2032. "panels": [
  2033. {
  2034. "datasource": {
  2035. "uid": "${ds}"
  2036. },
  2037. "description": "The resource path for this panel uses multiple template variables which requires modifying the dashboard JSON directly. If you would like to do something similar please go to Settings > Save As. Edit as you'd like in your new copy by going to Settings > JSON Model.",
  2038. "fieldConfig": {
  2039. "defaults": {
  2040. "color": {
  2041. "mode": "palette-classic"
  2042. },
  2043. "custom": {
  2044. "axisGridShow": true,
  2045. "axisLabel": "",
  2046. "axisPlacement": "auto",
  2047. "axisSoftMin": 0,
  2048. "barAlignment": 0,
  2049. "drawStyle": "line",
  2050. "fillOpacity": 0,
  2051. "gradientMode": "none",
  2052. "hideFrom": {
  2053. "legend": false,
  2054. "tooltip": false,
  2055. "viz": false
  2056. },
  2057. "lineInterpolation": "linear",
  2058. "lineWidth": 1,
  2059. "pointSize": 5,
  2060. "scaleDistribution": {
  2061. "type": "linear"
  2062. },
  2063. "showPoints": "never",
  2064. "spanNulls": true,
  2065. "stacking": {
  2066. "group": "A",
  2067. "mode": "none"
  2068. },
  2069. "thresholdsStyle": {
  2070. "mode": "off"
  2071. }
  2072. },
  2073. "mappings": [],
  2074. "noValue": "-",
  2075. "thresholds": {
  2076. "mode": "absolute",
  2077. "steps": [
  2078. {
  2079. "color": "green",
  2080. "value": null
  2081. },
  2082. {
  2083. "color": "red",
  2084. "value": 80
  2085. }
  2086. ]
  2087. },
  2088. "unit": "percent"
  2089. },
  2090. "overrides": []
  2091. },
  2092. "gridPos": {
  2093. "h": 12,
  2094. "w": 24,
  2095. "x": 0,
  2096. "y": 10
  2097. },
  2098. "id": 20,
  2099. "options": {
  2100. "legend": {
  2101. "calcs": [],
  2102. "displayMode": "list",
  2103. "placement": "bottom"
  2104. },
  2105. "tooltip": {
  2106. "mode": "single",
  2107. "sort": "none"
  2108. }
  2109. },
  2110. "targets": [
  2111. {
  2112. "appInsights": {
  2113. "dimension": [],
  2114. "metricName": "select",
  2115. "timeGrain": "auto"
  2116. },
  2117. "azureLogAnalytics": {
  2118. "query": "let startDateTime = $__timeFrom;\nlet endDateTime = $__timeTo;\nlet trendBinSize = (endDateTime - startDateTime)/100;\nlet MaxListSize = 1000;\nlet summary = InsightsMetrics\n| where TimeGenerated between (startDateTime .. endDateTime)\n| where Origin == 'vm.azm.ms' and (Namespace == 'LogicalDisk' and Name == 'FreeSpaceMB')\n| parse kind=regex tolower(_ResourceId) with 'resourcegroups/' resGroup '/p(.+)' *\n| where resGroup in~ ($rg)\n| extend ComputerId = iff(isempty(_ResourceId), Computer, _ResourceId)\n| extend Tags = todynamic(Tags)\n| extend Total = todouble(Tags['vm.azm.ms/diskSizeMB'])\n| summarize Val = sum(Val), Total = sum(Total) by bin(TimeGenerated, trendBinSize), ComputerId, Computer, _ResourceId\n| extend Val = (100.0 - (Val * 100.0)/Total)\n| summarize hint.shufflekey=ComputerId $agg by ComputerId, Computer\n| top 10 by score;\nlet computerList=(summary\n| project ComputerId, Computer);\nlet EmptyNodeIdentityAndProps = datatable(ComputerId: string, Computer:string, NodeId:string, NodeProps:dynamic, Priority: long) []; \nlet OmsNodeIdentityAndProps = computerList \n| extend NodeId = ComputerId \n| extend Priority = 1 \n| extend NodeProps = pack('type', 'StandAloneNode', 'name', Computer); \nlet ServiceMapNodeIdentityAndProps = VMComputer \n| where TimeGenerated >= startDateTime \n| where TimeGenerated < endDateTime \n| extend ResourceId = strcat('machines/', Machine) \n| extend tempComputerId=iff(isempty(_ResourceId), Computer, _ResourceId) \n| extend laResourceId = iff(isempty(_ResourceId),'', replace(@'virtualmachinescalesets/(.+)/virtualmachines/(\\\\d+)', @'virtualmachinescalesets/\\\\1/virtualmachines/\\\\1_\\\\2', _ResourceId))\n| extend oldLaResourceId=iff(isempty(_ResourceId),'',replace(@'virtualmachinescalesets/(.+)/virtualmachines/(\\\\d+)',@'virtualmachines/\\\\1_\\\\2', _ResourceId)) \n| where tempComputerId in~ (computerList) or laResourceId in (computerList) or oldLaResourceId in (computerList) \n| extend ComputerId = iff(laResourceId in (computerList), laResourceId, iff(oldLaResourceId in (computerList), oldLaResourceId, tempComputerId)) \n| summarize arg_max(TimeGenerated, *) by Machine \n| extend AzureCloudServiceNodeIdentity = iif(isnotempty(AzureCloudServiceName), strcat(AzureCloudServiceInstanceId, '|', AzureCloudServiceDeployment), ''), AzureScaleSetNodeIdentity = iif(isnotempty(AzureVmScaleSetName), strcat(AzureVmScaleSetInstanceId, '|', AzureVmScaleSetDeployment), ''), ComputerProps = pack('type', 'StandAloneNode', 'name', DisplayName, 'mappingResourceId', ResourceId, 'subscriptionId', AzureSubscriptionId, 'resourceGroup', AzureResourceGroup, 'azureResourceId', _ResourceId), AzureCloudServiceNodeProps = pack('type', 'AzureCloudServiceNode', 'cloudServiceInstanceId', AzureCloudServiceInstanceId, 'cloudServiceRoleName', AzureCloudServiceRoleName, 'cloudServiceDeploymentId', AzureCloudServiceDeployment, 'fullDisplayName', FullDisplayName, 'cloudServiceName', AzureCloudServiceName, 'mappingResourceId', ResourceId), AzureScaleSetNodeProps = pack('type', 'AzureScaleSetNode', 'scaleSetInstanceId', AzureResourceName, 'vmScaleSetDeploymentId', AzureVmScaleSetDeployment, 'vmScaleSetName', AzureVmScaleSetName, 'serviceFabricClusterName', AzureServiceFabricClusterName, 'vmScaleSetResourceId', AzureVmScaleSetResourceId, 'resourceGroupName', AzureResourceGroup, 'subscriptionId', AzureSubscriptionId, 'fullDisplayName', FullDisplayName, 'mappingResourceId', ResourceId) \n| project ComputerId, Computer, NodeId = case(isnotempty(AzureCloudServiceNodeIdentity), AzureCloudServiceNodeIdentity, isnotempty(AzureScaleSetNodeIdentity), AzureScaleSetNodeIdentity, Computer), NodeProps = case(isnotempty(AzureCloudServiceNodeIdentity), AzureCloudServiceNodeProps, isnotempty(AzureScaleSetNodeIdentity), AzureScaleSetNodeProps, ComputerProps), Priority = 2; \nlet NodeIdentityAndProps = union kind=inner isfuzzy = true EmptyNodeIdentityAndProps, OmsNodeIdentityAndProps, ServiceMapNodeIdentityAndProps \n| summarize arg_max(Priority, *) by ComputerId;\nsummary\n| join (InsightsMetrics\n| where TimeGenerated between (startDateTime .. endDateTime)\n| where Origin == 'vm.azm.ms' and (Namespace == 'LogicalDisk' and Name == 'FreeSpaceMB')\n| extend ComputerId = iff(isempty(_ResourceId), Computer, _ResourceId)\n| where ComputerId in (computerList)\n| extend Tags = todynamic(Tags)\n| extend Total = todouble(Tags['vm.azm.ms/diskSizeMB'])\n| summarize Val = sum(Val), Total = sum(Total) by bin(TimeGenerated, trendBinSize), ComputerId, Computer, _ResourceId\n| extend Val = (100.0 - (Val * 100.0)/Total)\n| summarize $agg by bin(TimeGenerated, trendBinSize), ComputerId\n| sort by TimeGenerated asc) on ComputerId\n",
  2119. "resource": "/subscriptions/$sub",
  2120. "resultFormat": "table",
  2121. "workspace": ""
  2122. },
  2123. "azureMonitor": {
  2124. "aggOptions": [],
  2125. "dimensionFilter": "*",
  2126. "dimensionFilters": [],
  2127. "timeGrain": "auto",
  2128. "timeGrains": [],
  2129. "top": "10"
  2130. },
  2131. "azureResourceGraph": {
  2132. "resultFormat": "table"
  2133. },
  2134. "insightsAnalytics": {
  2135. "query": "",
  2136. "resultFormat": "time_series"
  2137. },
  2138. "queryType": "Azure Log Analytics",
  2139. "refId": "A",
  2140. "subscription": "",
  2141. "subscriptions": []
  2142. }
  2143. ],
  2144. "title": "${agg:text} Logical Disk Space Used %",
  2145. "transformations": [
  2146. {
  2147. "id": "organize",
  2148. "options": {
  2149. "excludeByName": {
  2150. "ComputerId": true,
  2151. "ComputerId1": true,
  2152. "P95th": true,
  2153. "score": true
  2154. },
  2155. "indexByName": {},
  2156. "renameByName": {}
  2157. }
  2158. },
  2159. {
  2160. "id": "prepareTimeSeries",
  2161. "options": {
  2162. "format": "many"
  2163. }
  2164. },
  2165. {
  2166. "id": "renameByRegex",
  2167. "options": {
  2168. "regex": "(.+)\\s(.+)",
  2169. "renamePattern": "$2"
  2170. }
  2171. }
  2172. ],
  2173. "type": "timeseries"
  2174. },
  2175. {
  2176. "datasource": {
  2177. "type": "grafana-azure-monitor-datasource",
  2178. "uid": "${ds}"
  2179. },
  2180. "description": "The resource path for this panel uses multiple template variables which requires modifying the dashboard JSON directly. If you would like to do something similar please go to Settings > Save As. Edit as you'd like in your new copy by going to Settings > JSON Model.",
  2181. "fieldConfig": {
  2182. "defaults": {
  2183. "color": {
  2184. "mode": "thresholds"
  2185. },
  2186. "custom": {
  2187. "align": "auto",
  2188. "displayMode": "auto"
  2189. },
  2190. "mappings": [],
  2191. "thresholds": {
  2192. "mode": "absolute",
  2193. "steps": [
  2194. {
  2195. "color": "green",
  2196. "value": null
  2197. },
  2198. {
  2199. "color": "red",
  2200. "value": 80
  2201. }
  2202. ]
  2203. }
  2204. },
  2205. "overrides": [
  2206. {
  2207. "matcher": {
  2208. "id": "byName",
  2209. "options": "Computer"
  2210. },
  2211. "properties": [
  2212. {
  2213. "id": "links",
  2214. "value": [
  2215. {
  2216. "targetBlank": true,
  2217. "title": "",
  2218. "url": "https://ms.portal.azure.com/#@${__data.fields[\"Tenant ID\"]}/resource/subscriptions/${sub}/resourcegroups/${__data.fields[\"Resource Group\"]}/providers/microsoft.compute/${__data.fields.Type}/${__data.fields[\"Resource Name\"]}/infrainsights"
  2219. }
  2220. ]
  2221. }
  2222. ]
  2223. },
  2224. {
  2225. "matcher": {
  2226. "id": "byName",
  2227. "options": "Average"
  2228. },
  2229. "properties": [
  2230. {
  2231. "id": "custom.width",
  2232. "value": 97
  2233. }
  2234. ]
  2235. },
  2236. {
  2237. "matcher": {
  2238. "id": "byName",
  2239. "options": "P50th"
  2240. },
  2241. "properties": [
  2242. {
  2243. "id": "custom.width",
  2244. "value": 84
  2245. }
  2246. ]
  2247. },
  2248. {
  2249. "matcher": {
  2250. "id": "byName",
  2251. "options": "P90th"
  2252. },
  2253. "properties": [
  2254. {
  2255. "id": "custom.width",
  2256. "value": 105
  2257. }
  2258. ]
  2259. },
  2260. {
  2261. "matcher": {
  2262. "id": "byName",
  2263. "options": "P95th"
  2264. },
  2265. "properties": [
  2266. {
  2267. "id": "custom.width",
  2268. "value": 110
  2269. }
  2270. ]
  2271. },
  2272. {
  2273. "matcher": {
  2274. "id": "byName",
  2275. "options": "Max"
  2276. },
  2277. "properties": [
  2278. {
  2279. "id": "custom.width",
  2280. "value": 97
  2281. }
  2282. ]
  2283. }
  2284. ]
  2285. },
  2286. "gridPos": {
  2287. "h": 12,
  2288. "w": 14,
  2289. "x": 0,
  2290. "y": 22
  2291. },
  2292. "id": 42,
  2293. "options": {
  2294. "footer": {
  2295. "fields": "",
  2296. "reducer": ["sum"],
  2297. "show": false
  2298. },
  2299. "showHeader": true,
  2300. "sortBy": []
  2301. },
  2302. "pluginVersion": "8.4.3",
  2303. "targets": [
  2304. {
  2305. "azureLogAnalytics": {
  2306. "query": "let startDateTime = $__timeFrom;\r\nlet endDateTime = $__timeTo;\r\nlet trendBinSize = 5m;\r\nlet maxResultCount = 10;\r\nlet summaryPerComputer = InsightsMetrics\r\n| where TimeGenerated between (startDateTime .. endDateTime)\r\n| where Origin == 'vm.azm.ms' and (Namespace == 'LogicalDisk' and Name == 'FreeSpaceMB')\r\n| extend ComputerId = iff(isempty(_ResourceId), Computer, _ResourceId)\r\n| extend Tags = todynamic(Tags)\r\n| extend Total = todouble(Tags['vm.azm.ms/diskSizeMB']), MountId = tostring(Tags['vm.azm.ms/mountId'])\r\n| extend Val = (100.0 - (Val * 100.0)/Total)\r\n| summarize hint.shufflekey = ComputerId Average = avg(Val), Max = max(Val), percentiles(Val, 5, 10, 50, 90, 95) by MountId, ComputerId, Computer, _ResourceId\r\n| project MountId, ComputerId, Computer, Average, Max, P5th = percentile_Val_5, P10th = percentile_Val_10, P50th = percentile_Val_50, P90th = percentile_Val_90, P95th = percentile_Val_95, ResourceId = _ResourceId\r\n| top 10 by ${agg:text};\r\nlet computerList = summaryPerComputer\r\n| summarize by ComputerId, Computer;\r\nlet EmptyNodeIdentityAndProps = datatable(ComputerId: string, Computer:string, NodeId:string, NodeProps:dynamic, Priority: long) []; \r\nlet OmsNodeIdentityAndProps = computerList \r\n| extend NodeId = ComputerId \r\n| extend Priority = 1 \r\n| extend NodeProps = pack('type', 'StandAloneNode', 'name', Computer); \r\nlet ServiceMapNodeIdentityAndProps = VMComputer \r\n| where TimeGenerated >= startDateTime \r\n| where TimeGenerated < endDateTime \r\n| extend ResourceId = strcat('machines/', Machine) \r\n| extend tempComputerId=iff(isempty(_ResourceId), Computer, _ResourceId) \r\n| extend laResourceId = iff(isempty(_ResourceId),'', replace(@'virtualmachinescalesets/(.+)/virtualmachines/(\\\\d+)', @'virtualmachinescalesets/\\\\1/virtualmachines/\\\\1_\\\\2', _ResourceId)) \r\n| extend oldLaResourceId=iff(isempty(_ResourceId),'',replace(@'virtualmachinescalesets/(.+)/virtualmachines/(\\\\d+)',@'virtualmachines/\\\\1_\\\\2', _ResourceId)) \r\n| where tempComputerId in~ (computerList) or laResourceId in (computerList) or oldLaResourceId in (computerList) \r\n| extend ComputerId = iff(laResourceId in (computerList), laResourceId, iff(oldLaResourceId in (computerList), oldLaResourceId, tempComputerId)) \r\n| summarize arg_max(TimeGenerated, *) by Machine \r\n| extend AzureCloudServiceNodeIdentity = iif(isnotempty(AzureCloudServiceName), strcat(AzureCloudServiceInstanceId, '|', AzureCloudServiceDeployment), ''), AzureScaleSetNodeIdentity = iif(isnotempty(AzureVmScaleSetName), strcat(AzureVmScaleSetInstanceId, '|', AzureVmScaleSetDeployment), ''), ComputerProps = pack('type', 'StandAloneNode', 'name', DisplayName, 'mappingResourceId', ResourceId, 'subscriptionId', AzureSubscriptionId, 'resourceGroup', AzureResourceGroup, 'azureResourceId', _ResourceId), AzureCloudServiceNodeProps = pack('type', 'AzureCloudServiceNode', 'cloudServiceInstanceId', AzureCloudServiceInstanceId, 'cloudServiceRoleName', AzureCloudServiceRoleName, 'cloudServiceDeploymentId', AzureCloudServiceDeployment, 'fullDisplayName', FullDisplayName, 'cloudServiceName', AzureCloudServiceName, 'mappingResourceId', ResourceId), AzureScaleSetNodeProps = pack('type', 'AzureScaleSetNode', 'scaleSetInstanceId', AzureResourceName, 'vmScaleSetDeploymentId', AzureVmScaleSetDeployment, 'vmScaleSetName', AzureVmScaleSetName, 'serviceFabricClusterName', AzureServiceFabricClusterName, 'vmScaleSetResourceId', AzureVmScaleSetResourceId, 'resourceGroupName', AzureResourceGroup, 'subscriptionId', AzureSubscriptionId, 'fullDisplayName', FullDisplayName, 'mappingResourceId', ResourceId) \r\n| project ComputerId, Computer, NodeId = case(isnotempty(AzureCloudServiceNodeIdentity), AzureCloudServiceNodeIdentity, isnotempty(AzureScaleSetNodeIdentity), AzureScaleSetNodeIdentity, Computer), NodeProps = case(isnotempty(AzureCloudServiceNodeIdentity), AzureCloudServiceNodeProps, isnotempty(AzureScaleSetNodeIdentity), AzureScaleSetNodeProps, ComputerProps), Priority = 2; \r\nlet NodeIdentityAndProps = union kind=inner isfuzzy = true EmptyNodeIdentityAndProps, OmsNodeIdentityAndProps, ServiceMapNodeIdentityAndProps \r\n| summarize arg_max(Priority, *) by ComputerId;\r\nlet trend = InsightsMetrics\r\n| where TimeGenerated between (startDateTime .. endDateTime)\r\n| where Origin == 'vm.azm.ms' and (Namespace == 'LogicalDisk' and Name == 'FreeSpaceMB')\r\n| extend ComputerId = iff(isempty(_ResourceId), Computer, _ResourceId)\r\n| where ComputerId in (computerList)| extend Tags = todynamic(Tags)\r\n| extend Total = todouble(Tags['vm.azm.ms/diskSizeMB']), MountId = tostring(Tags['vm.azm.ms/mountId'])\r\n| extend Val = (100.0 - (Val * 100.0)/Total)\r\n| summarize hint.shufflekey = ComputerId TrendValue = percentile(Val, 95) by MountId, ComputerId, Computer, bin(TimeGenerated, trendBinSize)\r\n| project MountId, ComputerId, Computer\r\n| summarize hint.shufflekey = ComputerId by MountId, ComputerId, Computer;summaryPerComputer\r\n| join kind=leftouter ( trend ) on ComputerId, MountId\r\n| join kind=leftouter ( NodeIdentityAndProps ) on ComputerId\r\n| extend VolumeId = strcat(MountId, '|', NodeId), VolumeProps = pack('type', 'NodeVolume', 'volumeName', MountId, 'node', NodeProps)\r\n| parse tolower(ResourceId) with * \"virtualmachinescalesets/\" scaleSetName \"/virtualmachines/\" vmNameScale\r\n| parse tolower(ResourceId) with * \"virtualmachines/\" vmName\r\n| parse tolower(ResourceId) with * \"resourcegroups/\" resourceGroup \"/providers/microsoft.compute/\" typeVM \"/\" nameVM\r\n| parse tolower(ResourceId) with * \"microsoft.compute/\" typeScale \"/\" nameScale \"/virtualmachines\" remaining\r\n| project resourceGroup, Average, P50th, P90th, P95th, Max, Computer, Type = iff(isnotempty(typeScale), typeScale, typeVM), Name = iff(isnotempty(nameScale), nameScale, nameVM)\r\n",
  2307. "resource": "/subscriptions/$sub",
  2308. "resultFormat": "table"
  2309. },
  2310. "azureMonitor": {
  2311. "timeGrain": "auto"
  2312. },
  2313. "datasource": {
  2314. "type": "grafana-azure-monitor-datasource",
  2315. "uid": "${ds}"
  2316. },
  2317. "queryType": "Azure Log Analytics",
  2318. "refId": "A",
  2319. "subscription": ""
  2320. },
  2321. {
  2322. "azureMonitor": {
  2323. "dimensionFilters": [],
  2324. "timeGrain": "auto"
  2325. },
  2326. "azureResourceGraph": {
  2327. "query": "resources\r\n| where tolower(type) contains \"virtualmachines\" and resourceGroup in~ ($rg) \r\n| project Name = tolower(name), tenantId, resourceGroup"
  2328. },
  2329. "datasource": {
  2330. "type": "grafana-azure-monitor-datasource",
  2331. "uid": "${ds}"
  2332. },
  2333. "hide": false,
  2334. "queryType": "Azure Resource Graph",
  2335. "refId": "B",
  2336. "subscription": "",
  2337. "subscriptions": ["$sub"]
  2338. }
  2339. ],
  2340. "title": "Available Logical Space Disk Used % Statistics",
  2341. "transformations": [
  2342. {
  2343. "id": "merge",
  2344. "options": {}
  2345. },
  2346. {
  2347. "id": "organize",
  2348. "options": {
  2349. "excludeByName": {
  2350. "ResourceId": true,
  2351. "UseRelativeScale": true,
  2352. "VolumeId": true,
  2353. "VolumeProps": true
  2354. },
  2355. "indexByName": {
  2356. "Average": 2,
  2357. "Computer": 0,
  2358. "Max": 6,
  2359. "Name": 8,
  2360. "P50th": 3,
  2361. "P90th": 4,
  2362. "P95th": 5,
  2363. "Type": 7,
  2364. "resourceGroup": 1,
  2365. "tenantId": 9
  2366. },
  2367. "renameByName": {
  2368. "Name": "Resource Name",
  2369. "list_TrendPoint": "Trend 95th",
  2370. "resGroup": "Resource Group",
  2371. "resourceGroup": "Resource Group",
  2372. "tenantId": "Tenant ID",
  2373. "typeName": "Type/Name"
  2374. }
  2375. }
  2376. },
  2377. {
  2378. "id": "filterByValue",
  2379. "options": {
  2380. "filters": [
  2381. {
  2382. "config": {
  2383. "id": "isNotNull",
  2384. "options": {}
  2385. },
  2386. "fieldName": "Computer"
  2387. }
  2388. ],
  2389. "match": "all",
  2390. "type": "include"
  2391. }
  2392. }
  2393. ],
  2394. "type": "table"
  2395. },
  2396. {
  2397. "datasource": {
  2398. "type": "grafana-azure-monitor-datasource",
  2399. "uid": "${ds}"
  2400. },
  2401. "description": "The resource path for this panel uses multiple template variables which requires modifying the dashboard JSON directly. If you would like to do something similar please go to Settings > Save As. Edit as you'd like in your new copy by going to Settings > JSON Model.",
  2402. "fieldConfig": {
  2403. "defaults": {
  2404. "color": {
  2405. "fixedColor": "light-green",
  2406. "mode": "fixed"
  2407. },
  2408. "mappings": [],
  2409. "thresholds": {
  2410. "mode": "absolute",
  2411. "steps": [
  2412. {
  2413. "color": "green",
  2414. "value": null
  2415. },
  2416. {
  2417. "color": "red",
  2418. "value": 80
  2419. }
  2420. ]
  2421. }
  2422. },
  2423. "overrides": []
  2424. },
  2425. "gridPos": {
  2426. "h": 12,
  2427. "w": 10,
  2428. "x": 14,
  2429. "y": 22
  2430. },
  2431. "id": 52,
  2432. "options": {
  2433. "colorMode": "value",
  2434. "graphMode": "area",
  2435. "justifyMode": "auto",
  2436. "orientation": "auto",
  2437. "reduceOptions": {
  2438. "calcs": ["max"],
  2439. "fields": "",
  2440. "values": false
  2441. },
  2442. "text": {},
  2443. "textMode": "auto"
  2444. },
  2445. "pluginVersion": "8.4.3",
  2446. "targets": [
  2447. {
  2448. "azureLogAnalytics": {
  2449. "query": "let startDateTime = $__timeFrom;\r\nlet endDateTime = $__timeTo;\r\nlet trendBinSize = 5m;\r\nlet maxResultCount = 10;\r\nlet summaryPerComputer = InsightsMetrics\r\n| where TimeGenerated between (startDateTime .. endDateTime)\r\n| where Origin == 'vm.azm.ms' and (Namespace == 'LogicalDisk' and Name == 'FreeSpaceMB')\r\n| extend ComputerId = iff(isempty(_ResourceId), Computer, _ResourceId)\r\n| extend Tags = todynamic(Tags)\r\n| extend Total = todouble(Tags['vm.azm.ms/diskSizeMB']), MountId = tostring(Tags['vm.azm.ms/mountId'])\r\n| extend Val = (100.0 - (Val * 100.0)/Total)\r\n| summarize hint.shufflekey = ComputerId Average = avg(Val), Max = max(Val), percentiles(Val, 5, 10, 50, 90, 95) by MountId, ComputerId, Computer, _ResourceId\r\n| project MountId, ComputerId, Computer, Average, Max, P5th = percentile_Val_5, P10th = percentile_Val_10, P50th = percentile_Val_50, P90th = percentile_Val_90, P95th = percentile_Val_95, ResourceId = _ResourceId\r\n| top 10 by ${agg:text};\r\nlet computerList = summaryPerComputer\r\n| summarize by ComputerId, Computer;\r\nlet EmptyNodeIdentityAndProps = datatable(ComputerId: string, Computer:string, NodeId:string, NodeProps:dynamic, Priority: long) []; \r\nlet OmsNodeIdentityAndProps = computerList \r\n| extend NodeId = ComputerId \r\n| extend Priority = 1 \r\n| extend NodeProps = pack('type', 'StandAloneNode', 'name', Computer); \r\nlet ServiceMapNodeIdentityAndProps = VMComputer \r\n| where TimeGenerated >= startDateTime \r\n| where TimeGenerated < endDateTime \r\n| extend ResourceId = strcat('machines/', Machine) \r\n| extend tempComputerId=iff(isempty(_ResourceId), Computer, _ResourceId) \r\n| extend laResourceId = iff(isempty(_ResourceId),'', replace(@'virtualmachinescalesets/(.+)/virtualmachines/(\\\\d+)', @'virtualmachinescalesets/\\\\1/virtualmachines/\\\\1_\\\\2', _ResourceId)) \r\n| extend oldLaResourceId=iff(isempty(_ResourceId),'',replace(@'virtualmachinescalesets/(.+)/virtualmachines/(\\\\d+)',@'virtualmachines/\\\\1_\\\\2', _ResourceId)) \r\n| where tempComputerId in~ (computerList) or laResourceId in (computerList) or oldLaResourceId in (computerList) \r\n| extend ComputerId = iff(laResourceId in (computerList), laResourceId, iff(oldLaResourceId in (computerList), oldLaResourceId, tempComputerId)) \r\n| summarize arg_max(TimeGenerated, *) by Machine \r\n| extend AzureCloudServiceNodeIdentity = iif(isnotempty(AzureCloudServiceName), strcat(AzureCloudServiceInstanceId, '|', AzureCloudServiceDeployment), ''), AzureScaleSetNodeIdentity = iif(isnotempty(AzureVmScaleSetName), strcat(AzureVmScaleSetInstanceId, '|', AzureVmScaleSetDeployment), ''), ComputerProps = pack('type', 'StandAloneNode', 'name', DisplayName, 'mappingResourceId', ResourceId, 'subscriptionId', AzureSubscriptionId, 'resourceGroup', AzureResourceGroup, 'azureResourceId', _ResourceId), AzureCloudServiceNodeProps = pack('type', 'AzureCloudServiceNode', 'cloudServiceInstanceId', AzureCloudServiceInstanceId, 'cloudServiceRoleName', AzureCloudServiceRoleName, 'cloudServiceDeploymentId', AzureCloudServiceDeployment, 'fullDisplayName', FullDisplayName, 'cloudServiceName', AzureCloudServiceName, 'mappingResourceId', ResourceId), AzureScaleSetNodeProps = pack('type', 'AzureScaleSetNode', 'scaleSetInstanceId', AzureResourceName, 'vmScaleSetDeploymentId', AzureVmScaleSetDeployment, 'vmScaleSetName', AzureVmScaleSetName, 'serviceFabricClusterName', AzureServiceFabricClusterName, 'vmScaleSetResourceId', AzureVmScaleSetResourceId, 'resourceGroupName', AzureResourceGroup, 'subscriptionId', AzureSubscriptionId, 'fullDisplayName', FullDisplayName, 'mappingResourceId', ResourceId) \r\n| project ComputerId, Computer, NodeId = case(isnotempty(AzureCloudServiceNodeIdentity), AzureCloudServiceNodeIdentity, isnotempty(AzureScaleSetNodeIdentity), AzureScaleSetNodeIdentity, Computer), NodeProps = case(isnotempty(AzureCloudServiceNodeIdentity), AzureCloudServiceNodeProps, isnotempty(AzureScaleSetNodeIdentity), AzureScaleSetNodeProps, ComputerProps), Priority = 2; \r\nlet NodeIdentityAndProps = union kind=inner isfuzzy = true EmptyNodeIdentityAndProps, OmsNodeIdentityAndProps, ServiceMapNodeIdentityAndProps \r\n| summarize arg_max(Priority, *) by ComputerId;\r\nInsightsMetrics\r\n| where TimeGenerated between (startDateTime .. endDateTime)\r\n| where Origin == 'vm.azm.ms' and (Namespace == 'LogicalDisk' and Name == 'FreeSpaceMB')\r\n| extend ComputerId = iff(isempty(_ResourceId), Computer, _ResourceId)\r\n| where ComputerId in (computerList)| extend Tags = todynamic(Tags)\r\n| extend Total = todouble(Tags['vm.azm.ms/diskSizeMB']), MountId = tostring(Tags['vm.azm.ms/mountId'])\r\n| extend Val = (100.0 - (Val * 100.0)/Total)\r\n| summarize hint.shufflekey = ComputerId TrendValue = max(Val) by MountId, ComputerId, Computer, bin(TimeGenerated, trendBinSize)\r\n",
  2450. "resource": "/subscriptions/$sub",
  2451. "resultFormat": "table"
  2452. },
  2453. "azureMonitor": {
  2454. "timeGrain": "auto"
  2455. },
  2456. "datasource": {
  2457. "type": "grafana-azure-monitor-datasource",
  2458. "uid": "${ds}"
  2459. },
  2460. "queryType": "Azure Log Analytics",
  2461. "refId": "A",
  2462. "subscription": ""
  2463. }
  2464. ],
  2465. "title": "Max vailable Logical Space Disk Used % ",
  2466. "transformations": [
  2467. {
  2468. "id": "organize",
  2469. "options": {
  2470. "excludeByName": {
  2471. "Average": true,
  2472. "ComputerId": true,
  2473. "ComputerId1": true,
  2474. "Min": true,
  2475. "MountId": true,
  2476. "P10th": true,
  2477. "P50th": true,
  2478. "P5th": true,
  2479. "P80th": true,
  2480. "P90th": true,
  2481. "P95th": true
  2482. },
  2483. "indexByName": {},
  2484. "renameByName": {}
  2485. }
  2486. },
  2487. {
  2488. "id": "prepareTimeSeries",
  2489. "options": {
  2490. "format": "many"
  2491. }
  2492. },
  2493. {
  2494. "id": "renameByRegex",
  2495. "options": {
  2496. "regex": "(.+)\\s(.+)",
  2497. "renamePattern": "$2"
  2498. }
  2499. }
  2500. ],
  2501. "type": "stat"
  2502. }
  2503. ],
  2504. "title": "Logical Disk Space Used %",
  2505. "type": "row"
  2506. }
  2507. ],
  2508. "refresh": "",
  2509. "schemaVersion": 35,
  2510. "style": "dark",
  2511. "tags": [],
  2512. "templating": {
  2513. "list": [
  2514. {
  2515. "current": {},
  2516. "hide": 0,
  2517. "includeAll": false,
  2518. "label": "Datasource",
  2519. "multi": false,
  2520. "name": "ds",
  2521. "options": [],
  2522. "query": "grafana-azure-monitor-datasource",
  2523. "queryValue": "",
  2524. "refresh": 1,
  2525. "regex": "",
  2526. "skipUrlSync": false,
  2527. "type": "datasource"
  2528. },
  2529. {
  2530. "current": {},
  2531. "datasource": {
  2532. "type": "grafana-azure-monitor-datasource",
  2533. "uid": "${ds}"
  2534. },
  2535. "definition": "Subscriptions()",
  2536. "hide": 0,
  2537. "includeAll": false,
  2538. "label": "Subscriptions",
  2539. "multi": false,
  2540. "name": "sub",
  2541. "options": [],
  2542. "query": "Subscriptions()",
  2543. "refresh": 1,
  2544. "regex": "",
  2545. "skipUrlSync": false,
  2546. "sort": 0,
  2547. "type": "query"
  2548. },
  2549. {
  2550. "current": {},
  2551. "datasource": {
  2552. "type": "grafana-azure-monitor-datasource",
  2553. "uid": "${ds}"
  2554. },
  2555. "definition": "ResourceGroups($sub)",
  2556. "hide": 0,
  2557. "includeAll": false,
  2558. "label": "Resource Group",
  2559. "multi": true,
  2560. "name": "rg",
  2561. "options": [],
  2562. "query": "ResourceGroups($sub)",
  2563. "refresh": 1,
  2564. "regex": "",
  2565. "skipUrlSync": false,
  2566. "sort": 0,
  2567. "type": "query"
  2568. },
  2569. {
  2570. "current": {
  2571. "selected": true,
  2572. "text": "Average",
  2573. "value": "score = round(avg(Val), 2)"
  2574. },
  2575. "hide": 0,
  2576. "includeAll": false,
  2577. "label": "Aggregate",
  2578. "multi": false,
  2579. "name": "agg",
  2580. "options": [
  2581. {
  2582. "selected": true,
  2583. "text": "Average",
  2584. "value": "score = round(avg(Val), 2)"
  2585. },
  2586. {
  2587. "selected": false,
  2588. "text": "P5th",
  2589. "value": "score= round(percentile(Val, 5), 2)"
  2590. },
  2591. {
  2592. "selected": false,
  2593. "text": "P10th",
  2594. "value": "score= round(percentile(Val, 10), 2)"
  2595. },
  2596. {
  2597. "selected": false,
  2598. "text": "P50th",
  2599. "value": "score= round(percentile(Val, 50), 2)"
  2600. },
  2601. {
  2602. "selected": false,
  2603. "text": "P80th",
  2604. "value": "score= round(percentile(Val, 80), 2)"
  2605. },
  2606. {
  2607. "selected": false,
  2608. "text": "P90th",
  2609. "value": "score= round(percentile(Val, 90), 2)"
  2610. },
  2611. {
  2612. "selected": false,
  2613. "text": "P95th",
  2614. "value": "score= round(percentile(Val, 95), 2)"
  2615. }
  2616. ],
  2617. "query": "Average : score = round(avg(Val)\\, 2), P5th : score= round(percentile(Val\\, 5)\\, 2), P10th : score= round(percentile(Val\\, 10)\\, 2), P50th : score= round(percentile(Val\\, 50)\\, 2), P80th : score= round(percentile(Val\\, 80)\\, 2), P90th : score= round(percentile(Val\\, 90)\\, 2), P95th : score= round(percentile(Val\\, 95)\\, 2)",
  2618. "queryValue": "",
  2619. "skipUrlSync": false,
  2620. "type": "custom"
  2621. },
  2622. {
  2623. "current": {},
  2624. "datasource": {
  2625. "type": "grafana-azure-monitor-datasource",
  2626. "uid": "${ds}"
  2627. },
  2628. "definition": "",
  2629. "hide": 2,
  2630. "includeAll": false,
  2631. "multi": false,
  2632. "name": "tenantId",
  2633. "options": [],
  2634. "query": {
  2635. "azureLogAnalytics": {
  2636. "query": "InsightsMetrics\r\n| project TenantId\r\n| distinct TenantId",
  2637. "resource": "/subscriptions/$sub"
  2638. },
  2639. "queryType": "Azure Log Analytics",
  2640. "refId": "A",
  2641. "subscription": ""
  2642. },
  2643. "refresh": 1,
  2644. "regex": "",
  2645. "skipUrlSync": false,
  2646. "sort": 0,
  2647. "type": "query"
  2648. }
  2649. ]
  2650. },
  2651. "time": {
  2652. "from": "now-15m",
  2653. "to": "now"
  2654. },
  2655. "timepicker": {},
  2656. "timezone": "",
  2657. "title": "Azure / Insights / Virtual Machines by Resource Group",
  2658. "uid": "AzVmInsightsByRG",
  2659. "version": 9
  2660. }