Giter VIP home page Giter VIP logo

e2e-diagnostic-provision-cli's Introduction

E2E diagnostic provision CLI · GitHub license npm version

How to use

Setup Environment

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

(Option 1) 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

(Option 2) Compile and Run package locally

For Distributed Tracing bug bash, please use branch publicpreview

npm install
node e2e-provision.js

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 < 3;
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 == "Egress 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 

e2e-diagnostic-provision-cli's People

Contributors

erich-wang avatar michaeljqzq avatar sldragon avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.