Skip to content

Instantly share code, notes, and snippets.

@veyalla
Last active July 22, 2021 03:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save veyalla/a76cd11719a594e00dab37a87ff0167b to your computer and use it in GitHub Desktop.
Save veyalla/a76cd11719a594e00dab37a87ff0167b to your computer and use it in GitHub Desktop.

{ "version": "Notebook/1.0", "items": [ { "type": 9, "content": { "version": "KqlParameterItem/1.0", "parameters": [ { "id": "dfe7f59e-6a84-4f08-ae21-02571039c687", "version": "KqlParameterItem/1.0", "name": "resourceType", "type": 7, "isGlobal": true, "value": "Microsoft.Devices/IotHubs", "isHiddenWhenLocked": true, "typeSettings": { "additionalResourceOptions": [] }, "jsonData": "["Microsoft.Devices/IotHubs"]", "timeContext": { "durationMs": 86400000 } }, { "id": "2715eb05-75e7-4970-b7e5-2942b21595ee", "version": "KqlParameterItem/1.0", "name": "resource", "type": 5, "isGlobal": true, "isHiddenWhenLocked": true, "typeSettings": { "additionalResourceOptions": [ "value::1" ], "showDefault": false }, "timeContext": { "durationMs": 86400000 }, "defaultValue": "value::1" } ], "style": "pills", "queryType": 0, "resourceType": "{resourceType}" }, "conditionalVisibility": { "parameterName": "neverset", "comparison": "isNotEqualTo" }, "customWidth": "0", "name": "parameters - 6" }, { "type": 9, "content": { "version": "KqlParameterItem/1.0", "crossComponentResources": [ "{resource}" ], "parameters": [ { "id": "d062cb40-2eed-4917-ab42-8f271db98312", "version": "KqlParameterItem/1.0", "name": "InsightsMetricsExists", "type": 1, "isRequired": true, "query": "let hasNonEmptyTable = (T:string) \n{ \n toscalar( union isfuzzy=true ( table(T) | count as Count ), (print Count=0) | summarize sum(Count) ) > 0\n};\nlet TableName = 'InsightsMetrics';\nprint IsPresent=iif(hasNonEmptyTable(TableName), "yes", "no")", "crossComponentResources": [ "{resource}" ], "isHiddenWhenLocked": true, "timeContext": { "durationMs": 259200000 }, "queryType": 0, "resourceType": "{resourceType}" } ], "style": "pills", "queryType": 0, "resourceType": "{resourceType}" }, "conditionalVisibility": { "parameterName": "neverset", "comparison": "isEqualTo", "value": "not set" }, "name": "parameters - 5" }, { "type": 1, "content": { "json": "# No metrics data from IoT Edge devices detected in the last 3 days\n\n## Please on-board with instructions at aka.ms/edgemon-docs\n\n
\n💡If you've just on-boarded, it can take up to 15 minutes for data to be displayed." }, "conditionalVisibility": { "parameterName": "InsightsMetricsExists", "comparison": "isEqualTo", "value": "no" }, "name": "text - 4" }, { "type": 9, "content": { "version": "KqlParameterItem/1.0", "parameters": [ { "id": "1b4b2d2e-4f2e-4881-903d-f307d6958a1c", "version": "KqlParameterItem/1.0", "name": "timeRange", "label": "Time range", "type": 4, "isRequired": true, "isGlobal": true, "value": { "durationMs": 14400000 }, "typeSettings": { "selectableValues": [ { "durationMs": 3600000 }, { "durationMs": 14400000 }, { "durationMs": 43200000 }, { "durationMs": 86400000 }, { "durationMs": 172800000 }, { "durationMs": 259200000 }, { "durationMs": 604800000 }, { "durationMs": 1209600000 }, { "durationMs": 2592000000 } ], "allowCustom": true } } ], "style": "pills", "queryType": 0, "resourceType": "{resourceType}" }, "conditionalVisibility": { "parameterName": "InsightsMetricsExists", "comparison": "isEqualTo", "value": "yes" }, "customWidth": "0", "name": "parameters - 1 - Copy" }, { "type": 9, "content": { "version": "KqlParameterItem/1.0", "parameters": [ { "id": "63aa6750-da91-4e11-af98-50e156843464", "version": "KqlParameterItem/1.0", "name": "SelectedDevice", "label": "💻 Choose device", "type": 2, "query": "\nlet startTime = {timeRange:start};\nlet endTime = {timeRange:end};\nlet devices = () { \nInsightsMetrics\n| where Name == "edgehub_gettwin_total"\n| where TimeGenerated > startTime and TimeGenerated < endTime\n| extend dimensions=parse_json(Tags)\n| extend device = tostring(dimensions.edge_device)\n| distinct device\n};\ndevices()", "typeSettings": { "additionalResourceOptions": [ "value::1" ], "showDefault": false }, "defaultValue": "value::1", "queryType": 0, "resourceType": "{resourceType}" } ], "style": "pills", "queryType": 0, "resourceType": "{resourceType}" }, "customWidth": "0", "name": "parameters - 18" }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "loadType": "always", "items": [ { "type": 9, "content": { "version": "KqlParameterItem/1.0", "parameters": [ { "id": "e383454e-d248-40f4-b867-59824dd58eee", "version": "KqlParameterItem/1.0", "name": "resourceId", "type": 5, "isHiddenWhenLocked": true, "typeSettings": { "additionalResourceOptions": [ "value::1" ], "showDefault": false }, "timeContext": { "durationMs": 86400000 }, "defaultValue": "value::1" }, { "id": "dbd25427-29f1-449e-811b-28ead08755f5", "version": "KqlParameterItem/1.0", "name": "devicePath", "type": 1, "query": "print strcat('/devices/moduleLogs?deviceId=', '{SelectedDevice}','&moduleId=$edgeAgent' ,'&since=' , '{timeRange:startISO}' ,'&until=' , '{timeRange:endISO}')", "isHiddenWhenLocked": true, "timeContext": { "durationMs": 86400000 }, "queryType": 0, "resourceType": "{resourceType}" }, { "id": "239028db-6157-4def-a62c-7e142b602d02", "version": "KqlParameterItem/1.0", "name": "title", "type": 1, "query": "print strcat("Troubleshoot ", '{SelectedDevice}')", "isHiddenWhenLocked": true, "timeContext": { "durationMs": 86400000 }, "queryType": 0, "resourceType": "{resourceType}" } ], "style": "pills", "queryType": 0, "resourceType": "{resourceType}" }, "name": "parameters - 0" }, { "type": 11, "content": { "version": "LinkItem/1.0", "style": "nav", "links": [ { "id": "b8fe4fba-3961-4b4f-9745-bd99f6088211", "linkTarget": "OpenBlade", "linkLabel": "Troubleshoot {SelectedDevice} live!", "style": "secondary", "bladeOpenContext": { "bladeName": "DialogFrameBlade", "extensionName": "Microsoft_Azure_IotHub", "bladeParameters": [ { "name": "path", "source": "parameter", "value": "devicePath" }, { "name": "title", "source": "parameter", "value": "title" }, { "name": "resourceId", "source": "parameter", "value": "resourceId" } ] } } ] }, "customWidth": "0", "name": "links - 1" } ] }, "customWidth": "0", "name": "toubleshoot", "styleSettings": { "margin": "-10px 0px 0px 0px" } }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "loadType": "always", "items": [ { "type": 1, "content": { "json": "# <span style="color:teal"> {SelectedDevice} " }, "customWidth": "0", "name": "text - 5", "styleSettings": { "margin": "0px 0px -8px 0px", "padding": "4px" } }, { "type": 9, "content": { "version": "KqlParameterItem/1.0", "crossComponentResources": [ "{resource}" ], "parameters": [ { "id": "9b874032-306e-446a-bddf-122fe374e0dd", "version": "KqlParameterItem/1.0", "name": "LastUpdated", "type": 1, "query": "InsightsMetrics\n| where TimeGenerated > {timeRange:start}\n| where TimeGenerated < {timeRange:end}\n| where Name == "edgehub_gettwin_total"\n| extend dimensions=parse_json(Tags)\n| extend device = tostring(dimensions.edge_device)\n| where device == '{SelectedDevice}'\n| summarize lastUpdateTime = max(TimeGenerated)\n| extend lastUpdatedSeconds = tolong(datetime_diff('second', {timeRange:end}, lastUpdateTime))\n| extend lastUpdatedMins = tolong(datetime_diff('minute', {timeRange:end}, lastUpdateTime))\n| extend lastUpdatedHours = tolong(datetime_diff('hour', {timeRange:end}, lastUpdateTime))\n| extend lastUpdatedDays = tolong(datetime_diff('day', {timeRange:end}, lastUpdateTime))\n| extend agoText = case(lastUpdatedSeconds <= 60, strcat(lastUpdatedSeconds, iff(lastUpdatedSeconds == 1, " sec ago", " secs ago")),\n lastUpdatedSeconds <= 3600, strcat(lastUpdatedMins, iff(lastUpdatedMins == 1, " min ago", " mins ago")), \n lastUpdatedSeconds <= 86400, strcat(lastUpdatedHours, iff(lastUpdatedHours == 1, " hr ago", " hrs ago")),\n strcat(lastUpdatedDays, iff(lastUpdatedHours == 1, " day ago", " days ago")))\n| project agoText\n", "crossComponentResources": [ "{resource}" ], "isHiddenWhenLocked": true, "timeContext": { "durationMs": 86400000 }, "queryType": 0, "resourceType": "{resourceType}", "value": "5 mins ago" } ], "style": "pills", "queryType": 0, "resourceType": "{resourceType}" }, "conditionalVisibility": { "parameterName": "NeverSet", "comparison": "isEqualTo", "value": "true" }, "name": "parameters - 20" }, { "type": 11, "content": { "version": "LinkItem/1.0", "style": "tabs", "links": [ { "id": "0e8df9f0-363e-43ac-84b1-37d402a95936", "cellValue": "ShowPane", "linkTarget": "parameter", "linkLabel": "Messaging", "subTarget": "messages", "style": "link" }, { "id": "715cf5f8-11f0-49de-82cf-0a2b7c5b9841", "cellValue": "ShowPane", "linkTarget": "parameter", "linkLabel": "Modules", "subTarget": "modules", "style": "link" }, { "id": "76f391fa-7d82-4193-bdf1-1616ea803e44", "cellValue": "ShowPane", "linkTarget": "parameter", "linkLabel": "Host", "subTarget": "host", "style": "link" } ] }, "customWidth": "50", "conditionalVisibility": { "parameterName": "SelectedDevice", "comparison": "isNotEqualTo", "value": "default" }, "name": "top-level-tabs", "styleSettings": { "margin": "0px 0px -10px 0px" } }, { "type": 1, "content": { "json": "<span style="color:teal"> Reported metrics {LastUpdated} " }, "customWidth": "0", "name": "text - 21", "styleSettings": { "margin": "10px 0px 0px 0px", "maxWidth": "25" } }, { "type": 11, "content": { "version": "LinkItem/1.0", "style": "tabs", "links": [ { "id": "3de7168f-e5ed-4243-a819-01889d532441", "cellValue": "messaging-view", "linkTarget": "parameter", "linkLabel": "Routing", "subTarget": "routing", "style": "link" }, { "id": "9020f302-2c21-4c48-9f22-0b95d75ba6f0", "cellValue": "messaging-view", "linkTarget": "parameter", "linkLabel": "Graph", "subTarget": "graph", "style": "link" }, { "id": "6bd3150c-4216-4ac4-a1e7-39e6be0bcea1", "cellValue": "messaging-view", "linkTarget": "parameter", "linkLabel": "Health", "subTarget": "health", "style": "link" } ] }, "conditionalVisibility": { "parameterName": "ShowPane", "comparison": "isEqualTo", "value": "messages" }, "name": "tabs-messaging", "styleSettings": { "margin": "-14px 0px" } }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "loadType": "always", "items": [ { "type": 9, "content": { "version": "KqlParameterItem/1.0", "crossComponentResources": [ "{resource}" ], "parameters": [ { "id": "a374be75-c107-4a2a-a7c3-952d418b6be9", "version": "KqlParameterItem/1.0", "name": "OfflineCount", "type": 1, "query": "let deviceid = '{SelectedDevice}';\nlet startTime = {timeRange:start};\nlet endTime = {timeRange:end};\nlet numEntries = () {\nInsightsMetrics\n| where Tags contains deviceid\n| where Name == "edgehub_offline_count_total"\n| where TimeGenerated > startTime and TimeGenerated < endTime\n| count\n};\nlet totalOfflineCount = () { \nInsightsMetrics\n| where Tags contains deviceid\n| where TimeGenerated > startTime and TimeGenerated < endTime\n| where Name == "edgehub_offline_count_total"\n| extend dimensions=parse_json(Tags)\n| extend device = tostring(dimensions.edge_device)\n| extend instance = tostring(dimensions.instance_number)\n| extend value = toint(Val)\n| order by TimeGenerated\n| serialize\n| extend nextValue = next(value, 1)\n| extend nextInstance = next(instance, 1)\n| extend diff = iff(((value - nextValue) >= 0 and instance == nextInstance), value - nextValue, 0)\n| summarize sum(diff)\n};\nlet offlineCount = toscalar(totalOfflineCount());\nprint count=iff(toscalar(numEntries()) == 0, -1, iff(offlineCount == 0, -1, offlineCount))", "isHiddenWhenLocked": true, "queryType": 0, "resourceType": "{resourceType}" }, { "id": "86724d79-df74-42a9-a43f-bc63c3e5aa47", "version": "KqlParameterItem/1.0", "name": "DroppedMessages", "type": 1, "query": "let deviceid = '{SelectedDevice}';\nlet startTime = {timeRange:start};\nlet endTime = {timeRange:end};\nlet numEntries = () {\nInsightsMetrics\n| where Tags contains deviceid\n| where Name == "edgehub_messages_dropped_total"\n| where TimeGenerated > startTime and TimeGenerated < endTime\n| count\n};\nlet totalDroppedMessagesCount = () { \nInsightsMetrics\n| where Tags contains deviceid\n| where TimeGenerated > startTime and TimeGenerated < endTime\n| where Name == "edgehub_messages_dropped_total"\n| extend dimensions=parse_json(Tags)\n| extend device = tostring(dimensions.edge_device)\n| extend instance = tostring(dimensions.instance_number)\n| extend moduleOutput = strcat(tostring(dimensions.from), '::', tostring(dimensions.from_route_output)) \n| extend value = toint(Val)\n| order by instance, moduleOutput, TimeGenerated\n| serialize\n| extend nextValue = next(value, 1)\n| extend nextInstance = next(instance, 1)\n| extend nextModuleOutput = next(moduleOutput, 1)\n| extend diff = iff(((value - nextValue) >= 0 and instance == nextInstance and moduleOutput == nextModuleOutput), value - nextValue, 0)\n| project TimeGenerated, device, instance, moduleOutput, value, diff\n| summarize sum(diff)\n};\nlet droppedMessages = toscalar(totalDroppedMessagesCount());\nprint count=iff(toscalar(numEntries()) == 0, -1, iff(droppedMessages == 0, -1, droppedMessages))", "isHiddenWhenLocked": true, "queryType": 0, "resourceType": "{resourceType}" }, { "id": "804f24c3-ec91-4d3b-bf12-9faf601952c0", "version": "KqlParameterItem/1.0", "name": "RetryOps", "type": 1, "query": "let deviceid = '{SelectedDevice}';\nlet startTime = {timeRange:start};\nlet endTime = {timeRange:end};\nlet numEntries = () {\nInsightsMetrics\n| where Tags contains deviceid\n| where Name == "edgehub_operation_retry_total"\n| where TimeGenerated > startTime and TimeGenerated < endTime\n| count\n};\nlet totalRetryOperationsCount = () { \nInsightsMetrics\n//| where Tags contains deviceid\n| where TimeGenerated > startTime and TimeGenerated < endTime\n| where Name == "edgehub_operation_retry_total"\n| extend dimensions=parse_json(Tags)\n| extend device = tostring(dimensions.edge_device)\n| where device == deviceid\n| extend instance = tostring(dimensions.instance_number)\n| extend targetOp = strcat(tostring(dimensions.id), '::', tostring(dimensions.operation)) \n| extend value = toint(Val)\n| order by instance, targetOp, TimeGenerated\n| serialize\n| extend nextValue = next(value, 1)\n| extend nextInstance = next(instance, 1)\n| extend nexttargetOp = next(targetOp, 1) \n| extend diff = iff(((value - nextValue) >= 0 and instance == nextInstance and targetOp == nexttargetOp), value - nextValue, 0)\n| project TimeGenerated, device, instance, targetOp, value, diff\n| summarize sum(diff)\n};\nlet retryCount = toscalar(totalRetryOperationsCount());\nprint count=iff(toscalar(numEntries()) == 0, -1, iff(retryCount == 0, -1, retryCount))", "isHiddenWhenLocked": true, "queryType": 0, "resourceType": "{resourceType}" }, { "id": "2f53fe25-35ca-4990-9987-f8b9ba63450c", "version": "KqlParameterItem/1.0", "name": "FailedConnects", "type": 1, "query": "let deviceid = '{SelectedDevice}';\nlet startTime = {timeRange:start};\nlet endTime = {timeRange:end};\nlet numEntries = () {\nInsightsMetrics\n| where Tags contains deviceid\n| where Name == "edgehub_client_connect_failed_total"\n| where TimeGenerated > startTime and TimeGenerated < endTime\n| count\n};\nlet totalFailedConnectsCount = () { \nInsightsMetrics\n| where Tags contains deviceid\n| where TimeGenerated > startTime and TimeGenerated < endTime\n| where Name == "edgehub_client_connect_failed_total"\n| extend dimensions=parse_json(Tags)\n| extend device = tostring(dimensions.edge_device)\n| extend instance = tostring(dimensions.instance_number)\n| extend clientReason = strcat(tostring(dimensions.id), '::', tostring(dimensions.reason)) \n| extend value = toint(Val)\n| order by instance, clientReason, TimeGenerated\n| serialize\n| extend nextValue = next(value, 1)\n| extend nextInstance = next(instance, 1)\n| extend nextclientReason = next(clientReason, 1) \n| extend diff = iff(((value - nextValue) >= 0 and instance == nextInstance and clientReason == nextclientReason), value - nextValue, 0)\n| project TimeGenerated, device, instance, clientReason, value, diff\n| summarize sum(diff)\n};\nlet failedCount = toscalar(totalFailedConnectsCount());\nprint count=iff(toscalar(numEntries()) == 0, -1, iff(failedCount == 0, -1, failedCount))", "isHiddenWhenLocked": true, "queryType": 0, "resourceType": "{resourceType}" }, { "id": "e75fcd48-822e-4698-8c03-de02c4192b30", "version": "KqlParameterItem/1.0", "name": "ClientDisconnects", "type": 1, "query": "let deviceid = '{SelectedDevice}';\nlet startTime = {timeRange:start};\nlet endTime = {timeRange:end};\nlet numEntries = () {\n InsightsMetrics\n | where Tags contains deviceid\n | where Name == "edgehub_client_disconnect_total"\n | where TimeGenerated > startTime and TimeGenerated < endTime\n | count\n};\nlet totalDisconnectedClients = () { \n InsightsMetrics\n | where TimeGenerated > startTime and TimeGenerated < endTime\n | where Name == "edgehub_client_disconnect_total"\n | extend dimensions=parse_json(Tags)\n | extend device = tostring(dimensions.edge_device)\n | where device == deviceid\n | extend instance = tostring(dimensions.instance_number)\n | extend id = strcat(extract("DeviceId: (\\w*)", 1, tostring(dimensions.id), typeof(string)), '::', extract("ModuleId: (\\w*)", 1, tostring(dimensions.id), typeof(string)))\n | extend value = toint(Val)\n | order by instance, id, TimeGenerated\n | serialize\n | extend nextValue = next(value, 1)\n | extend nextInstance = next(instance, 1)\n | extend nextId = next(id, 1) \n | extend diff = iff(((value - nextValue) >= 0 and instance == nextInstance and id == nextId), value - nextValue, 0)\n | project TimeGenerated, device, instance, id, value, diff\n | summarize sum(diff)\n};\nlet disconnectedCount = toscalar(totalDisconnectedClients());\nprint count=iff(toscalar(numEntries()) == 0, -1, iff(disconnectedCount == 0, -1, disconnectedCount))", "crossComponentResources": [ "{resource}" ], "isHiddenWhenLocked": true, "queryType": 0, "resourceType": "{resourceType}" } ], "style": "pills", "queryType": 0, "resourceType": "{resourceType}" }, "name": "parameters - 8" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "print name="droppedCount", title="Dropped messages", offlineCount=iff({DroppedMessages} == -1, 0, {DroppedMessages})", "size": 4, "queryType": 0, "resourceType": "{resource}", "crossComponentResources": [ "{resource}" ], "visualization": "tiles", "tileSettings": { "titleContent": { "columnMatch": "title", "formatter": 1 }, "leftContent": { "columnMatch": "offlineCount", "formatter": 12, "formatOptions": { "min": 0, "palette": "greenRed" }, "numberFormat": { "unit": 17, "options": { "style": "decimal", "useGrouping": false, "maximumFractionDigits": 1, "maximumSignificantDigits": 3 } } }, "showBorder": true } }, "customWidth": "20", "name": "messages-dropped-tile", "styleSettings": { "margin": "-10px 0px" } }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "print name="disconnects", title="Client disconnects", offlineCount=iff({ClientDisconnects} == -1, 0, {ClientDisconnects})", "size": 4, "queryType": 0, "resourceType": "{resourceType}", "crossComponentResources": [ "{resource}" ], "visualization": "tiles", "tileSettings": { "titleContent": { "columnMatch": "title", "formatter": 1 }, "leftContent": { "columnMatch": "offlineCount", "formatter": 12, "formatOptions": { "min": 0, "palette": "greenRed" }, "numberFormat": { "unit": 17, "options": { "style": "decimal", "useGrouping": false, "maximumFractionDigits": 1, "maximumSignificantDigits": 3 } } }, "showBorder": true } }, "customWidth": "20", "name": "messages-dropped-tile - Copy", "styleSettings": { "margin": "-10px 0px" } }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "\r\nprint name="retryCount", title="Retry operations", retryCount=iff({RetryOps} == -1, 0, {RetryOps})\r\n", "size": 4, "queryType": 0, "resourceType": "{resource}", "crossComponentResources": [ "{resource}" ], "visualization": "tiles", "tileSettings": { "titleContent": { "columnMatch": "title", "formatter": 1 }, "leftContent": { "columnMatch": "retryCount", "formatter": 12, "formatOptions": { "min": 0, "palette": "greenRed" }, "numberFormat": { "unit": 17, "options": { "style": "decimal", "maximumFractionDigits": 2, "maximumSignificantDigits": 3 } } }, "showBorder": true } }, "customWidth": "20", "name": "retries-tile", "styleSettings": { "margin": "-10px 0px" } }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "print name="failConnectsCount", title="Failed client connects", failedCount=iff({FailedConnects} == -1, 0, {FailedConnects})", "size": 4, "queryType": 0, "resourceType": "{resource}", "crossComponentResources": [ "{resource}" ], "visualization": "tiles", "tileSettings": { "titleContent": { "columnMatch": "title", "formatter": 1 }, "leftContent": { "columnMatch": "failedCount", "formatter": 12, "formatOptions": { "min": 0, "palette": "greenRed" }, "numberFormat": { "unit": 17, "options": { "style": "decimal", "useGrouping": false, "maximumFractionDigits": 2, "maximumSignificantDigits": 3 } } }, "showBorder": true } }, "customWidth": "20", "name": "failed-connects-tile", "styleSettings": { "margin": "-10px 0px" } }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "print name="offlineCount", title="Offline count", offlineCount=iff({OfflineCount} == -1, 0, {OfflineCount})\n", "size": 4, "exportToExcelOptions": "all", "queryType": 0, "resourceType": "{resource}", "crossComponentResources": [ "{resource}" ], "visualization": "tiles", "tileSettings": { "titleContent": { "columnMatch": "title", "formatter": 1, "tooltipFormat": { "tooltip": "Number of times edgeHub went offline" } }, "leftContent": { "columnMatch": "offlineCount", "formatter": 12, "formatOptions": { "min": 0, "palette": "greenRed" }, "numberFormat": { "unit": 17, "options": { "style": "decimal", "useGrouping": false } } }, "showBorder": true } }, "customWidth": "20", "name": "offline-count-tile", "styleSettings": { "margin": "-10px 0px" } }, { "type": 9, "content": { "version": "KqlParameterItem/1.0", "parameters": [ { "id": "055c2dc1-3f53-445c-91a2-d8b584480cdd", "version": "KqlParameterItem/1.0", "name": "showDropdown", "type": 1, "query": "datatable (Label:string, Count:string)\n ["Offline durations", '{OfflineCount}',\n "Retry operations", '{RetryOps}',\n "Dropped messages", '{DroppedMessages}',\n "Failed connections", '{FailedConnects}']\n| where Count != '-1'\n| count", "isHiddenWhenLocked": true, "timeContext": { "durationMs": 86400000 }, "queryType": 0, "resourceType": "{resourceType}" } ], "style": "pills", "queryType": 0, "resourceType": "{resourceType}" }, "name": "parameters - 11" }, { "type": 9, "content": { "version": "KqlParameterItem/1.0", "crossComponentResources": [ "{resource}" ], "parameters": [ { "id": "c55a2c11-f329-453d-8a27-9fc8814c6ecf", "version": "KqlParameterItem/1.0", "name": "detailsDropdown", "label": "📜 View details for...", "type": 2, "isGlobal": true, "multiSelect": true, "quote": "'", "delimiter": ",", "query": "datatable (Label:string, Count:string)\n ["Dropped messages", '{DroppedMessages}',\n "Client disconnects", '{ClientDisconnects}',\n "Retry operations", '{RetryOps}',\n "Failed connections", '{FailedConnects}',\n "Offline durations", '{OfflineCount}']\n| where Count != '-1'\n| project Label", "crossComponentResources": [ "{resource}" ], "value": [], "typeSettings": { "additionalResourceOptions": [ "value::all" ], "showDefault": false }, "timeContext": { "durationMs": 86400000 }, "queryType": 0, "resourceType": "{resourceType}" } ], "style": "formHorizontal", "queryType": 0, "resourceType": "{resourceType}" }, "customWidth": "25", "conditionalVisibility": { "parameterName": "showDropdown", "comparison": "isNotEqualTo" }, "name": "parameters - 9", "styleSettings": { "margin": "-10px 0px" } }, { "type": 9, "content": { "version": "KqlParameterItem/1.0", "crossComponentResources": [ "{resource}" ], "parameters": [ { "id": "7490ec27-88dc-4bfa-98e0-2cecea421fa0", "version": "KqlParameterItem/1.0", "name": "ShowOfflineDetails", "type": 1, "query": "print iff((strcat({detailsDropdown}) contains 'Offline durations'), 'yes', 'no')\n", "isHiddenWhenLocked": true, "timeContext": { "durationMs": 86400000 }, "queryType": 0, "resourceType": "{resourceType}" }, { "id": "5bd99611-d8d2-455a-b17a-8c05f838d97e", "version": "KqlParameterItem/1.0", "name": "ShowRetryOpsDetails", "type": 1, "query": "print iff((strcat({detailsDropdown}) contains 'Retry Operations'), 'yes', 'no')\n", "isHiddenWhenLocked": true, "timeContext": { "durationMs": 86400000 }, "queryType": 0, "resourceType": "{resourceType}" }, { "id": "46718901-9fb7-4112-800b-2f7b5b983046", "version": "KqlParameterItem/1.0", "name": "ShowDroppedMessagesDetails", "type": 1, "query": "print iff((strcat({detailsDropdown}) contains 'Dropped messages'), 'yes', 'no')\n", "isHiddenWhenLocked": true, "timeContext": { "durationMs": 86400000 }, "queryType": 0, "resourceType": "{resourceType}" }, { "id": "d8478925-eae7-4a12-b477-1926d4bef831", "version": "KqlParameterItem/1.0", "name": "ShowFailedConnectionDetails", "type": 1, "query": "print iff((strcat({detailsDropdown}) contains 'Failed connections'), 'yes', 'no')\n", "isHiddenWhenLocked": true, "timeContext": { "durationMs": 86400000 }, "queryType": 0, "resourceType": "{resourceType}" }, { "id": "ab24a3e9-7ae1-415d-8783-b89d86d1f535", "version": "KqlParameterItem/1.0", "name": "ShowClientDisconnectDetails", "type": 1, "query": "print iff((strcat({detailsDropdown}) contains 'Client disconnects'), 'yes', 'no')\n", "crossComponentResources": [ "{resource}" ], "isHiddenWhenLocked": true, "queryType": 0, "resourceType": "{resourceType}" } ], "style": "pills", "doNotRunWhenHidden": true, "queryType": 0, "resourceType": "{resourceType}" }, "conditionalVisibility": { "parameterName": "detailsDropdown", "comparison": "isNotEqualTo" }, "name": "parameters - 11" }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "items": [ { "type": 9, "content": { "version": "KqlParameterItem/1.0", "parameters": [ { "id": "f781f225-97cd-4a41-8a22-ad09d739b0fe", "version": "KqlParameterItem/1.0", "name": "PercentOffline", "type": 1, "query": "let deviceid = '{SelectedDevice}';\nlet startTime = {timeRange:start};\nlet endTime = {timeRange:end};\nlet numEntries = () {\nInsightsMetrics\n| where Tags contains deviceid\n| where Name == "edgehub_offline_duration_seconds_sum"\n| where TimeGenerated > startTime and TimeGenerated < endTime\n| count\n};\nlet totalOfflineDuration = () { \nInsightsMetrics\n| where Tags contains deviceid\n| where TimeGenerated > startTime and TimeGenerated < endTime\n| where Name == "edgehub_offline_duration_seconds_sum"\n| extend dimensions=parse_json(Tags)\n| extend device = tostring(dimensions.edge_device)\n| extend instance = tostring(dimensions.instance_number)\n| extend value = toint(Val)\n| order by TimeGenerated\n| serialize\n| extend nextValue = next(value, 1)\n| extend nextInstance = next(instance, 1)\n| extend diff = iff(((value - nextValue) >= 0 and instance == nextInstance), value - nextValue, 0)\n| project TimeGenerated, diff\n| summarize sum(diff)\n| project percentOffline = (todouble(sum_diff)/todouble(datetime_diff('second',startTime,endTime))) * -1\n};\nlet percentOffline = toscalar(totalOfflineDuration());\nprint count=iff(toscalar(numEntries()) == 0, todouble(0), iff(percentOffline == todouble(0), todouble(-1), percentOffline))\n", "isHiddenWhenLocked": true, "queryType": 0, "resourceType": "{resourceType}" }, { "id": "74df9778-3ffd-4865-a03e-bf0e3fb1bfa4", "version": "KqlParameterItem/1.0", "name": "OfflineDurationCount", "type": 1, "query": "let deviceid = '{SelectedDevice}';\nlet startTime = {timeRange:start};\nlet endTime = {timeRange:end};\nlet numEntries = () {\nInsightsMetrics\n| where Tags contains deviceid\n| where Name == "edgehub_offline_duration_seconds_count"\n| where TimeGenerated > startTime and TimeGenerated < endTime\n| count\n};\nlet totalOfflineDuration = () { \nInsightsMetrics\n| where Tags contains deviceid\n| where TimeGenerated > startTime and TimeGenerated < endTime\n| where Name == "edgehub_offline_duration_seconds_count"\n| extend dimensions=parse_json(Tags)\n| extend device = tostring(dimensions.edge_device)\n| extend instance = tostring(dimensions.instance_number)\n| extend value = toint(Val)\n| order by TimeGenerated\n| serialize\n| extend nextValue = next(value, 1)\n| extend nextInstance = next(instance, 1)\n| extend diff = iff(((value - nextValue) >= 0 and instance == nextInstance), value - nextValue, 0)\n| project TimeGenerated, diff\n| summarize sum(diff)\n};\nlet offlineDurationCount = toscalar(totalOfflineDuration());\nprint count=iff(toscalar(numEntries()) == 0, 0, iff(offlineDurationCount == 0, -1, offlineDurationCount))", "isHiddenWhenLocked": true, "queryType": 0, "resourceType": "{resourceType}" } ], "style": "pills", "queryType": 0, "resourceType": "{resourceType}" }, "name": "parameters - 2" }, { "type": 1, "content": { "json": "" }, "customWidth": "10", "name": "text - 3" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "print 'edgeHub offline percent', percentOffline=iff({PercentOffline} == -1, todouble(0), {PercentOffline})\n, offlineDurationCount=iff({OfflineDurationCount} == -1, 0, {OfflineDurationCount})", "size": 4, "queryType": 0, "resourceType": "{resourceType}", "crossComponentResources": [ "{resource}" ], "visualization": "tiles", "tileSettings": { "titleContent": { "columnMatch": "print_0", "formatter": 1 }, "leftContent": { "columnMatch": "percentOffline", "formatter": 12, "formatOptions": { "palette": "auto" }, "numberFormat": { "unit": 0, "options": { "style": "percent", "maximumFractionDigits": 2, "maximumSignificantDigits": 3 } } }, "secondaryContent": { "columnMatch": "offlineDurationCount" }, "showBorder": true } }, "customWidth": "30", "name": "query - 1" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "let deviceid = '{SelectedDevice}';\nlet startTime = {timeRange:start};\nlet endTime = {timeRange:end};\nlet numEntries = () {\nInsightsMetrics\n| where Tags contains deviceid\n| where Name == "edgehub_offline_count_total"\n| where TimeGenerated > startTime and TimeGenerated < endTime\n| count\n};\nlet totalOfflineCount = () { \nInsightsMetrics\n| where Tags contains deviceid\n| where TimeGenerated > startTime and TimeGenerated < endTime\n| where Name == "edgehub_offline_count_total"\n| extend dimensions=parse_json(Tags)\n| extend device = tostring(dimensions.edge_device)\n| extend instance = tostring(dimensions.instance_number)\n| extend value = toint(Val)\n| order by TimeGenerated\n| serialize\n| extend nextValue = next(value, 1)\n| extend nextInstance = next(instance, 1)\n| extend diff = iff(((value - nextValue) >= 0 and instance == nextInstance), value - nextValue, 0)\n| project TimeGenerated, diff\n| make-series Count=sum(diff) on TimeGenerated from (startTime - 5m) to endTime step 5m\n//| summarize sum(diff)\n};\ntotalOfflineCount()", "size": 1, "showAnnotations": true, "title": "Offline transitions", "timeBrushParameterName": "cvv", "timeBrushExportOnlyWhenBrushed": true, "queryType": 0, "resourceType": "{resourceType}", "crossComponentResources": [ "{resource}" ], "visualization": "unstackedbar" }, "customWidth": "60", "name": "offline-transition-chart", "styleSettings": { "margin": "0px 0px -20px 0px" } } ] }, "conditionalVisibilities": [ { "parameterName": "detailsDropdown", "comparison": "isNotEqualTo" }, { "parameterName": "ShowOfflineDetails", "comparison": "isEqualTo", "value": "yes" } ], "name": "offline-details" }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "items": [ { "type": 3, "content": { "version": "KqlItem/1.0", "query": "\nlet deviceid = '{SelectedDevice}';\nlet startTime = {timeRange:start};\nlet endTime = {timeRange:end};\nlet numEntries = () {\nInsightsMetrics\n| where Tags contains deviceid\n| where Name == "edgehub_operation_retry_total"\n| where TimeGenerated > startTime and TimeGenerated < endTime\n| count\n};\nlet totalRetryOperationsCount = () { \nInsightsMetrics\n| where Tags contains deviceid\n| where TimeGenerated > startTime and TimeGenerated < endTime\n| where Name == "edgehub_operation_retry_total"\n| extend dimensions=parse_json(Tags)\n| extend device = tostring(dimensions.edge_device)\n| extend instance = tostring(dimensions.instance_number)\n| extend target = tostring(dimensions.id)\n| extend op = tostring(dimensions.operation)\n| extend value = toint(Val)\n| order by instance, target, op, TimeGenerated\n| serialize\n| extend nextValue = next(value, 1)\n| extend nextInstance = next(instance, 1)\n| extend nextTarget = next(target, 1)\n| extend nextOp = next(op, 1) \n| extend diff = iff(((value - nextValue) >= 0 and instance == nextInstance and op == nextOp and target == nextTarget), value - nextValue, 0)\n| project TimeGenerated, device, instance, target, op, value, diff\n| where diff > 0\n| summarize sum(diff) by target, op\n};\ntotalRetryOperationsCount()", "size": 4, "title": "Retry operation details", "exportedParameters": [ { "fieldName": "op", "parameterName": "RetryOp", "parameterType": 1, "defaultValue": "notselected" }, { "fieldName": "target", "parameterName": "RetryTarget", "parameterType": 1, "defaultValue": "notselected" } ], "queryType": 0, "resourceType": "{resourceType}", "crossComponentResources": [ "{resource}" ], "visualization": "table", "gridSettings": { "formatters": [ { "columnMatch": "target", "formatter": 0, "formatOptions": { "customColumnWidthSetting": "24ch" } }, { "columnMatch": "op", "formatter": 0, "formatOptions": { "customColumnWidthSetting": "29.7143ch" } }, { "columnMatch": "sum_diff", "formatter": 0, "formatOptions": { "customColumnWidthSetting": "10.5714ch" }, "numberFormat": { "unit": 17, "options": { "style": "decimal", "useGrouping": false } } } ], "filter": true, "sortBy": [ { "itemKey": "$gen_number_sum_diff_2", "sortOrder": 2 } ], "labelSettings": [ { "columnId": "target", "label": "Target" }, { "columnId": "op", "label": "Operation" }, { "columnId": "sum_diff", "label": "Count" } ] }, "sortBy": [ { "itemKey": "$gen_number_sum_diff_2", "sortOrder": 2 } ] }, "customWidth": "40", "name": "retry-by-target-op" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "let deviceid = '{SelectedDevice}';\nlet startTime = {timeRange:start};\nlet endTime = {timeRange:end};\nlet numEntries = () {\nInsightsMetrics\n| where Tags contains deviceid\n| where Name == "edgehub_operation_retry_total"\n| where TimeGenerated > startTime and TimeGenerated < endTime\n| count\n};\nlet totalRetryOperationsCount = () { \nInsightsMetrics\n| where TimeGenerated > startTime and TimeGenerated < endTime\n| where Name == "edgehub_operation_retry_total"\n| extend dimensions=parse_json(Tags)\n| extend device = tostring(dimensions.edge_device)\n| where device == deviceid\n| extend instance = tostring(dimensions.instance_number)\n| extend target = tostring(dimensions.id)\n| extend op = tostring(dimensions.operation)\n| extend value = toint(Val)\n| order by instance, target, op, TimeGenerated\n| serialize\n| extend nextValue = next(value, 1)\n| extend nextInstance = next(instance, 1)\n| extend nextTarget = next(target, 1)\n| extend nextOp = next(op, 1) \n| extend diff = iff(((value - nextValue) >= 0 and instance == nextInstance and op == nextOp and target == nextTarget), value - nextValue, 0)\n//| where diff > 0\n| make-series Count=sum(diff) on TimeGenerated from (startTime - 10m) to endTime step 10m by op\n//| project TimeGenerated, op, Count=diff\n};\ntotalRetryOperationsCount()", "size": 1, "title": "Retry operations (all targets and operations)", "timeBrushParameterName": "timeRange", "timeBrushExportOnlyWhenBrushed": true, "queryType": 0, "resourceType": "{resourceType}", "crossComponentResources": [ "{resource}" ], "visualization": "scatterchart" }, "customWidth": "60", "conditionalVisibility": { "parameterName": "RetryTarget", "comparison": "isEqualTo", "value": "notselected" }, "name": "all-target-ops-retry-chart" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "let deviceid = '{SelectedDevice}';\nlet startTime = {timeRange:start};\nlet endTime = {timeRange:end};\nlet numEntries = () {\nInsightsMetrics\n| where Tags contains deviceid\n| where Name == "edgehub_operation_retry_total"\n| where TimeGenerated > startTime and TimeGenerated < endTime\n| count\n};\nlet totalRetryOperationsCount = () { \nInsightsMetrics\n| where TimeGenerated > startTime and TimeGenerated < endTime\n| where Name == "edgehub_operation_retry_total"\n| extend dimensions=parse_json(Tags)\n| extend device = tostring(dimensions.edge_device)\n| where device == deviceid\n| extend instance = tostring(dimensions.instance_number)\n| extend target = tostring(dimensions.id)\n| extend op = tostring(dimensions.operation)\n| where target == '{RetryTarget}' and op == '{RetryOp}'\n| extend value = toint(Val)\n| order by instance, target, op, TimeGenerated\n| serialize\n| extend nextValue = next(value, 1)\n| extend nextInstance = next(instance, 1)\n| extend nextTarget = next(target, 1)\n| extend nextOp = next(op, 1) \n| extend diff = iff(((value - nextValue) >= 0 and instance == nextInstance and op == nextOp and target == nextTarget), value - nextValue, 0)\n//| where diff > 0\n| make-series Count=sum(diff) on TimeGenerated from (startTime - 5m) to endTime step 5m\n//| project TimeGenerated, Count=diff\n};\ntotalRetryOperationsCount()", "size": 1, "title": "{RetryOp} targeting {RetryTarget}", "timeBrushParameterName": "timeRange", "timeBrushExportOnlyWhenBrushed": true, "queryType": 0, "resourceType": "{resourceType}", "crossComponentResources": [ "{resource}" ], "visualization": "scatterchart" }, "customWidth": "60", "conditionalVisibility": { "parameterName": "RetryTarget", "comparison": "isNotEqualTo", "value": "notselected" }, "name": "selected-target-op-retry-chart" } ] }, "conditionalVisibilities": [ { "parameterName": "ShowRetryOpsDetails", "comparison": "isEqualTo", "value": "yes" }, { "parameterName": "detailsDropdown", "comparison": "isNotEqualTo" } ], "name": "retry-op-details" }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "items": [ { "type": 3, "content": { "version": "KqlItem/1.0", "query": "let deviceid = '{SelectedDevice}';\nlet startTime = {timeRange:start};\nlet endTime = {timeRange:end};\nlet numEntries = () {\nInsightsMetrics\n| where Tags contains deviceid\n| where Name == "edgehub_messages_dropped_total"\n| where TimeGenerated > startTime and TimeGenerated < endTime\n| count\n};\nlet totalDroppedMessagesCount = () { \nInsightsMetrics\n| where Tags contains deviceid\n| where TimeGenerated > startTime and TimeGenerated < endTime\n| where Name == "edgehub_messages_dropped_total"\n| extend dimensions=parse_json(Tags)\n| extend device = tostring(dimensions.edge_device)\n| extend instance = tostring(dimensions.instance_number)\n| extend moduleOutput = strcat(tostring(dimensions.from), '::', tostring(dimensions.from_route_output)) \n| extend value = toint(Val)\n| order by instance, moduleOutput, TimeGenerated\n| serialize\n| extend nextValue = next(value, 1)\n| extend nextInstance = next(instance, 1)\n| extend nextModuleOutput = next(moduleOutput, 1)\n| extend diff = iff(((value - nextValue) >= 0 and instance == nextInstance and moduleOutput == nextModuleOutput), value - nextValue, 0)\n| project TimeGenerated, device, instance, origin=moduleOutput, value, diff\n| summarize sum(diff) by origin\n| project origin, count=sum_diff\n};\ntotalDroppedMessagesCount()", "size": 4, "title": "Dropped Messages details", "exportFieldName": "origin", "exportParameterName": "MessageOrigin", "exportDefaultValue": "notselected", "queryType": 0, "resourceType": "{resourceType}", "crossComponentResources": [ "{resource}" ], "visualization": "table", "gridSettings": { "formatters": [ { "columnMatch": "count", "formatter": 0, "numberFormat": { "unit": 17, "options": { "style": "decimal", "maximumFractionDigits": 2 } } } ], "filter": true, "sortBy": [ { "itemKey": "$gen_number_count_1", "sortOrder": 2 } ], "labelSettings": [ { "columnId": "origin", "label": "Message origin" }, { "columnId": "count", "label": "Count" } ] }, "sortBy": [ { "itemKey": "$gen_number_count_1", "sortOrder": 2 } ] }, "customWidth": "40", "name": "failed-connects-by-client-reason" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "let deviceid = '{SelectedDevice}';\nlet startTime = {timeRange:start};\nlet endTime = {timeRange:end};\nlet numEntries = () {\nInsightsMetrics\n| where Tags contains deviceid\n| where Name == "edgehub_messages_dropped_total"\n| where TimeGenerated > startTime and TimeGenerated < endTime\n| count\n};\nlet totalDroppedMessagesCount = () { \nInsightsMetrics\n| where Tags contains deviceid\n| where TimeGenerated > startTime and TimeGenerated < endTime\n| where Name == "edgehub_messages_dropped_total"\n| extend dimensions=parse_json(Tags)\n| extend device = tostring(dimensions.edge_device)\n| extend instance = tostring(dimensions.instance_number)\n| extend moduleOutput = strcat(tostring(dimensions.from), '::', tostring(dimensions.from_route_output)) \n| extend value = toint(Val)\n| order by instance, moduleOutput, TimeGenerated\n| serialize\n| extend nextValue = next(value, 1)\n| extend nextInstance = next(instance, 1)\n| extend nextModuleOutput = next(moduleOutput, 1)\n| extend diff = iff(((value - nextValue) >= 0 and instance == nextInstance and moduleOutput == nextModuleOutput), value - nextValue, 0)\n| project TimeGenerated, device, instance, origin=moduleOutput, value, diff\n| make-series sum(diff) on TimeGenerated from (startTime - 5m) to endTime step 5m by origin\n//| summarize sum(diff) by TimeGenerated, origin\n};\ntotalDroppedMessagesCount()", "size": 1, "title": "Dropped messages (all origins)", "timeBrushParameterName": "timeRange", "queryType": 0, "resourceType": "{resourceType}", "crossComponentResources": [ "{resource}" ], "visualization": "scatterchart" }, "customWidth": "60", "conditionalVisibility": { "parameterName": "MessageOrigin", "comparison": "isEqualTo", "value": "notselected" }, "name": "all-origin-msg-dropped-chart" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "let deviceid = '{SelectedDevice}';\nlet startTime = {timeRange:start};\nlet endTime = {timeRange:end};\nlet numEntries = () {\nInsightsMetrics\n| where Tags contains deviceid\n| where Name == "edgehub_messages_dropped_total"\n| where TimeGenerated > startTime and TimeGenerated < endTime\n| count\n};\nlet totalDroppedMessagesCount = () { \nInsightsMetrics\n| where Tags contains deviceid\n| where TimeGenerated > startTime and TimeGenerated < endTime\n| where Name == "edgehub_messages_dropped_total"\n| extend dimensions=parse_json(Tags)\n| extend device = tostring(dimensions.edge_device)\n| extend instance = tostring(dimensions.instance_number)\n| extend moduleOutput = strcat(tostring(dimensions.from), '::', tostring(dimensions.from_route_output))\n| where moduleOutput == '{MessageOrigin}'\n| extend value = toint(Val)\n| order by instance, moduleOutput, TimeGenerated\n| serialize\n| extend nextValue = next(value, 1)\n| extend nextInstance = next(instance, 1)\n| extend nextModuleOutput = next(moduleOutput, 1)\n| extend diff = iff(((value - nextValue) >= 0 and instance == nextInstance and moduleOutput == nextModuleOutput), value - nextValue, 0)\n| project TimeGenerated, device, instance, origin=moduleOutput, value, diff\n| make-series Count=sum(diff) on TimeGenerated from (startTime - 5m) to endTime step 5m\n//| summarize Count=sum(diff) by TimeGenerated\n};\ntotalDroppedMessagesCount()", "size": 1, "title": "Dropped messages from {MessageOrigin}", "timeBrushParameterName": "timeRange", "timeBrushExportOnlyWhenBrushed": true, "queryType": 0, "resourceType": "{resourceType}", "crossComponentResources": [ "{resource}" ], "visualization": "scatterchart" }, "customWidth": "60", "conditionalVisibility": { "parameterName": "MessageOrigin", "comparison": "isNotEqualTo", "value": "notselected" }, "name": "selected-origin-message-dropped" } ] }, "conditionalVisibilities": [ { "parameterName": "ShowDroppedMessagesDetails", "comparison": "isEqualTo", "value": "yes" }, { "parameterName": "detailsDropdown", "comparison": "isNotEqualTo" } ], "name": "dropped-message-details" }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "items": [ { "type": 3, "content": { "version": "KqlItem/1.0", "query": "let deviceid = '{SelectedDevice}';\nlet startTime = {timeRange:start};\nlet endTime = {timeRange:end};\nlet numEntries = () {\n InsightsMetrics\n | where Tags contains deviceid\n | where Name == "edgehub_client_disconnect_total"\n | where TimeGenerated > startTime and TimeGenerated < endTime\n | count\n};\nlet totalDisconnectedClients = () { \n InsightsMetrics\n | where TimeGenerated > startTime and TimeGenerated < endTime\n | where Name == "edgehub_client_disconnect_total"\n | extend dimensions=parse_json(Tags)\n | extend device = tostring(dimensions.edge_device)\n | where device == deviceid\n | extend instance = tostring(dimensions.instance_number)\n | extend id = strcat(extract("DeviceId: (\\w*)", 1, tostring(dimensions.id), typeof(string)), '/', extract("ModuleId: (\\w*)", 1, tostring(dimensions.id), typeof(string)))\n | extend value = toint(Val)\n | order by instance, id, TimeGenerated\n | serialize\n | extend nextValue = next(value, 1)\n | extend nextInstance = next(instance, 1)\n | extend nextId = next(id, 1) \n | extend diff = iff(((value - nextValue) >= 0 and instance == nextInstance and id == nextId), value - nextValue, 0)\n | project TimeGenerated, device, instance, id, value, diff\n | summarize sum(diff) by id\n};\ntotalDisconnectedClients()", "size": 4, "title": "Client disconnect details", "exportFieldName": "id", "exportParameterName": "SelId", "exportDefaultValue": "notselected", "queryType": 0, "resourceType": "{resourceType}", "crossComponentResources": [ "{resource}" ], "visualization": "table", "gridSettings": { "formatters": [ { "columnMatch": "count", "formatter": 0, "numberFormat": { "unit": 17, "options": { "style": "decimal", "maximumFractionDigits": 2 } } } ], "filter": true, "sortBy": [ { "itemKey": "sum_diff", "sortOrder": 2 } ], "labelSettings": [ { "columnId": "id", "label": "Id" }, { "columnId": "sum_diff", "label": "Count" } ] }, "sortBy": [ { "itemKey": "sum_diff", "sortOrder": 2 } ] }, "customWidth": "40", "name": "client-disconnects-by-id" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "let deviceid = '{SelectedDevice}';\nlet startTime = {timeRange:start};\nlet endTime = {timeRange:end};\nlet numEntries = () {\n InsightsMetrics\n | where Tags contains deviceid\n | where Name == "edgehub_client_disconnect_total"\n | where TimeGenerated > startTime and TimeGenerated < endTime\n | count\n};\nlet totalDisconnectedClients = () { \n InsightsMetrics\n | where TimeGenerated > startTime and TimeGenerated < endTime\n | where Name == "edgehub_client_disconnect_total"\n | extend dimensions=parse_json(Tags)\n | extend device = tostring(dimensions.edge_device)\n | where device == deviceid\n | extend instance = tostring(dimensions.instance_number)\n | extend id = strcat(extract("DeviceId: (\\w*)", 1, tostring(dimensions.id), typeof(string)), '::', extract("ModuleId: (\\w*)", 1, tostring(dimensions.id), typeof(string)))\n | extend value = toint(Val)\n | order by instance, id, TimeGenerated\n | serialize\n | extend nextValue = next(value, 1)\n | extend nextInstance = next(instance, 1)\n | extend nextId = next(id, 1) \n | extend diff = iff(((value - nextValue) >= 0 and instance == nextInstance and id == nextId), value - nextValue, 0)\n | project TimeGenerated, device, instance, id, value, diff\n | make-series sum(diff) on TimeGenerated from (startTime - 5m) to endTime step 5m by id\n};\ntotalDisconnectedClients()", "size": 1, "title": "Client disconnects (all clients)", "timeBrushParameterName": "timeRange", "queryType": 0, "resourceType": "{resourceType}", "crossComponentResources": [ "{resource}" ], "visualization": "scatterchart" }, "customWidth": "60", "conditionalVisibility": { "parameterName": "SelId", "comparison": "isEqualTo", "value": "notselected" }, "name": "all-id-client-disconnects-chart" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "let deviceid = '{SelectedDevice}';\nlet selectedId = '{SelId}';\nlet startTime = {timeRange:start};\nlet endTime = {timeRange:end};\nlet numEntries = () {\n InsightsMetrics\n | where Tags contains deviceid\n | where Name == "edgehub_client_disconnect_total"\n | where TimeGenerated > startTime and TimeGenerated < endTime\n | count\n};\nlet totalDisconnectedClients = () { \n InsightsMetrics\n | where TimeGenerated > startTime and TimeGenerated < endTime\n | where Name == "edgehub_client_disconnect_total"\n | extend dimensions=parse_json(Tags)\n | extend device = tostring(dimensions.edge_device)\n | where device == deviceid\n | extend instance = tostring(dimensions.instance_number)\n | extend id = strcat(extract("DeviceId: (\\w*)", 1, tostring(dimensions.id), typeof(string)), '/', extract("ModuleId: (\\w*)", 1, tostring(dimensions.id), typeof(string)))\n | where id == selectedId\n | extend value = toint(Val)\n | order by instance, id, TimeGenerated\n | serialize\n | extend nextValue = next(value, 1)\n | extend nextInstance = next(instance, 1)\n | extend nextId = next(id, 1) \n | extend diff = iff(((value - nextValue) >= 0 and instance == nextInstance and id == nextId), value - nextValue, 0)\n | project TimeGenerated, device, instance, id, value, diff\n | make-series sum(diff) on TimeGenerated from (startTime - 5m) to endTime step 5m by id\n};\ntotalDisconnectedClients()", "size": 1, "showAnnotations": true, "title": "Disconnects by {SelId}", "timeContext": { "durationMs": 86400000 }, "timeBrushParameterName": "timeRange", "timeBrushExportOnlyWhenBrushed": true, "queryType": 0, "resourceType": "{resourceType}", "crossComponentResources": [ "{resource}" ], "visualization": "scatterchart" }, "customWidth": "60", "conditionalVisibility": { "parameterName": "SelId", "comparison": "isNotEqualTo", "value": "notselected" }, "name": "selected-id-client-disconnects" } ] }, "conditionalVisibilities": [ { "parameterName": "ShowClientDisconnectDetails", "comparison": "isEqualTo", "value": "yes" }, { "parameterName": "detailsDropdown", "comparison": "isNotEqualTo" } ], "name": "client-disconnects-details" }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "items": [ { "type": 3, "content": { "version": "KqlItem/1.0", "query": "\nlet deviceid = '{SelectedDevice}';\nlet startTime = {timeRange:start};\nlet endTime = {timeRange:end};\nlet numEntries = () {\nInsightsMetrics\n| where Tags contains deviceid\n| where Name == "edgehub_client_connect_failed_total"\n| where TimeGenerated > startTime and TimeGenerated < endTime\n| count\n};\nlet failedConnectsbyClientReason = () { \nInsightsMetrics\n| where Tags contains deviceid\n| where TimeGenerated > startTime and TimeGenerated < endTime\n| where Name == "edgehub_client_connect_failed_total"\n| extend dimensions=parse_json(Tags)\n| extend device = tostring(dimensions.edge_device)\n| extend instance = tostring(dimensions.instance_number)\n| extend reason = tostring(dimensions.reason)\n| extend client = tostring(dimensions.id)\n| extend clientReason = strcat(trim_start(@"[^/]+/", tostring(dimensions.id)), '::', tostring(dimensions.reason)) \n| extend value = toint(Val)\n| order by instance, clientReason, TimeGenerated\n| serialize\n| extend nextValue = next(value, 1)\n| extend nextInstance = next(instance, 1)\n| extend nextclientReason = next(clientReason, 1) \n| extend diff = iff(((value - nextValue) >= 0 and instance == nextInstance and clientReason == nextclientReason), value - nextValue, 0)\n| summarize sum(diff) by client, reason\n| where sum_diff > 0 \n| order by sum_diff\n};\nfailedConnectsbyClientReason()\n", "size": 1, "title": "Failed Connection details", "exportFieldName": "client", "exportParameterName": "FailedConnectClient", "exportDefaultValue": "notselected", "queryType": 0, "resourceType": "{resourceType}", "crossComponentResources": [ "{resource}" ], "visualization": "table", "gridSettings": { "formatters": [ { "columnMatch": "client", "formatter": 0, "formatOptions": { "customColumnWidthSetting": "37ch" } }, { "columnMatch": "reason", "formatter": 0, "formatOptions": { "customColumnWidthSetting": "19.5714ch" } }, { "columnMatch": "sum_diff", "formatter": 0, "formatOptions": { "customColumnWidthSetting": "11ch" }, "numberFormat": { "unit": 17, "options": { "style": "decimal" } } } ], "filter": true, "labelSettings": [ { "columnId": "client", "label": "Client" }, { "columnId": "reason", "label": "Failure reason" }, { "columnId": "sum_diff", "label": "Count" } ] } }, "customWidth": "40", "conditionalVisibility": { "parameterName": "FailedCount", "comparison": "isNotEqualTo", "value": "0" }, "name": "failed-connects-by-client-reason" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "\nlet deviceid = '{SelectedDevice}';\nlet startTime = {timeRange:start};\nlet endTime = {timeRange:end};\nlet numEntries = () {\nInsightsMetrics\n| where Tags contains deviceid\n| where Name == "edgehub_client_connect_failed_total"\n| where TimeGenerated > startTime and TimeGenerated < endTime\n| count\n};\nlet failedConnectsAllClients = () { \nInsightsMetrics\n| where Tags contains deviceid\n| where TimeGenerated > startTime and TimeGenerated < endTime\n| where Name == "edgehub_client_connect_failed_total"\n| extend dimensions=parse_json(Tags)\n| extend device = tostring(dimensions.edge_device)\n| extend instance = tostring(dimensions.instance_number)\n| extend reason = tostring(dimensions.reason)\n| extend client = tostring(dimensions.id)\n| extend clientReason = strcat(trim_start(@"[^/]+/", tostring(dimensions.id)), '::', tostring(dimensions.reason)) \n| extend value = toint(Val)\n| order by instance, clientReason, TimeGenerated\n| serialize\n| extend nextValue = next(value, 1)\n| extend nextInstance = next(instance, 1)\n| extend nextclientReason = next(clientReason, 1) \n| extend diff = iff(((value - nextValue) >= 0 and instance == nextInstance and clientReason == nextclientReason), value - nextValue, 0)\n//| where diff > 0\n| project TimeGenerated, Count=diff\n};\nfailedConnectsAllClients()\n", "size": 1, "title": "Failed connection attempts (all clients)", "queryType": 0, "resourceType": "{resourceType}", "crossComponentResources": [ "{resource}" ], "visualization": "scatterchart" }, "customWidth": "60", "conditionalVisibility": { "parameterName": "FailedConnectClient", "comparison": "isEqualTo", "value": "notselected" }, "name": "all-clients-failed-connect-chart" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "\nlet deviceid = '{SelectedDevice}';\nlet startTime = {timeRange:start};\nlet endTime = {timeRange:end};\nlet numEntries = () {\nInsightsMetrics\n| where Tags contains deviceid\n| where Name == "edgehub_client_connect_failed_total"\n| where TimeGenerated > startTime and TimeGenerated < endTime\n| count\n};\nlet failedConnectsSelectedClients = () { \nInsightsMetrics\n| where Tags contains deviceid\n| where TimeGenerated > startTime and TimeGenerated < endTime\n| where Name == "edgehub_client_connect_failed_total"\n| extend dimensions=parse_json(Tags)\n| extend device = tostring(dimensions.edge_device)\n| extend instance = tostring(dimensions.instance_number)\n| extend reason = tostring(dimensions.reason)\n| extend client = tostring(dimensions.id)\n| where client == '{FailedConnectClient}'\n| extend clientReason = strcat(trim_start(@"[^/]+/", tostring(dimensions.id)), '::', tostring(dimensions.reason)) \n| extend value = toint(Val)\n| order by instance, clientReason, TimeGenerated\n| serialize\n| extend nextValue = next(value, 1)\n| extend nextInstance = next(instance, 1)\n| extend nextclientReason = next(clientReason, 1) \n| extend diff = iff(((value - nextValue) >= 0 and instance == nextInstance and clientReason == nextclientReason), value - nextValue, 0)\n//| where diff > 0\n| project TimeGenerated, Count=diff\n};\nfailedConnectsSelectedClients()\n", "size": 1, "title": "Failed connection attempts by {FailedConnectClient}", "queryType": 0, "resourceType": "{resourceType}", "crossComponentResources": [ "{resource}" ], "visualization": "scatterchart" }, "customWidth": "60", "conditionalVisibility": { "parameterName": "FailedConnectClient", "comparison": "isNotEqualTo", "value": "notselected" }, "name": "selected-client-failed-connect-chart" } ] }, "conditionalVisibility": { "parameterName": "ShowFailedConnectionDetails", "comparison": "isEqualTo", "value": "yes" }, "name": "failed-connect-details" } ] }, "conditionalVisibilities": [ { "parameterName": "SelectedDevice", "comparison": "isNotEqualTo", "value": "default" }, { "parameterName": "messaging-view", "comparison": "isEqualTo", "value": "health" }, { "parameterName": "ShowPane", "comparison": "isEqualTo", "value": "messages" } ], "name": "health-group", "styleSettings": { "margin": "0px 0px -20px 0px" } }, { "type": 11, "content": { "version": "LinkItem/1.0", "style": "tabs", "links": [ { "id": "1405992b-9298-4604-9c3c-935bcaa1738f", "cellValue": "module-tab", "linkTarget": "parameter", "linkLabel": "Availability", "subTarget": "availability", "style": "link" }, { "id": "aa77cc14-fe19-4b98-81b7-c5cb4071bf44", "cellValue": "module-tab", "linkTarget": "parameter", "linkLabel": "Resource consumption", "subTarget": "resources", "style": "link" } ] }, "conditionalVisibility": { "parameterName": "ShowPane", "comparison": "isEqualTo", "value": "modules" }, "name": "module-view-links", "styleSettings": { "margin": "-15px 0px" } }, { "type": 9, "content": { "version": "KqlParameterItem/1.0", "parameters": [ { "id": "6f151e5e-2145-4aca-be0f-0fc5a03173a5", "version": "KqlParameterItem/1.0", "name": "hostInfoOstype", "type": 1, "query": "InsightsMetrics \n| where TimeGenerated > {timeRange:start}\n| where Name contains "metadata"\n| extend dimensions=parse_json(Tags)\n| extend device = tostring(dimensions.edge_device)\n| where device == '{SelectedDevice}'\n| extend host_info=tostring(dimensions.host_information)\n| summarize max(TimeGenerated) by host_info\n| extend host_info_=replace(@'\\', @'', host_info)\n| extend host_info_json=parse_json(host_info_)\n| extend ostype=tostring(host_info_json.OperatingSystemType)\n| top 1 by max_TimeGenerated desc\n| project ostype\n\n", "isHiddenWhenLocked": true, "timeContext": { "durationMs": 86400000 }, "queryType": 0, "resourceType": "{resourceType}" }, { "id": "40816037-a930-45c3-8795-54546064fa00", "version": "KqlParameterItem/1.0", "name": "hostInfoArch", "type": 1, "query": "InsightsMetrics \n| where TimeGenerated > {timeRange:start}\n| where Name contains "metadata"\n| extend dimensions=parse_json(Tags)\n| extend device = tostring(dimensions.edge_device)\n| where device == '{SelectedDevice}'\n| extend host_info=tostring(dimensions.host_information)\n| summarize max(TimeGenerated) by host_info\n| extend host_info_=replace(@'\\', @'', host_info)\n| extend host_info_json=parse_json(host_info_)\n| extend arch=tostring(host_info_json.Architecture)\n| top 1 by max_TimeGenerated desc\n| project arch\n\n\n", "isHiddenWhenLocked": true, "timeContext": { "durationMs": 86400000 }, "queryType": 0, "resourceType": "{resourceType}" }, { "id": "48d76d20-988a-45ed-94f7-afe0bf22cbdd", "version": "KqlParameterItem/1.0", "name": "hostInfoOs", "type": 1, "query": "InsightsMetrics \n| where TimeGenerated > {timeRange:start}\n| where Name contains "metadata"\n| extend dimensions=parse_json(Tags)\n| extend device = tostring(dimensions.edge_device)\n| where device == '{SelectedDevice}'\n| extend host_info=tostring(dimensions.host_information)\n| summarize max(TimeGenerated) by host_info\n| extend host_info_=replace(@'\\', @'', host_info)\n| extend host_info_json=parse_json(host_info_)\n| extend os=tostring(host_info_json.OperatingSystem)\n| top 1 by max_TimeGenerated desc\n| project os\n", "isHiddenWhenLocked": true, "timeContext": { "durationMs": 86400000 }, "queryType": 0, "resourceType": "{resourceType}" }, { "id": "9a90cad7-b0cc-4664-8007-b4bdf300ee7b", "version": "KqlParameterItem/1.0", "name": "hostInfoEdgedVer", "type": 1, "query": "InsightsMetrics \n| where TimeGenerated > {timeRange:start}\n| where Name contains "metadata"\n| extend dimensions=parse_json(Tags)\n| extend device = tostring(dimensions.edge_device)\n| where device == '{SelectedDevice}'\n| extend host_info=tostring(dimensions.host_information)\n| summarize max(TimeGenerated) by host_info\n| extend host_info_=replace(@'\\', @'', host_info)\n| extend host_info_json=parse_json(host_info_)\n| extend edgedver=tostring(host_info_json.Version)\n| extend edgedver = trim_end(@" ",edgedver)\n| top 1 by max_TimeGenerated desc\n| project edgedver\n", "isHiddenWhenLocked": true, "timeContext": { "durationMs": 86400000 }, "queryType": 0, "resourceType": "{resourceType}" }, { "id": "d06448f9-43de-475f-be29-f1eefd0e2cad", "version": "KqlParameterItem/1.0", "name": "hostInfoDockerVer", "type": 1, "query": "InsightsMetrics \n| where TimeGenerated > {timeRange:start}\n| where Name contains "metadata"\n| extend dimensions=parse_json(Tags)\n| extend device = tostring(dimensions.edge_device)\n| where device == '{SelectedDevice}'\n| extend host_info=tostring(dimensions.host_information)\n| summarize max(TimeGenerated) by host_info\n| extend host_info_=replace(@'\\', @'', host_info)\n| extend host_info_json=parse_json(host_info_)\n| extend dockerver=tostring(host_info_json.ServerVersion)\n| top 1 by max_TimeGenerated desc\n| project dockerver\n", "isHiddenWhenLocked": true, "timeContext": { "durationMs": 86400000 }, "queryType": 0, "resourceType": "{resourceType}" }, { "id": "0fe3225b-f2e0-4e1b-b87a-646149c5993d", "version": "KqlParameterItem/1.0", "name": "hostInfoNumCpus", "type": 1, "query": "InsightsMetrics \n| where TimeGenerated > {timeRange:start}\n| where Name contains "metadata"\n| extend dimensions=parse_json(Tags)\n| extend device = tostring(dimensions.edge_device)\n| where device == '{SelectedDevice}'\n| extend host_info=tostring(dimensions.host_information)\n| summarize max(TimeGenerated) by host_info\n| extend host_info_=replace(@'\\', @'', host_info)\n| extend host_info_json=parse_json(host_info_)\n| extend numcpu=tostring(host_info_json.NumCpus)\n| top 1 by max_TimeGenerated desc\n| project numcpu\n", "isHiddenWhenLocked": true, "timeContext": { "durationMs": 86400000 }, "queryType": 0, "resourceType": "{resourceType}" } ], "style": "pills", "queryType": 0, "resourceType": "{resourceType}" }, "name": "parameters - 15" }, { "type": 1, "content": { "json": "OS info
\n{hostInfoOs}
\n{hostInfoOstype} {hostInfoArch}
\n\nIoT Edge daemon version
\n{hostInfoEdgedVer}
\n\nDocker daemon version
\n{hostInfoDockerVer}
\n\n**# CPUs
**\n{hostInfoNumCpus}
\n\n\n\n" }, "customWidth": "20", "conditionalVisibility": { "parameterName": "ShowPane", "comparison": "isEqualTo", "value": "host" }, "name": "text - 16", "styleSettings": { "margin": "-20px 0px 0px 0px", "padding": "0px 0px 0px 12px" } }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "let startTime = ago(9h);\nInsightsMetrics\n| where TimeGenerated > {timeRange:start}\n| where Name == "edgeAgent_iotedged_uptime_seconds"\n| extend dimensions=parse_json(Tags)\n| extend device = tostring(dimensions.edge_device)\n| where device == '{SelectedDevice}'\n| project TimeGenerated, Val, Name="IoT Edge daemon"\n| union (\n InsightsMetrics \n | where TimeGenerated > startTime\n | where Name == "edgeAgent_host_uptime_seconds"\n | extend dimensions=parse_json(Tags)\n | extend device = tostring(dimensions.edge_device)\n | where device == '{SelectedDevice}'\n | project TimeGenerated, Val, Name="Host")\n| summarize arg_max(TimeGenerated, Val) by Name\n", "size": 1, "aggregation": 2, "title": "Uptime", "timeContext": { "durationMs": 14400000 }, "timeContextFromParameter": "timeRange", "queryType": 0, "resourceType": "{resourceType}", "crossComponentResources": [ "{resource}" ], "visualization": "tiles", "tileSettings": { "titleContent": { "columnMatch": "Name", "formatter": 1, "formatOptions": {} }, "leftContent": { "columnMatch": "Val", "formatter": 12, "formatOptions": { "palette": "auto" }, "numberFormat": { "unit": 24, "options": { "style": "decimal", "useGrouping": false, "maximumFractionDigits": 2, "maximumSignificantDigits": 3 } } }, "showBorder": false }, "chartSettings": { "xAxis": "TimeGenerated", "seriesLabelSettings": [ { "seriesName": "value", "label": "Memory used" } ], "xSettings": {}, "ySettings": { "numberFormatSettings": { "unit": 2, "options": { "style": "decimal", "useGrouping": true, "maximumFractionDigits": 2 } } } } }, "customWidth": "20", "conditionalVisibility": { "parameterName": "ShowPane", "comparison": "isEqualTo", "value": "host" }, "name": "host-uptime", "styleSettings": { "margin": "-30px 0px -40px" } }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "InsightsMetrics\n| where TimeGenerated > {timeRange:start}\n| where Name == "edgeAgent_used_cpu_percent" and Tags contains "host"\n| extend dimensions=parse_json(Tags)\n| extend quantile = tostring(dimensions.quantile)\n| where quantile == "0.9"\n| extend device = tostring(dimensions.edge_device)\n| where device == '{SelectedDevice}'\n| extend value = round(toint(Val),2)\n| project value, TimeGenerated", "size": 1, "aggregation": 3, "title": "CPU utilization (P90)", "timeContext": { "durationMs": 14400000 }, "timeContextFromParameter": "timeRange", "timeBrushParameterName": "timeRange", "timeBrushExportOnlyWhenBrushed": true, "queryType": 0, "resourceType": "{resourceType}", "crossComponentResources": [ "{resource}" ], "visualization": "areachart", "tileSettings": { "showBorder": false }, "graphSettings": { "type": 0 }, "chartSettings": { "xAxis": "TimeGenerated", "seriesLabelSettings": [ { "seriesName": "value", "label": "CPU %" } ], "ySettings": { "numberFormatSettings": { "unit": 1, "options": { "style": "decimal", "useGrouping": true, "maximumFractionDigits": 2 } }, "min": 0, "max": 100 } } }, "customWidth": "60", "conditionalVisibility": { "parameterName": "ShowPane", "comparison": "isEqualTo", "value": "host" }, "name": "host-cpu-query", "styleSettings": { "margin": "-30px 0px -20px" } }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "InsightsMetrics\n| where TimeGenerated > {timeRange:start}\n| where Name == "edgeAgent_available_disk_space_bytes"\n| extend dimensions=parse_json(Tags)\n| extend device = tostring(dimensions.edge_device)\n| where device == '{SelectedDevice}'\n| extend value = tolong(Val)\n| extend diskname = tostring(dimensions.disk_name)\n| extend diskfs = tostring(dimensions.disk_filesystem)\n| where diskfs != "overlay"\n| project diskname, value, TimeGenerated\n", "size": 1, "aggregation": 5, "title": "Available disk space", "timeContext": { "durationMs": 14400000 }, "timeContextFromParameter": "timeRange", "timeBrushParameterName": "timeRange", "timeBrushExportOnlyWhenBrushed": true, "queryType": 0, "resourceType": "{resourceType}", "crossComponentResources": [ "{resource}" ], "visualization": "areachart", "chartSettings": { "xAxis": "TimeGenerated", "seriesLabelSettings": [ { "seriesName": "value", "label": "CPU %" } ], "ySettings": { "numberFormatSettings": { "unit": 2, "options": { "style": "decimal", "useGrouping": true, "maximumFractionDigits": 2 } }, "min": 0 } } }, "customWidth": "40", "conditionalVisibility": { "parameterName": "ShowPane", "comparison": "isEqualTo", "value": "host" }, "name": "host-disk-query", "styleSettings": { "margin": "-18px 0px -18px 0px" } }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "InsightsMetrics\n| where TimeGenerated > {timeRange:start}\n| where Name == "edgeAgent_used_memory_bytes" and Tags contains "host"\n| extend dimensions=parse_json(Tags)\n| extend device = tostring(dimensions.edge_device)\n| where device == '{SelectedDevice}'\n| extend value = tolong(Val)\n| project value, TimeGenerated\n", "size": 1, "aggregation": 2, "title": "Memory usage", "timeContext": { "durationMs": 14400000 }, "timeContextFromParameter": "timeRange", "timeBrushParameterName": "timeRange", "timeBrushExportOnlyWhenBrushed": true, "queryType": 0, "resourceType": "{resourceType}", "crossComponentResources": [ "{resource}" ], "visualization": "areachart", "chartSettings": { "xAxis": "TimeGenerated", "seriesLabelSettings": [ { "seriesName": "value", "label": "Memory used" } ], "ySettings": { "numberFormatSettings": { "unit": 2, "options": { "style": "decimal", "useGrouping": true, "maximumFractionDigits": 2 } }, "min": 0 } } }, "customWidth": "60", "conditionalVisibility": { "parameterName": "ShowPane", "comparison": "isEqualTo", "value": "host" }, "name": "host-mem-query", "styleSettings": { "margin": "-18px 0px" } }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "items": [ { "type": 9, "content": { "version": "KqlParameterItem/1.0", "parameters": [ { "id": "1b675403-c608-4ab7-9d6d-df89f9b61163", "version": "KqlParameterItem/1.0", "name": "qlen", "type": 1, "isHiddenWhenLocked": true, "timeContext": { "durationMs": 86400000 } }, { "id": "1919d23e-3f7a-42ba-9bf8-920fe3178c98", "version": "KqlParameterItem/1.0", "name": "msgCount", "type": 1, "isHiddenWhenLocked": true, "timeContext": { "durationMs": 86400000 } }, { "id": "5924ed74-e8e3-4c12-b925-3abe65bc667c", "version": "KqlParameterItem/1.0", "name": "latency", "type": 1, "isHiddenWhenLocked": true, "timeContext": { "durationMs": 86400000 } }, { "id": "b4675984-4a2e-41fc-98fc-fc2e8b64c0bc", "version": "KqlParameterItem/1.0", "name": "id", "type": 1, "isHiddenWhenLocked": true, "timeContext": { "durationMs": 86400000 } }, { "id": "c922e9a0-a516-4bd2-a9e6-e6f84b61263b", "version": "KqlParameterItem/1.0", "name": "pid", "type": 1, "isHiddenWhenLocked": true, "timeContext": { "durationMs": 86400000 } }, { "id": "67ae97ff-8782-47ac-bcff-888a049ba062", "version": "KqlParameterItem/1.0", "name": "ep", "type": 1, "isHiddenWhenLocked": true, "timeContext": { "durationMs": 86400000 } } ], "style": "pills", "queryType": 0, "resourceType": "{resourceType}" }, "name": "gridParameters" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "let deviceid = '{SelectedDevice}';\nlet minPeriod = 5m;\nlet numPeriods = 24;\nlet startTime = {timeRange:start};\nlet endTime = {timeRange:end};\nlet timeBin_ = (endTime - startTime) / numPeriods;\nlet timeBin = iff(timeBin_ < minPeriod, minPeriod, timeBin_);\nlet data = InsightsMetrics\n | where TimeGenerated > startTime and TimeGenerated < endTime\n | where Name == "edgehub_messages_sent_total"\n | extend dimensions=parse_json(Tags)\n | extend device = tostring(dimensions.edge_device)\n | extend instance = tostring(dimensions.instance_number)\n | extend inputroute = tostring(dimensions.to_route_input)\n | extend outputroute = tostring(dimensions.from_route_output)\n | where device == deviceid\n | extend target = strcat(trim_start(@"[^/]+/", extractjson("$.to", tostring(dimensions), typeof(string))), iff(inputroute != "", strcat("::", inputroute), ""))\n | extend source = iff(tostring(dimensions.from) contains '{SelectedDevice}', strcat(trim_start(@"[^/]+/", tostring(dimensions.from)), iff(outputroute != "", strcat("::", outputroute), "")), tostring(dimensions.from))\n | extend messages = toint(Val)\n | extend timeUtc = TimeGenerated\n | extend sourceTarget = strcat(source, "+", target) \n | project timeUtc, device, source, target, sourceTarget, messages, instance\n | order by sourceTarget, timeUtc\n | serialize\n | extend nextCount = next(messages, 1)\n | extend nextSourceTarget= next(sourceTarget, 1)\n | extend nextInstance= next(instance, 1)\n | extend diff = iff((messages - nextCount) >= 0 and sourceTarget == nextSourceTarget and instance == nextInstance, messages - nextCount, iff(timeUtc - startTime > 2 * minPeriod, messages, 0))\n | project timeUtc, device, source, target, sourceTarget, messages, diff;\nlet set1 = data\n | summarize messageCount = sum(diff) by target, source, sourceTarget\n | extend ParentId=target\n | extend Id=sourceTarget\n | extend Name= iff(source contains '/', strcat('💻 ', source), strcat('📦 ', source))\n | project Name, Id, ParentId, target, source, messageCount;\nlet set2 = set1\n | union (set1\n | summarize messageCount=sum(messageCount) by target\n | extend Id=target\n | extend Name= iff((Id == "upstream"), strcat(' ☁️ ', Id), strcat(' 📞 ', Id))\n )\n | project-away target, source\n | order by messageCount;\nlet set3 = InsightsMetrics\n | where TimeGenerated > startTime and TimeGenerated < endTime\n | where Name == 'edgehub_message_send_duration_seconds'\n | extend dimensions=parse_json(Tags)\n | extend device = tostring(dimensions.edge_device)\n | extend instance = tostring(dimensions.instance_number)\n | extend inputroute = tostring(dimensions.to_route_input)\n | extend outputroute = tostring(dimensions.from_route_output)\n | where device == deviceid\n | extend target = strcat(trim_start(@"[^/]+/", extractjson("$.to", tostring(dimensions), typeof(string))), iff(inputroute != "", strcat("::", inputroute), ""))\n | extend source = iff(tostring(dimensions.from) contains '{SelectedDevice}', strcat(trim_start(@"[^/]+/", tostring(dimensions.from)), iff(outputroute != "", strcat("::", outputroute), "")), tostring(dimensions.from))\n | extend quantile = tostring(dimensions.quantile)\n | where quantile == '0.9'\n | where Val != 'NaN'\n | extend val = todouble(Val)\n | project TimeGenerated, target, source, val\n | extend Id=strcat(source, "+", target)\n | summarize P90Latency= round(percentile(val, 90), 6) by Id;\nlet msg_rate = set2\n | join kind=leftouter set3 on Id\n | project-away Id1\n | extend MsgRate = round(messageCount / ((now() - ago(4h)) / 1s), 2)\n | project Endpoint=Name, Id, ParentId, messageCount, MsgRate, P90Latency;\nlet queue_size = InsightsMetrics\n | where TimeGenerated > startTime and TimeGenerated < endTime\n | where Name == "edgehub_queue_length"\n | extend dimensions=parse_json(Tags)\n | extend device = tostring(dimensions.edge_device)\n | where device == deviceid\n | extend endpoint = trim_start(@"[^/]+/", tostring(dimensions.endpoint))\n | extend endpoint = replace_string(endpoint, "/", "::")\n | extend endpoint = iff((endpoint == "iothub"), "upstream", endpoint)\n | extend val = toint(Val)\n | project Id=endpoint, val, TimeGenerated\n | order by Id, TimeGenerated\n | summarize medianQSize=percentile(val, 95) by Id;\nmsg_rate \n| join kind=leftouter queue_size on Id\n| project-away Id1\n", "size": 0, "noDataMessage": "No messages were routed", "timeContext": { "durationMs": 14400000 }, "timeContextFromParameter": "timeRange", "exportedParameters": [ { "fieldName": "medianQSize", "parameterName": "qlen", "parameterType": 1, "defaultValue": "<n/a>" }, { "fieldName": "messageCount", "parameterName": "msgCount", "parameterType": 1 }, { "fieldName": "P90Latency", "parameterName": "latency", "parameterType": 1, "defaultValue": "" }, { "fieldName": "Id", "parameterName": "id", "parameterType": 1, "defaultValue": "" }, { "fieldName": "ParentId", "parameterName": "pid", "parameterType": 1, "defaultValue": "" }, { "fieldName": "Endpoint", "parameterName": "ep", "parameterType": 1 } ], "queryType": 0, "resourceType": "{resourceType}", "crossComponentResources": [ "{resource}" ], "visualization": "table", "gridSettings": { "formatters": [ { "columnMatch": "Id", "formatter": 5, "formatOptions": {} }, { "columnMatch": "ParentId", "formatter": 5, "formatOptions": {} }, { "columnMatch": "messageCount", "formatter": 4, "formatOptions": {}, "numberFormat": { "unit": 17, "options": { "style": "decimal", "minimumFractionDigits": 2, "maximumFractionDigits": 2 } }, "tooltipFormat": { "tooltip": "{0}" } }, { "columnMatch": "MsgRate", "formatter": 0, "formatOptions": {}, "numberFormat": { "unit": 31, "options": { "style": "decimal", "minimumFractionDigits": 1, "maximumFractionDigits": 1 } } }, { "columnMatch": "P90Latency", "formatter": 8, "formatOptions": { "min": 0, "palette": "green" }, "numberFormat": { "unit": 24, "options": { "style": "decimal", "minimumFractionDigits": 1, "maximumFractionDigits": 1 } } }, { "columnMatch": "medianQSize", "formatter": 8, "formatOptions": { "min": 0, "palette": "greenRed" } } ], "rowLimit": 150, "hierarchySettings": { "idColumn": "Id", "parentColumn": "ParentId", "treeType": 0, "expanderColumn": "Endpoint", "expandTopLevel": true }, "sortBy": [ { "itemKey": "$gen_number_MsgRate_4", "sortOrder": 1 } ], "labelSettings": [ { "columnId": "Endpoint" }, { "columnId": "Id" }, { "columnId": "ParentId" }, { "columnId": "messageCount", "label": "Count" }, { "columnId": "MsgRate", "label": "Rate" }, { "columnId": "P90Latency", "label": "Latency (p90)" }, { "columnId": "medianQSize", "label": "QLen (p90)", "comment": "Median queue length" } ] }, "sortBy": [ { "itemKey": "$gen_number_MsgRate_4", "sortOrder": 1 } ] }, "name": "message-details", "styleSettings": { "margin": "-25px 0px 0px 0px" } }, { "type": 9, "content": { "version": "KqlParameterItem/1.0", "parameters": [ { "id": "0cccb999-7dbb-4a15-85b6-cbb1b8c76329", "version": "KqlParameterItem/1.0", "name": "qlen", "type": 1, "isHiddenWhenLocked": true, "criteriaData": [ { "criteriaContext": { "operator": "Default", "rightValType": "param", "resultValType": "param", "resultVal": "qlen" } } ], "timeContext": { "durationMs": 86400000 } }, { "id": "cb1c1903-7010-46f9-883d-30dce00d54c5", "version": "KqlParameterItem/1.0", "name": "msgCount", "type": 1, "isHiddenWhenLocked": true, "criteriaData": [ { "criteriaContext": { "operator": "Default", "rightValType": "param", "resultValType": "param", "resultVal": "msgCount" } } ], "timeContext": { "durationMs": 86400000 } }, { "id": "518e4f08-c955-4809-8619-4fc2c8e0296a", "version": "KqlParameterItem/1.0", "name": "latency", "type": 1, "isHiddenWhenLocked": true, "criteriaData": [ { "criteriaContext": { "operator": "Default", "rightValType": "param", "resultValType": "param", "resultVal": "latency" } } ], "timeContext": { "durationMs": 86400000 } }, { "id": "e814dd36-a8c9-47eb-ad6b-569e7da72f6c", "version": "KqlParameterItem/1.0", "name": "id", "type": 1, "isHiddenWhenLocked": true, "criteriaData": [ { "criteriaContext": { "operator": "Default", "rightValType": "param", "resultValType": "param", "resultVal": "id" } } ], "timeContext": { "durationMs": 86400000 } }, { "id": "30a2b853-a025-4d4e-8b3b-790332e46acf", "version": "KqlParameterItem/1.0", "name": "pid", "type": 1, "isHiddenWhenLocked": true, "criteriaData": [ { "criteriaContext": { "operator": "Default", "rightValType": "param", "resultValType": "param", "resultVal": "pid" } } ], "timeContext": { "durationMs": 86400000 } }, { "id": "488b7ba9-3177-447b-8847-af887b94ba24", "version": "KqlParameterItem/1.0", "name": "ep", "type": 1, "isHiddenWhenLocked": true, "criteriaData": [ { "criteriaContext": { "operator": "Default", "rightValType": "param", "resultValType": "param", "resultVal": "ep" } } ], "timeContext": { "durationMs": 86400000 } } ], "style": "pills", "doNotRunWhenHidden": true, "queryType": 0, "resourceType": "{resourceType}" }, "customWidth": "0", "name": "mirroredGridParameters" } ], "exportParameters": true }, "customWidth": "50", "conditionalVisibilities": [ { "parameterName": "SelectedDevice", "comparison": "isNotEqualTo", "value": "default" }, { "parameterName": "ShowPane", "comparison": "isEqualTo", "value": "messages" }, { "parameterName": "messaging-view", "comparison": "isEqualTo", "value": "routing" } ], "name": "message-details-left-pane", "styleSettings": { "margin": "-40px 0px -20px 0px" } }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "let startTime = {timeRange:start};\nlet endTime = {timeRange:end};\nlet deviceid = '{SelectedDevice}';\nlet actual = InsightsMetrics\n| where TimeGenerated > startTime and TimeGenerated < endTime\n| where Name == "edgeAgent_total_time_running_correctly_seconds"\n| extend dimensions=parse_json(Tags)\n| extend device = tostring(dimensions.edge_device)\n| where device == deviceid\n| extend module = tostring(dimensions.module_name)\n// todo - account for agent restarts\n| summarize actualUptime=max(Val) by module;\nlet expected = InsightsMetrics\n| where TimeGenerated > startTime and TimeGenerated < endTime\n| where Name == "edgeAgent_total_time_expected_running_seconds"\n| extend dimensions=parse_json(Tags)\n| extend device = tostring(dimensions.edge_device)\n| where device == deviceid\n| extend module = tostring(dimensions.module_name)\n// todo - account for agent restarts\n| summarize expectedUptime=max(Val) by module;\nlet availability = expected\n| join actual on module\n| extend uptime=(actualUptime / expectedUptime) * 100\n| project module, uptime, expectedUptime, actualUptime;\nlet modulerestarts = InsightsMetrics\n| where TimeGenerated > startTime and TimeGenerated < endTime\n| where Name == "edgeAgent_module_start_total"\n| extend dimensions=parse_json(Tags)\n| extend device = tostring(dimensions.edge_device)\n| where device == deviceid\n| extend module = tostring(dimensions.module_name)\n| extend mversion = tostring(dimensions.module_version)\n| where mversion == "1.0" or module == "edgeHub"\n| extend instance = tostring(dimensions.instance_number)\n| extend value = toint(Val)\n| order by module, instance, TimeGenerated\n| serialize\n| extend nextValue = next(value, 1)\n| extend nextInstance = next(instance, 1)\n| extend nextmodule = next(module, 1)\n| project TimeGenerated, device, instance, nextInstance, module, nextmodule, value, nextValue\n| extend diff = iff((instance != nextInstance and module == nextmodule), 1, 0)\n| summarize sum(diff) by module\n| join kind=rightouter availability on module\n| project module=module1, uptime, expectedUptime, actualUptime, restarts=sum_diff\n| extend restartText = case(isnull(restarts), "No restarts",\n restarts == 0, "No restarts",\n restarts == 1, "1 restart", \n strcat(restarts, " restarts"));\nmodulerestarts\n\n\n\n", "size": 0, "timeContext": { "durationMs": 14400000 }, "timeContextFromParameter": "timeRange", "exportFieldName": "module", "exportParameterName": "moduleName", "queryType": 0, "resourceType": "{resourceType}", "crossComponentResources": [ "{resource}" ], "visualization": "graph", "sortBy": [], "graphSettings": { "type": 2, "topContent": { "columnMatch": "restartText", "formatter": 18, "formatOptions": { "thresholdsOptions": "icons", "thresholdsGrid": [ { "operator": "regex", "thresholdValue": "(^\d)", "representation": "2", "text": "{0}{1}" }, { "operator": "Default", "thresholdValue": null, "representation": "success", "text": "" } ] }, "tooltipFormat": { "tooltip": "# of module restarts. Green check = No restarts (in selected timerange)." } }, "centerContent": { "columnMatch": "module", "formatter": 1 }, "bottomContent": { "columnMatch": "uptime", "numberFormat": { "unit": 1, "options": { "style": "decimal", "useGrouping": false, "maximumFractionDigits": 2 } } }, "nodeIdField": "module", "graphOrientation": 3, "showOrientationToggles": false, "nodeSize": null, "staticNodeSize": 100, "colorSettings": { "nodeColorField": "uptime", "type": 4, "heatmapPalette": "redGreen", "heatmapMin": 0, "heatmapMax": 100 }, "hivesMargin": 2 } }, "customWidth": "50", "conditionalVisibilities": [ { "parameterName": "SelectedDevice", "comparison": "isNotEqualTo", "value": "default" }, { "parameterName": "module-tab", "comparison": "isEqualTo", "value": "availability" }, { "parameterName": "ShowPane", "comparison": "isEqualTo", "value": "modules" } ], "name": "module-hive-query", "styleSettings": { "margin": "-30px 0px 0px 0px" } }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "items": [ { "type": 3, "content": { "version": "KqlItem/1.0", "query": "let deviceid = '{SelectedDevice}';\nlet startTime = {timeRange:start};\nlet endTime = {timeRange:end};\nInsightsMetrics\n| where TimeGenerated > startTime and TimeGenerated < endTime\n| where Name == "edgeAgent_module_start_total"\n| extend dimensions=parse_json(Tags)\n| extend device = tostring(dimensions.edge_device)\n| where device == deviceid\n| extend module = tostring(dimensions.module_name)\n| extend mversion = tostring(dimensions.module_version)\n| where mversion == "1.0" or module == "edgeHub"\n| extend instance = tostring(dimensions.instance_number)\n| extend value = toint(Val)\n| order by module, instance, TimeGenerated\n| serialize\n| extend nextValue = next(value, 1)\n| extend nextInstance = next(instance, 1)\n| extend nextmodule = next(module, 1)\n| project TimeGenerated, device, instance, nextInstance, module, nextmodule, value, nextValue\n| extend diff = iff((instance != nextInstance and module == nextmodule), 1, 0)\n| make-series Count=sum(diff) on TimeGenerated from (startTime - 10m) to endTime step 10m by module\n\n", "size": 1, "title": "Module restart timeline", "timeContext": { "durationMs": 10885308, "endTime": "2021-06-08T12:59:51.947Z" }, "timeContextFromParameter": "timeRange", "timeBrushParameterName": "timeRange", "timeBrushExportOnlyWhenBrushed": true, "exportFieldName": "module", "exportParameterName": "moduleName", "queryType": 0, "resourceType": "{resourceType}", "crossComponentResources": [ "{resource}" ], "visualization": "scatterchart", "sortBy": [], "graphSettings": { "type": 2, "topContent": { "columnMatch": "restartText", "formatter": 18, "formatOptions": { "thresholdsOptions": "icons", "thresholdsGrid": [ { "operator": "regex", "thresholdValue": "(^\d)", "representation": "2", "text": "{0}{1}" }, { "operator": "Default", "thresholdValue": null, "representation": "success", "text": "" } ] }, "tooltipFormat": { "tooltip": "# of module restarts. Green check = No restarts (in selected timerange)." } }, "centerContent": { "columnMatch": "module", "formatter": 1 }, "bottomContent": { "columnMatch": "uptime", "numberFormat": { "unit": 1, "options": { "style": "decimal", "useGrouping": false, "maximumFractionDigits": 2 } } }, "nodeIdField": "module", "graphOrientation": 3, "showOrientationToggles": false, "nodeSize": null, "staticNodeSize": 100, "colorSettings": { "nodeColorField": "uptime", "type": 4, "heatmapPalette": "redGreen", "heatmapMin": 0, "heatmapMax": 100 }, "hivesMargin": 2 } }, "conditionalVisibilities": [ { "parameterName": "SelectedDevice", "comparison": "isNotEqualTo", "value": "default" }, { "parameterName": "module-tab", "comparison": "isEqualTo", "value": "availability" }, { "parameterName": "ShowPane", "comparison": "isEqualTo", "value": "modules" }, { "parameterName": "moduleName", "comparison": "isEqualTo" } ], "name": "module-restart-timeline", "styleSettings": { "margin": "0px 0px" } }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "items": [ { "type": 1, "content": { "json": "" }, "customWidth": "20", "name": "spacer" }, { "type": 1, "content": { "json": "
\n💡 Select a cell on the left to view module CPU/Memory use" }, "customWidth": "80", "name": "text - 1" } ] }, "name": "info-tip-group" } ] }, "customWidth": "50", "conditionalVisibilities": [ { "parameterName": "SelectedDevice", "comparison": "isNotEqualTo", "value": "default" }, { "parameterName": "module-tab", "comparison": "isEqualTo", "value": "availability" }, { "parameterName": "ShowPane", "comparison": "isEqualTo", "value": "modules" }, { "parameterName": "moduleName", "comparison": "isEqualTo", "value": "" } ], "name": "module-restart-group" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "InsightsMetrics\n| where TimeGenerated > {timeRange:start}\n| where Name == "edgeAgent_used_cpu_percent"\n| extend dimensions=parse_json(Tags)\n| extend quantile = tostring(dimensions.quantile)\n| where quantile == "0.9"\n| extend device = tostring(dimensions.edge_device)\n| where device == '{SelectedDevice}'\n| extend module = tostring(dimensions.module_name)\n| where module != "host" \n| extend value = todouble(Val)\n| order by TimeGenerated, module, value\n| project TimeGenerated, module, value", "size": 1, "aggregation": 5, "title": "CPU usage (P90, system level)", "timeContext": { "durationMs": 14400000 }, "timeContextFromParameter": "timeRange", "timeBrushParameterName": "timeRange", "timeBrushExportOnlyWhenBrushed": true, "exportFieldName": "module", "exportParameterName": "moduleName", "queryType": 0, "resourceType": "{resourceType}", "crossComponentResources": [ "{resource}" ], "visualization": "areachart", "graphSettings": { "type": 2, "topContent": { "formatter": 1, "formatOptions": {}, "numberFormat": { "unit": 1, "options": { "style": "decimal" } } }, "centerContent": { "columnMatch": "module", "formatter": 1, "formatOptions": {} }, "bottomContent": { "columnMatch": "uptime", "formatOptions": {}, "numberFormat": { "unit": 1, "options": { "style": "decimal", "useGrouping": false, "maximumFractionDigits": 2 } } }, "nodeIdField": "module", "nodeSize": null, "staticNodeSize": 100, "colorSettings": { "nodeColorField": "uptime", "type": 4, "heatmapPalette": "redGreen", "heatmapMin": 0, "heatmapMax": 100 }, "hivesMargin": 2 }, "chartSettings": { "xSettings": {}, "ySettings": { "numberFormatSettings": { "unit": 1, "options": { "style": "decimal", "useGrouping": true, "minimumFractionDigits": 1, "maximumFractionDigits": 1 } } } } }, "conditionalVisibilities": [ { "parameterName": "SelectedDevice", "comparison": "isNotEqualTo", "value": "default" }, { "parameterName": "module-tab", "comparison": "isEqualTo", "value": "resources" }, { "parameterName": "ShowPane", "comparison": "isEqualTo", "value": "modules" } ], "name": "all-modules-cpu" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "InsightsMetrics\n| where TimeGenerated > {timeRange:start}\n| where Name == "edgeAgent_used_memory_bytes"\n| extend dimensions=parse_json(Tags)\n| extend device = tostring(dimensions.edge_device)\n| where device == '{SelectedDevice}'\n| extend module = tostring(dimensions.module_name)\n| where module != "host" \n| extend value = tolong(Val)\n| order by TimeGenerated, module, value\n| project TimeGenerated, module, value", "size": 1, "aggregation": 5, "title": "Memory usage", "timeContext": { "durationMs": 14400000 }, "timeContextFromParameter": "timeRange", "timeBrushParameterName": "timeRange", "timeBrushExportOnlyWhenBrushed": true, "exportFieldName": "module", "exportParameterName": "moduleName", "queryType": 0, "resourceType": "{resourceType}", "crossComponentResources": [ "{resource}" ], "visualization": "areachart", "graphSettings": { "type": 2, "topContent": { "formatter": 1, "formatOptions": {}, "numberFormat": { "unit": 1, "options": { "style": "decimal" } } }, "centerContent": { "columnMatch": "module", "formatter": 1, "formatOptions": {} }, "bottomContent": { "columnMatch": "uptime", "formatOptions": {}, "numberFormat": { "unit": 1, "options": { "style": "decimal", "useGrouping": false, "maximumFractionDigits": 2 } } }, "nodeIdField": "module", "nodeSize": null, "staticNodeSize": 100, "colorSettings": { "nodeColorField": "uptime", "type": 4, "heatmapPalette": "redGreen", "heatmapMin": 0, "heatmapMax": 100 }, "hivesMargin": 2 }, "chartSettings": { "xSettings": {}, "ySettings": { "numberFormatSettings": { "unit": 2, "options": { "style": "decimal", "useGrouping": true, "minimumFractionDigits": 1, "maximumFractionDigits": 1 } } } } }, "conditionalVisibilities": [ { "parameterName": "SelectedDevice", "comparison": "isNotEqualTo", "value": "default" }, { "parameterName": "module-tab", "comparison": "isEqualTo", "value": "resources" }, { "parameterName": "ShowPane", "comparison": "isEqualTo", "value": "modules" } ], "name": "all-modules-mem" }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "loadType": "always", "items": [ { "type": 3, "content": { "version": "KqlItem/1.0", "query": "InsightsMetrics\n| where TimeGenerated > {timeRange:start} and TimeGenerated < {timeRange:end}\n| where Name == "edgeAgent_used_cpu_percent" and Tags contains "0.9"\n| extend dimensions=parse_json(Tags)\n| extend device = tostring(dimensions.edge_device)\n| where device == '{SelectedDevice}'\n| extend module = tostring(dimensions.module_name)\n| where module == '{moduleName}'\n| extend value = todouble(Val)\n| project value, TimeGenerated", "size": 1, "aggregation": 5, "showAnnotations": true, "title": "CPU usage by {moduleName}", "timeContext": { "durationMs": 14400000 }, "timeContextFromParameter": "timeRange", "timeBrushParameterName": "timeRange", "timeBrushExportOnlyWhenBrushed": true, "queryType": 0, "resourceType": "{resourceType}", "crossComponentResources": [ "{resource}" ], "visualization": "areachart", "chartSettings": { "seriesLabelSettings": [ { "seriesName": "value", "label": "CPU" } ], "ySettings": { "numberFormatSettings": { "unit": 1, "options": { "style": "decimal", "useGrouping": true, "minimumFractionDigits": 2, "maximumFractionDigits": 2 } }, "max": 100 } } }, "name": "module-cpu-query", "styleSettings": { "margin": "-10px 0px 0px 0px" } }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "InsightsMetrics\n| where TimeGenerated > {timeRange:start} and TimeGenerated < {timeRange:end}\n| where Name == "edgeAgent_used_memory_bytes" and Tags contains '{moduleName}' and Tags contains '{SelectedDevice}'\n| extend value = tolong(Val)\n| project value, TimeGenerated", "size": 1, "aggregation": 5, "showAnnotations": true, "title": "Memory consumed by {moduleName}", "timeContext": { "durationMs": 14400000 }, "timeContextFromParameter": "timeRange", "timeBrushParameterName": "timeRange", "timeBrushExportOnlyWhenBrushed": true, "queryType": 0, "resourceType": "{resourceType}", "crossComponentResources": [ "{resource}" ], "visualization": "areachart", "chartSettings": { "seriesLabelSettings": [ { "seriesName": "value", "label": "Memory" } ], "xSettings": {}, "ySettings": { "numberFormatSettings": { "unit": 2, "options": { "style": "decimal", "useGrouping": true, "maximumFractionDigits": 1 } } } } }, "name": "module-memory-query", "styleSettings": { "margin": "-20px 0px 0px -10px" } } ] }, "customWidth": "50", "conditionalVisibility": { "parameterName": "moduleName", "comparison": "isNotEqualTo" }, "name": "module-docker-metrics-group", "styleSettings": { "margin": "-20px 0px" } }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "items": [ { "type": 9, "content": { "version": "KqlParameterItem/1.0", "parameters": [ { "id": "a41bee60-0b7c-4160-aae9-197fd24fce7d", "version": "KqlParameterItem/1.0", "name": "qlen", "type": 1, "isHiddenWhenLocked": true, "criteriaData": [ { "criteriaContext": { "operator": "Default", "rightValType": "param", "resultValType": "param", "resultVal": "qlen" } } ], "timeContext": { "durationMs": 86400000 } }, { "id": "cce1ff6b-c91a-45d1-acb6-961faf781197", "version": "KqlParameterItem/1.0", "name": "msgCount", "type": 1, "isHiddenWhenLocked": true, "criteriaData": [ { "criteriaContext": { "operator": "Default", "rightValType": "param", "resultValType": "param", "resultVal": "msgCount" } } ], "timeContext": { "durationMs": 86400000 } }, { "id": "d3ddfc9e-e6a3-42a5-8b0a-9b6d729cbced", "version": "KqlParameterItem/1.0", "name": "latency", "type": 1, "isHiddenWhenLocked": true, "criteriaData": [ { "criteriaContext": { "operator": "Default", "rightValType": "param", "resultValType": "param", "resultVal": "latency" } } ], "timeContext": { "durationMs": 86400000 } }, { "id": "bd4f7b00-3a3b-433e-88fe-bdd8fcc0ad82", "version": "KqlParameterItem/1.0", "name": "id", "type": 1, "isHiddenWhenLocked": true, "criteriaData": [ { "criteriaContext": { "operator": "Default", "rightValType": "param", "resultValType": "param", "resultVal": "id" } } ], "timeContext": { "durationMs": 86400000 } }, { "id": "79b3b02a-9908-4c16-af3b-7b695864e7e4", "version": "KqlParameterItem/1.0", "name": "pid", "type": 1, "isHiddenWhenLocked": true, "criteriaData": [ { "criteriaContext": { "operator": "Default", "rightValType": "param", "resultValType": "param", "resultVal": "pid" } } ], "timeContext": { "durationMs": 86400000 } }, { "id": "c11ca709-4c83-456a-844d-5aeaa5d375b9", "version": "KqlParameterItem/1.0", "name": "ep", "type": 1, "isHiddenWhenLocked": true, "criteriaData": [ { "criteriaContext": { "operator": "Default", "rightValType": "param", "resultValType": "param", "resultVal": "ep" } } ], "timeContext": { "durationMs": 86400000 } } ], "style": "pills", "queryType": 0, "resourceType": "{resourceType}" }, "name": "capturedGridParameters" }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "items": [ { "type": 3, "content": { "version": "KqlItem/1.0", "query": "let endp0 = iff('{pid}' != "", '{pid}', '{id}');\nlet endp = iff(endp0 contains "::", replace_string(endp0, "::", "/"), endp0);\nInsightsMetrics\n| where TimeGenerated > {timeRange:start}\n| where Name == "edgehub_queue_length"\n| extend dimensions=parse_json(Tags)\n| extend device = tostring(dimensions.edge_device)\n| where device == '{SelectedDevice}'\n| extend ep = tostring(dimensions.endpoint)\n| where ep contains iff((endp == 'upstream'), "iothub", endp)\n| project TimeGenerated, Val\n| order by TimeGenerated asc", "size": 1, "aggregation": 2, "title": "Queue length trend for {ep}", "timeContext": { "durationMs": 14400000 }, "timeContextFromParameter": "timeRange", "timeBrushParameterName": "timeRange", "timeBrushExportOnlyWhenBrushed": true, "queryType": 0, "resourceType": "{resourceType}", "crossComponentResources": [ "{resource}" ], "visualization": "scatterchart", "chartSettings": { "xAxis": "TimeGenerated", "yAxis": [ "Val" ], "seriesLabelSettings": [ { "seriesName": "Val", "label": "Queue size" } ], "xSettings": {}, "ySettings": {} } }, "conditionalVisibility": { "parameterName": "qlen", "comparison": "isNotEqualTo" }, "name": "query - 0 - Copy", "styleSettings": { "margin": "-10px -10px" } }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "let endp = iff('{pid}' != "", '{pid}', '{id}');\nlet x = trim_end(@"[^+]+", '{id}');\nlet moduleid = substring(x,0, strlen(x)-1);\nlet targetSplit = split(endp, '::');\nlet sourceSplit = split(moduleid, '::');\nInsightsMetrics\n| where Name == 'edgehub_message_send_duration_seconds'\n| where TimeGenerated > {timeRange:start} and TimeGenerated < {timeRange:end}\n| extend dimensions=parse_json(Tags)\n| extend device = tostring(dimensions.edge_device)\n| where device == '{SelectedDevice}'\n| extend quantile = tostring(dimensions.quantile)\n| where quantile == '0.9'\n| extend target = trim_start(@"[^/]+/", extractjson("$.to", tostring(dimensions), typeof(string)))\n| extend targetInput = tostring(dimensions.to_route_input)\n| where target contains targetSplit[0]\n| where targetInput contains targetSplit[1]\n| extend source = iff(tostring(dimensions.from) contains 'tdkf', trim_start(@"[^/]+/", tostring(dimensions.from)), tostring(dimensions.from))\n| extend sourceOutput = tostring(dimensions.from_route_output)\n| where source contains sourceSplit[0]\n| where sourceOutput contains sourceSplit[1]\n| where Val != 'NaN'\n| extend val = todouble(Val)\n| project TimeGenerated, val", "size": 1, "aggregation": 3, "title": "Message send latency from {ep} to {pid}", "timeContext": { "durationMs": 14400000 }, "timeContextFromParameter": "timeRange", "timeBrushParameterName": "timeRange", "timeBrushExportOnlyWhenBrushed": true, "queryType": 0, "resourceType": "{resourceType}", "crossComponentResources": [ "{resource}" ], "visualization": "scatterchart", "chartSettings": { "xAxis": "TimeGenerated", "yAxis": [ "val" ], "seriesLabelSettings": [ { "seriesName": "Val", "label": "Queue size" }, { "seriesName": "val", "label": "Send latency" } ], "ySettings": { "numberFormatSettings": { "unit": 24, "options": { "style": "decimal", "useGrouping": true, "maximumFractionDigits": 2 } } } } }, "conditionalVisibilities": [ { "parameterName": "qlen", "comparison": "isEqualTo" }, { "parameterName": "id", "comparison": "isNotEqualTo" } ], "name": "query - 0 - Copyb", "styleSettings": { "margin": "-10px -10px" } }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "let minPeriod = 5m;\nlet startTime = {timeRange:start};\nlet endTime = {timeRange:end};\nlet endp = iff('{pid}' != "", '{pid}', '{id}');\nlet x = trim_end(@"[^+]+", '{id}');\nlet moduleid = substring(x,0, strlen(x)-1);\nlet targetSplit = split(endp, '::');\nlet sourceSplit = split(moduleid, '::');\nInsightsMetrics\n| where TimeGenerated > startTime and TimeGenerated < endTime\n| where Name == "edgehub_messages_sent_total"\n| extend dimensions=parse_json(Tags)\n| extend device = tostring(dimensions.edge_device)\n| where device == '{SelectedDevice}'\n| extend targetInput = (dimensions.to_route_input)\n| extend target = trim_start(@"[^/]+/", extractjson("$.to", tostring(dimensions), typeof(string)))\n| extend source = iff(tostring(dimensions.from) contains '{SelectedDevice}', trim_start(@"[^/]+/", tostring(dimensions.from)), tostring(dimensions.from))\n| extend sourceOutput = (dimensions.from_route_output)\n| where target contains targetSplit[0]\n| where targetInput contains targetSplit[1]\n| where source contains sourceSplit[0]\n| where sourceOutput contains sourceSplit[1]\n| extend messages = toint(Val)\n| order by TimeGenerated\n| serialize | extend nextCount = next(messages, 1) \n| extend diff = iff((messages - nextCount) >= 0, messages - nextCount, iff(TimeGenerated - startTime > 2minPeriod, messages, 0))\n| project TimeGenerated, diff;", "size": 1, "title": "Messages sent by {ep} to {pid}", "timeContext": { "durationMs": 14400000 }, "timeContextFromParameter": "timeRange", "timeBrushParameterName": "timeRange", "timeBrushExportOnlyWhenBrushed": true, "queryType": 0, "resourceType": "{resourceType}", "crossComponentResources": [ "{resource}" ], "visualization": "barchart", "tileSettings": { "showBorder": false }, "chartSettings": { "xAxis": "TimeGenerated", "yAxis": [ "diff" ], "seriesLabelSettings": [ { "seriesName": "diff", "label": "Messages sent" } ], "xSettings": {}, "ySettings": {} } }, "conditionalVisibility": { "parameterName": "latency", "comparison": "isNotEqualTo" }, "name": "query - 1", "styleSettings": { "margin": "-10px -10px" } }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "let startTime = {timeRange:start};\nlet endTime = {timeRange:end};\nlet minPeriod = 5m;\nlet endp = iff('{pid}' != "", '{pid}', '{id}');\nlet endpSplit = split(endp, '::');\nInsightsMetrics\n| where TimeGenerated > startTime and TimeGenerated < endTime\n| where Name == "edgehub_messages_sent_total"\n| extend dimensions=parse_json(Tags)\n| extend device = tostring(dimensions.edge_device)\n| extend target = tostring(extractjson("$.to",Tags,typeof(string)))\n| extend routeInput = (dimensions.to_route_input)\n| where device == '{SelectedDevice}'\n| where target contains endpSplit[0]\n| where routeInput contains endpSplit[1]\n| extend source = strcat(trim_start(@"[^/]+/", tostring(dimensions.from)), "::", tostring(dimensions.from_route_output)) \n| extend messages = toint(Val)\n| order by source, TimeGenerated\n| serialize | extend nextCount = next(messages, 1) | extend nextSource = next(source, 1)\n| extend diff = iff((messages - nextCount) >= 0 and source == nextSource, messages - nextCount, iff(TimeGenerated - startTime > 2minPeriod, messages, 0))\n| project source, TimeGenerated, messages=diff\n", "size": 1, "title": "Messages sent to {ep}", "timeContext": { "durationMs": 14400000 }, "timeContextFromParameter": "timeRange", "timeBrushParameterName": "timeRange", "timeBrushExportOnlyWhenBrushed": true, "queryType": 0, "resourceType": "{resourceType}", "crossComponentResources": [ "{resource}" ], "visualization": "barchart", "chartSettings": { "xAxis": "TimeGenerated", "yAxis": [ "messages" ], "seriesLabelSettings": [ { "seriesName": "diff", "label": "Messages sent" } ], "xSettings": {}, "ySettings": {} } }, "conditionalVisibilities": [ { "parameterName": "latency", "comparison": "isEqualTo" }, { "parameterName": "id", "comparison": "isNotEqualTo" } ], "name": "query - 1 - Copy", "styleSettings": { "margin": "-10px -10px" } } ], "exportParameters": true }, "conditionalVisibilities": [ { "parameterName": "id", "comparison": "isNotEqualTo", "value": "" }, { "parameterName": "ShowPane", "comparison": "isEqualTo", "value": "messages" }, { "parameterName": "messaging-view", "comparison": "isNotEqualTo", "value": "graph" } ], "name": "messaging-routing" }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "items": [ { "type": 3, "content": { "version": "KqlItem/1.0", "query": "let deviceid = '{SelectedDevice}';\nlet startTime = {timeRange:start};\nlet endTime = {timeRange:end};\nlet connectedClients = () { \nInsightsMetrics\n| where TimeGenerated > startTime and TimeGenerated < endTime\n| where Name == "edgehub_connected_clients"\n| extend dimensions=parse_json(Tags)\n| extend device = tostring(dimensions.edge_device)\n| where device == deviceid\n| extend instance = tostring(dimensions.instance_number)\n| extend value = toint(Val)\n| order by TimeGenerated\n| serialize\n| make-series Count=min(value) default=0 on TimeGenerated from (startTime - 5m) to endTime step 5m\n};\nconnectedClients()", "size": 1, "aggregation": 5, "title": "Connected clients count", "timeBrushParameterName": "timeRange", "timeBrushExportOnlyWhenBrushed": true, "queryType": 0, "resourceType": "{resourceType}", "crossComponentResources": [ "{resource}" ], "visualization": "unstackedbar" }, "name": "query - 1" }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "items": [ { "type": 1, "content": { "json": "" }, "customWidth": "25", "name": "spacer" }, { "type": 1, "content": { "json": "
\n\n💡 Select a row on the left to further drill-in" }, "customWidth": "75", "conditionalVisibility": { "parameterName": "messaging-view", "comparison": "isEqualTo", "value": "routing" }, "name": "text - 5b" } ] }, "name": "info-tip-group", "styleSettings": { "margin": "-20px 0px" } } ], "exportParameters": true }, "conditionalVisibilities": [ { "parameterName": "ShowPane", "comparison": "isEqualTo", "value": "messages" }, { "parameterName": "messaging-view", "comparison": "isNotEqualTo", "value": "graph" }, { "parameterName": "id", "comparison": "isEqualTo", "value": "" } ], "name": "connected-clients-group" }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "items": [ { "type": 3, "content": { "version": "KqlItem/1.0", "query": "let deviceid = '{SelectedDevice}';\nlet startTime = {timeRange:start};\nlet endTime = {timeRange:end};\nlet numEntries = () {\nInsightsMetrics\n| where Tags contains deviceid\n| where Name == "edgehub_connected_clients"\n| where TimeGenerated > startTime and TimeGenerated < endTime\n| count\n};\nlet connectedClients = () { \nInsightsMetrics\n| where TimeGenerated > startTime and TimeGenerated < endTime\n| where Name == "edgehub_connected_clients"\n| extend dimensions=parse_json(Tags)\n| extend device = tostring(dimensions.edge_device)\n| where device == deviceid\n| extend instance = tostring(dimensions.instance_number)\n| extend value = toint(Val)\n| order by TimeGenerated\n| serialize\n| make-series Count=min(value) on TimeGenerated from (startTime - 5m) to endTime step 5m\n\n};\nconnectedClients()", "size": 1, "aggregation": 5, "title": "Connected clients count", "timeContext": { "durationMs": 86400000 }, "timeBrushParameterName": "timeRange", "timeBrushExportOnlyWhenBrushed": true, "queryType": 0, "resourceType": "{resourceType}", "visualization": "barchart" }, "name": "query - 1" } ], "exportParameters": true }, "conditionalVisibilities": [ { "parameterName": "ShowPane", "comparison": "isEqualTo", "value": "messages" }, { "parameterName": "messaging-view", "comparison": "isNotEqualTo", "value": "graph" }, { "parameterName": "id", "comparison": "isEqualTo", "value": "" } ], "name": "connected-clients-group - Copy", "styleSettings": { "margin": "-10px 0px 0px 0px" } } ] }, "customWidth": "50", "conditionalVisibility": { "parameterName": "messaging-view", "comparison": "isEqualTo", "value": "routing" }, "name": "message-details-right-pane", "styleSettings": { "margin": "-40px 0px -10px 0px" } }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "let deviceid = '{SelectedDevice}';\nlet data = InsightsMetrics\n| where Name == "edgehub_messages_sent_total"\n| extend dimensions=parse_json(Tags)\n| extend device = tostring(dimensions.edge_device)\n| where device == deviceid\n| extend target = trim_start(@"[^/]+/", extractjson("$.to", tostring(dimensions), typeof(string)))\n| extend source = trim_start(@"[^/]+/", tostring(dimensions.from))\n| extend messages = toint(Val)\n| extend timeUtc = TimeGenerated\n| extend sourceTarget = strcat(source,"+",target) \n| project timeUtc, device, source, target, sourceTarget, messages\n| order by sourceTarget, timeUtc\n| serialize | extend nextCount = next(messages, 1) | extend nextSourceTarget= next(sourceTarget, 1)\n| extend diff = iff((messages - nextCount) >= 0, messages - nextCount, messages)\n| where sourceTarget == nextSourceTarget and diff >= 0\n| project timeUtc, device, source, target, sourceTarget, messages, diff;\ndata\n| summarize messageCount = sum(diff) by source, target\n| extend id = ''\n| project id, source, target, messageCount\n| union (data\n | sample-distinct 100 of source\n | extend id = source\n | union (data\n | sample-distinct 100 of target\n | extend id = target)\n | sample-distinct 100 of id\n | project id);", "size": 0, "noDataMessage": "No messages were routed", "timeContext": { "durationMs": 14400000 }, "timeContextFromParameter": "timeRange", "queryType": 0, "resourceType": "{resourceType}", "crossComponentResources": [ "{resource}" ], "visualization": "graph", "graphSettings": { "type": 0, "topContent": { "formatter": 1 }, "centerContent": { "columnMatch": "id", "formatter": 12, "numberFormat": { "unit": 0, "options": { "style": "decimal", "useGrouping": false, "maximumFractionDigits": 2, "maximumSignificantDigits": 3 } } }, "nodeIdField": "id", "sourceIdField": "source", "targetIdField": "target", "graphOrientation": 2, "showOrientationToggles": true, "edgeLabel": "messageCount", "nodeSize": null, "staticNodeSize": 100, "colorSettings": { "nodeColorField": "id", "type": 1, "colorPalette": "default" }, "hivesMargin": 5 } }, "conditionalVisibilities": [ { "parameterName": "SelectedDevice", "comparison": "isNotEqualTo", "value": "default" }, { "parameterName": "ShowPane", "comparison": "isEqualTo", "value": "messages" }, { "parameterName": "messaging-view", "comparison": "isEqualTo", "value": "graph" } ], "name": "message-graph" }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "items": [ { "type": 9, "content": { "version": "KqlParameterItem/1.0", "parameters": [ { "id": "253089fb-c419-4d7a-9270-897f3c1ea03b", "version": "KqlParameterItem/1.0", "name": "iothub", "type": 5, "value": "value::1", "isHiddenWhenLocked": true, "typeSettings": { "additionalResourceOptions": [ "value::1" ], "showDefault": false }, "timeContext": { "durationMs": 86400000 } }, { "id": "f5208507-2e2c-4b4d-b4f1-36d65cb58ea1", "version": "KqlParameterItem/1.0", "name": "servicekey", "type": 1, "query": "{"version":"ARMEndpoint/1.0","data":null,"headers":[],"method":"POST","path":"{iothub}/listKeys?api-version=2020-07-10-preview","urlParams":[],"batchDisabled":false,"transformers":[{"type":"jsonpath","settings":{"tablePath":"$.value[?(@.keyName == \"service\")].primaryKey","columns":[]}}]}", "isHiddenWhenLocked": true, "typeSettings": { "isPassword": true }, "timeContext": { "durationMs": 86400000 }, "queryType": 12 } ], "style": "pills", "queryType": 0, "resourceType": "{resourceType}" }, "name": "parameters - 0" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "{"version":"CustomEndpoint/1.0","data":"{\"apiVersion\":\"2018-06-30\",\"authorizationPolicyKey\":\"{servicekey}\",\"authorizationPolicyName\":\"service\",\"hostName\":\"{iothub:name}.azure-devices.net\",\"requestPath\":\"/twins/{SelectedDevice}/modules/%24edgeAgent/methods\",\"requestBody\":\"{\\\"methodName\\\":\\\"GetModuleLogs\\\",\\\"responseTimeoutInSeconds\\\":10,\\\"connectTimeoutInSeconds\\\":10,\\\"payload\\\":{\\\"schemaVersion\\\":\\\"1.0\\\",\\\"items\\\":[{\\\"id\\\":\\\"{capturedModuleName}\\\",\\\"filter\\\":{\\\"since\\\":\\\"{timeRange:startISO}\\\", \\\"until\\\":\\\"{timeRange:endISO}\\\"}}],\\\"encoding\\\":\\\"none\\\",\\\"contentType\\\":\\\"text\\\"}}\"}\n","headers":[{"key":"Content-Type","value":"application/json"}],"method":"POST","url":"https://main.iothub.ext.azure.com/api/dataPlane/post","contentType":"text/plain","urlParams":[],"transformers":[{"type":"jsonpath","settings":{"tablePath":"$.body.payload[0].payload","columns":[]}}]}", "size": 0, "noDataMessage": "Log content too large for selected module! Choose a shorter timerange.", "noDataMessageStyle": 4, "queryType": 10, "visualization": "card", "textSettings": { "style": "editor" } }, "name": "query - 1", "styleSettings": { "margin": "-10px 0px", "padding": "5px" } }, { "type": 12, "content": { "version": "NotebookGroup/1.0", "groupType": "editable", "title": "Refine time range", "expandable": true, "items": [ { "type": 3, "content": { "version": "KqlItem/1.0", "query": "let data=datatable(timestamp:datetime, metric: real)\n[\n datetime(2016-12-31T06:00), 0,\n];\ndata\n| make-series kind=nonempty avg(metric)on timestamp from {timeRange:start} to {timeRange:end} step 2m", "size": 4, "timeContext": { "durationMs": 86400000 }, "timeBrushParameterName": "timeRange", "timeBrushExportOnlyWhenBrushed": true, "queryType": 0, "resourceType": "{resourceType}", "visualization": "timechart", "chartSettings": { "group": null, "createOtherGroup": 0, "showMetrics": false, "ySettings": { "numberFormatSettings": { "unit": 0, "options": { "style": "decimal", "useGrouping": true } }, "min": 0, "max": 10 } } }, "name": "query - 3" } ] }, "name": "refineTimeRange" } ] }, "conditionalVisibility": { "parameterName": "ShowPane", "comparison": "isEqualTo", "value": "logs" }, "name": "logs-group", "styleSettings": { "margin": "-60px 0px -10px 0px", "padding": "0px 10px 0px 0px" } } ], "exportParameters": true }, "conditionalVisibility": { "parameterName": "InsightsMetricsExists", "comparison": "isEqualTo", "value": "yes" }, "name": "devicedetails-group", "styleSettings": { "margin": "-10px 0px -15px 0px", "padding": "8px 0px -15px 0px", "showBorder": true } } ], "fallbackResourceIds": [ ], "fromTemplateId": "community-Workbooks/IoTHub/IoT Edge device details", "$schema": "https://github.com/Microsoft/Application-Insights-Workbooks/blob/master/schema/workbook.json" }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment