{ "version": "Notebook/1.0", "items": [ { "type": 9, "content": { "version": "KqlParameterItem/1.0", "parameters": [ { "id": "fdf8406d-feec-42bd-8da1-affae4dbed83", "version": "KqlParameterItem/1.0", "name": "Time", "type": 4, "isRequired": true, "typeSettings": { "selectableValues": [ { "durationMs": 300000 }, { "durationMs": 900000 }, { "durationMs": 1800000 }, { "durationMs": 3600000 }, { "durationMs": 14400000 }, { "durationMs": 43200000 }, { "durationMs": 86400000 }, { "durationMs": 172800000 }, { "durationMs": 259200000 }, { "durationMs": 604800000 }, { "durationMs": 1209600000 }, { "durationMs": 2419200000 }, { "durationMs": 2592000000 }, { "durationMs": 5184000000 }, { "durationMs": 7776000000 } ] }, "timeContext": { "durationMs": 86400000 }, "value": { "durationMs": 86400000 } }, { "id": "529721b3-4f6a-4a28-832e-6496c299c58e", "version": "KqlParameterItem/1.0", "name": "Subscription", "type": 2, "multiSelect": true, "quote": "'", "delimiter": ",", "query": "ApimRequests\r\n| distinct subscription\r\n| sort by subscription asc", "typeSettings": { "additionalResourceOptions": [] }, "timeContext": { "durationMs": 0 }, "timeContextFromParameter": "Time", "queryType": 0, "resourceType": "microsoft.insights/components", "value": [] }, { "id": "5ae86289-64b1-4d6d-82c8-1e657455225a", "version": "KqlParameterItem/1.0", "name": "Api", "type": 2, "multiSelect": true, "quote": "'", "delimiter": ",", "query": "let subscriptionFilter = dynamic([{Subscription}]);\r\n\r\nApimRequests\r\n| where array_length(subscriptionFilter) == 0 or subscription in (subscriptionFilter)\r\n| distinct api\r\n| sort by api asc", "typeSettings": { "additionalResourceOptions": [] }, "timeContext": { "durationMs": 0 }, "timeContextFromParameter": "Time", "queryType": 0, "resourceType": "microsoft.insights/components" }, { "id": "397b1738-8446-4d25-8200-377001155b53", "version": "KqlParameterItem/1.0", "name": "Success", "type": 2, "typeSettings": { "additionalResourceOptions": [] }, "jsonData": "[\r\n { \"value\": \"true\", \"label\": \"yes\"},\r\n { \"value\": \"false\", \"label\": \"no\"}\r\n]", "timeContext": { "durationMs": 0 }, "timeContextFromParameter": "Time", "value": null } ], "style": "pills", "queryType": 0, "resourceType": "microsoft.insights/components" }, "name": "parameters - 0" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "ApimRequests\r\n| summarize \r\n requests=strcat('Total # of requests: ', count()), \r\n failures=strcat('Total # of failures: ', countif(success==false)),\r\n errors=countif(toint(resultCode)>=500)\r\n by api", "size": 4, "title": "Total # of errors per API (status code >=500)", "timeContextFromParameter": "Time", "queryType": 0, "resourceType": "microsoft.insights/components", "visualization": "tiles", "tileSettings": { "titleContent": { "columnMatch": "api", "formatter": 1 }, "subtitleContent": { "columnMatch": "requests" }, "leftContent": { "columnMatch": "errors", "formatter": 12, "formatOptions": { "palette": "auto" }, "numberFormat": { "unit": 17, "options": { "maximumSignificantDigits": 3, "maximumFractionDigits": 2 } } }, "secondaryContent": { "columnMatch": "failures" }, "showBorder": false, "sortCriteriaField": "api", "sortOrderField": 1 } }, "name": "query - 2" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "let subscriptionFilter = dynamic([{Subscription}]);\r\nlet apiFilter = dynamic([{Api}]);\r\nlet successFilter = '{Success}';\r\n\r\nApimRequests\r\n| where array_length(subscriptionFilter) == 0 or subscription in (subscriptionFilter)\r\n| where array_length(apiFilter) == 0 or api in (apiFilter)\r\n| where isempty(successFilter) or success == tobool(successFilter)\r\n| project timestamp\r\n , subscription\r\n , api\r\n , name\r\n , success\r\n , resultCode\r\n , duration = strcat(round(duration, 1), \" ms\")\r\n , details = itemId\r\n , transaction = itemId\r\n , sessionCorrelationId\r\n| order by timestamp desc", "size": 1, "title": "Requests", "timeContextFromParameter": "Time", "exportFieldName": "sessionCorrelationId", "exportParameterName": "SelectedSessionCorrelationId", "queryType": 0, "resourceType": "microsoft.insights/components", "visualization": "table", "gridSettings": { "formatters": [ { "columnMatch": "timestamp", "formatter": 0, "formatOptions": { "customColumnWidthSetting": "20.5ch" } }, { "columnMatch": "subscription", "formatter": 0, "formatOptions": { "customColumnWidthSetting": "16ch" } }, { "columnMatch": "success", "formatter": 0, "formatOptions": { "customColumnWidthSetting": "12ch" } }, { "columnMatch": "resultCode", "formatter": 0, "formatOptions": { "customColumnWidthSetting": "15ch" } }, { "columnMatch": "duration", "formatter": 0, "formatOptions": { "customColumnWidthSetting": "13ch" } }, { "columnMatch": "details", "formatter": 7, "formatOptions": { "linkTarget": "RequestDetails", "linkLabel": "details", "linkIsContextBlade": true, "customColumnWidthSetting": "11ch" } }, { "columnMatch": "transaction", "formatter": 7, "formatOptions": { "linkTarget": "RequestDetails", "linkLabel": "transaction", "customColumnWidthSetting": "15ch" } } ], "filter": true } }, "name": "query - 1" }, { "type": 3, "content": { "version": "KqlItem/1.0", "query": "ApimRequests\r\n| where sessionCorrelationId == '{SelectedSessionCorrelationId}'\r\n| project timestamp\r\n , subscription\r\n , api\r\n , name\r\n , success\r\n , resultCode\r\n , duration = strcat(round(duration, 1), \" ms\")\r\n , details = itemId\r\n , transaction = itemId\r\n| order by timestamp desc", "size": 0, "title": "Requests for session: {SelectedSessionCorrelationId}", "timeContextFromParameter": "Time", "queryType": 0, "resourceType": "microsoft.insights/components", "visualization": "table", "gridSettings": { "formatters": [ { "columnMatch": "timestamp", "formatter": 0, "formatOptions": { "customColumnWidthSetting": "20ch" } }, { "columnMatch": "subscription", "formatter": 0, "formatOptions": { "customColumnWidthSetting": "16ch" } }, { "columnMatch": "success", "formatter": 0, "formatOptions": { "customColumnWidthSetting": "12ch" } }, { "columnMatch": "resultCode", "formatter": 0, "formatOptions": { "customColumnWidthSetting": "15ch" } }, { "columnMatch": "duration", "formatter": 0, "formatOptions": { "customColumnWidthSetting": "13ch" } }, { "columnMatch": "details", "formatter": 7, "formatOptions": { "linkTarget": "RequestDetails", "linkLabel": "details", "linkIsContextBlade": true, "customColumnWidthSetting": "11ch" } }, { "columnMatch": "transaction", "formatter": 7, "formatOptions": { "linkTarget": "RequestDetails", "linkLabel": "transaction", "customColumnWidthSetting": "15ch" } } ] } }, "conditionalVisibility": { "parameterName": "SelectedSessionCorrelationId", "comparison": "isNotEqualTo" }, "name": "query - 3" } ], "fallbackResourceIds": [ "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/my-test/providers/microsoft.insights/components/appin-robo-test" ], "$schema": "https://github.com/Microsoft/Application-Insights-Workbooks/blob/master/schema/workbook.json" }