跳过导航

E2E diagnostic provision CLI ·

How to use

Setup Environment

Make sure node version is not less than V7.6.0 (node -v)
Install Node JS from here

Install E2E diagnostic provision CLI from NPM repository

npm install e2e-diagnostic-provision-cli -g --registry=https://www.myget.org/F/e2e-diagnostic-provision-cli/npm

e2e-provision

Work flow of E2E diagnostic provision CLI

Which resources will be deployed

In this tool, we will create several resources necessary for end to end diagnostics. We will create a new resource group to hold all created resources.
You can create a new IoT Hub or use existing one.
Then diagnostics info will be exported to Event Hub, and the flow is like this.

It will create an Event Hub, Application Insights, Storage account(for function app), Function app

Query logs

After exporting distributed tracing to Application Insights, you may query logs as you want, some sample queries are listed below:

Query all logs

 requests | union dependencies | where id matches regex "^00-.*?-.*?-01$" | order by timestamp desc 

Query all failed logs

requests | union dependencies | where success == "False" 

Query all routing disabled logs

let logs = requests | union dependencies | where id matches regex "^00-.*?-.*?-01$" | extend traceId = substring(id, 0,35);
let RoutingDisabledlogsTraceId = logs | where customDimensions.isRoutingEnabled == "False" | project traceId;
logs | join kind = inner RoutingDisabledlogsTraceId on traceId | order by id

Query logs with specific trace id

requests | union dependencies | where id matches regex "^00-.*?-.*?-01$" | extend traceId = substring(id, 3,32) | where traceId == "0CCEBFC39C3F848005CC31196A77B0BB"

Query top 10 logs with maximum latency

requests | union dependencies | order by duration desc | take 10

Query logs do not reach the last service, except routing disabled logs

let logs = requests | union dependencies | where id matches regex "^00-.*?-.*?-01$" | extend traceId = substring(id, 0,35);
let incompleteLogTraceId = logs | summarize logNum=count(traceId) by traceId | where logNum < 5;
let incompleteLogs = logs | join kind = inner incompleteLogTraceId on traceId;
let incompleteLogsWithRoutingDisabled = incompleteLogs | where customDimensions.isRoutingEnabled == "False" | project traceId = substring(id, 0,35);
let reachLastServiceLogTraceId = incompleteLogs | where name == "Third Party Service Ingress Latency" | project traceId = substring(id, 0,35);
let notReachLastServiceLogTraceId = incompleteLogTraceId | join kind=leftanti reachLastServiceLogTraceId on traceId;
let notReachLastServiceLogTraceIdExceptRoutingDisabled = notReachLastServiceLogTraceId | join kind=leftanti incompleteLogsWithRoutingDisabled on traceId;
logs | join kind = inner notReachLastServiceLogTraceIdExceptRoutingDisabled on traceId | order by id