%3CLINGO-SUB%20id%3D%22lingo-sub-1877849%22%20slang%3D%22en-US%22%3EAzure%20Logic%20Apps%20Running%20Anywhere%20%E2%80%93%20Monitor%20with%20Application%20Insights%20%E2%80%93%20part%201%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1877849%22%20slang%3D%22en-US%22%3E%3CP%3EIn%20our%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fintegrations-on-azure%2Fazure-logic-apps-running-anywhere-runtime-deep-dive%2Fba-p%2F1835564%22%20target%3D%22_blank%22%20rel%3D%22noopener%22%3Eprevious%20post%3C%2FA%3E%20about%20the%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Flogic-apps%2Fcreate-stateful-stateless-workflows-visual-studio-code%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAzure%20Logic%20Apps%20(Preview)%20extension%20for%20Visual%20Studio%20Code%3C%2FA%3E%2C%20we%20provided%20an%20deep%20dive%20into%20how%20the%20redesigned%20Logic%20Apps%20runtime%20is%20hosted%20as%20an%20extension%20on%20the%20Azure%20Functions%20runtime.%20We%20also%20covered%20how%20the%20runtime%20interprets%20a%20workflow%20definition%20as%20jobs%20that%20are%20durably%20run%20by%20the%20Logic%20Apps%20orchestration%20engine.%3C%2FP%3E%0A%3CP%3EIn%20this%20post%2C%20we%20explore%20the%20telemetry%20that%20the%20runtime%20emits%20during%20workflow%20execution%20along%20with%20other%20emitted%20events.%20You%20can%20use%20this%20telemetry%20to%20get%20better%20visibility%20into%20how%20well%20your%20workflows%20run%20and%20how%20the%20runtime%20works%20in%20various%20ways.%20This%20post%20also%20describes%20how%20you%20can%20monitor%20your%20workflows%20by%20using%20Application%20Insights%20and%20learn%20about%20the%20available%20trace%20types%20that%20you%20can%20use%20for%20logging.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH1%20id%3D%22toc-hId-587570186%22%20id%3D%22toc-hId-587570186%22%3EIntegration%20with%20Application%20Insights%3C%2FH1%3E%0A%3CP%3EThe%20redesigned%20runtime%20includes%20built-in%20integration%20with%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fazure-monitor%2Fapp%2Fapp-insights-overview%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EApplication%20Insights%3C%2FA%3E%2C%20providing%20you%20near%20real-time%20telemetry%20(live%20metrics).%20This%20capability%20can%20help%20you%20investigate%20failures%20and%20performance%20problems%20more%20easily%20when%20you%20use%20this%20data%20to%20diagnose%20issues%2C%20set%20up%20alerts%2C%20and%20build%20charts.%3C%2FP%3E%0A%3CP%3ETo%20open%20Application%20Insights%20for%20a%20logic%20app%20that%20you%20created%20using%20the%20preview%20extension%20and%20deployed%20to%20Azure%2C%20follow%20these%20steps%3A%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3EIn%20the%20Azure%20portal%2C%20find%20your%20deployed%20logic%20app.%3C%2FLI%3E%0A%3CLI%3EOn%20the%20logic%20app%20menu%2C%20under%20%3CSTRONG%3ESettings%3C%2FSTRONG%3E%2C%20select%20%3CSTRONG%3EApplication%20Insights%3C%2FSTRONG%3E.%3C%2FLI%3E%0A%3CLI%3EIf%20your%20subscription%20already%20has%20Application%20Insights%20enabled%2C%20on%20the%20Application%20Insights%20pane%2C%20select%20%3CSTRONG%3EView%20Application%20Insights%20data%3C%2FSTRONG%3E.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3EIf%20your%20subscription%20doesn't%20have%20Application%20Insights%20enabled%2C%20on%20the%20Application%20Insights%20pane%2C%20select%20%3CSTRONG%3ETurn%20on%20Application%20Insights%3C%2FSTRONG%3E.%20After%20the%20pane%20updates%2C%20at%20the%20bottom%2C%20select%20%3CSTRONG%3EApply%3C%2FSTRONG%3E.%3C%2FP%3E%0A%3CP%3EFor%20example%2C%20when%20Application%20Insights%20is%20already%20enabled%2C%20the%20pane%20looks%20like%20this%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Picture4.png%22%20style%3D%22width%3A%20624px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F232964iB0711F74EC670642%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Picture4.png%22%20alt%3D%22Picture4.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWhen%20Application%20Insights%20isn't%20enabled%20yet%2C%20the%20pane%20looks%20like%20this%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Picture5.png%22%20style%3D%22width%3A%20624px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F232966i15266B6B8E2E3AF6%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Picture5.png%22%20alt%3D%22Picture5.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EApplication%20Insights%20opens%20and%20shows%20various%20metrics%20for%20your%20logic%20app%2C%20for%20example%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Picture6.png%22%20style%3D%22width%3A%20624px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F232967iE149D3A950A89C10%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Picture6.png%22%20alt%3D%22Picture6.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH1%20id%3D%22toc-hId--1219884277%22%20id%3D%22toc-hId--1219884277%22%3EAvailable%20trace%20types%3C%2FH1%3E%0A%3CP%3EEach%20time%20that%20a%20workflow-related%20event%20happens%2C%20for%20example%2C%20when%20a%20workflow%20is%20triggered%20or%20when%20an%20action%20runs%2C%20the%20runtime%20emits%20various%20traces.%20These%20traces%20cover%20the%20lifetime%20of%20the%20workflow%20run%20and%20include%2C%20but%20aren't%20limited%20to%2C%20the%20following%20types%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EService%20activity%2C%20such%20as%20start%2C%20stop%2C%20and%20errors.%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fintegrations-on-azure%2Fazure-logic-apps-running-anywhere-runtime-deep-dive%2Fba-p%2F1835564%22%20target%3D%22_blank%22%20rel%3D%22noopener%22%3EJobs%20and%20dispatcher%3C%2FA%3E%20activity.%3C%2FLI%3E%0A%3CLI%3EWorkflow%20activity%2C%20such%20as%20trigger%2C%20action%2C%20and%20run.%3C%2FLI%3E%0A%3CLI%3EStorage%20request%20activity%2C%20such%20as%20success%20or%20failure.%3C%2FLI%3E%0A%3CLI%3EHTTP%20request%20activity%2C%20such%20as%20inbound%2C%20outbound%2C%20success%2C%20and%20failure.%3C%2FLI%3E%0A%3CLI%3EAd-hoc%20development%20traces%2C%20such%20as%20debug%20messages.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3EEach%20event%20type%20is%20assigned%20a%20severity%20level.%20This%20table%20shows%20the%20severity%20level%20that's%20assigned%20to%20each%20trace%20type%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CTABLE%3E%0A%3CTBODY%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22108%22%3E%3CP%3E%3CSTRONG%3ESeverity%20level%3C%2FSTRONG%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22516%22%3E%3CP%3E%3CSTRONG%3ETrace%20type%3C%2FSTRONG%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22108%22%3E%3CP%3ECritical%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22516%22%3E%3CP%3ELogs%20that%20describe%20an%20unrecoverable%20failure%20in%20your%20logic%20app.%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22108%22%3E%3CP%3EDebug%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22516%22%3E%3CP%3ELogs%20that%20you%20can%20use%20for%20investigation%20during%20development%2C%20for%20example%2C%20inbound%20and%20outbound%20HTTP%20calls.%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22108%22%3E%3CP%3EError%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22516%22%3E%3CP%3ELogs%20that%20indicate%20a%20failure%20in%20workflow%20execution%2C%20but%20not%20a%20general%20failure%20in%20your%20logic%20app.%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22108%22%3E%3CP%3EInformation%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22516%22%3E%3CP%3ELogs%20that%20track%20the%20general%20activity%20in%20your%20logic%20app%20or%20workflow%2C%20for%20example%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EWhen%20a%20trigger%2C%20action%2C%20or%20run%20starts%20and%20ends.%3C%2FLI%3E%0A%3CLI%3EWhen%20your%20logic%20app%20starts%20or%20ends.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22108%22%3E%3CP%3ETrace%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22516%22%3E%3CP%3ELogs%20that%20contain%20the%20most%20detailed%20messages%2C%20for%20example%2C%20storage%20requests%20or%20dispatcher%20activity.%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22108%22%3E%3CP%3EWarning%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22516%22%3E%3CP%3ELogs%20that%20highlight%20an%20abnormal%20state%20in%20your%20logic%20app%20but%20doesn't%20prevent%20its%20running.%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3C%2FTBODY%3E%0A%3C%2FTABLE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYou%20can%20adjust%20the%20severity%20level%20for%20the%20data%20that's%20captured%20by%20your%20logic%20app%20and%20transmitted%20to%20Application%20Insights%2C%20based%20on%20the%20trace%20type%20that%20you%20want.%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3EIn%20the%20Visual%20Studio%20Code%20project%20for%20your%20logic%20app%2C%20find%20the%20host.json%20file%20that%20exists%20at%20the%20project%20root%20location.%3C%2FLI%3E%0A%3CLI%3EEdit%20the%20host.json%20file%20by%20selecting%20the%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fdotnet%2Fapi%2Fmicrosoft.extensions.logging.loglevel%3Fview%3Ddotnet-plat-ext-3.1%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3ELogLevel%3C%2FA%3E%20enum%20value%20based%20on%20the%20trace%20type%20that%20you%20want.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3EThe%20host.json%20file%20is%20included%20with%20the%20artifact%20that%20deploys%20to%20Azure%20Functions%2C%20along%20with%20other%20files%20such%20as%20the%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fintegrations-on-azure%2Fazure-logic-apps-running-anywhere-runtime-deep-dive%2Fba-p%2F1835564%22%20target%3D%22_blank%22%20rel%3D%22noopener%22%3Eworkflow.json%20file%20and%20connections.json%20file%3C%2FA%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH1%20id%3D%22toc-hId-1267628556%22%20id%3D%22toc-hId-1267628556%22%3ESample%20host.json%20file%3C%2FH1%3E%0A%3CP%3EThis%20example%20host.json%20file%20sets%20logging%20to%20the%20%22Trace%22%20severity%20level%2C%20which%20captures%20the%20most%20detailed%20messages%2C%20such%20as%20storage%20requests%2C%20plus%20all%20the%20messages%20that%20are%20related%20to%20workflow%20execution%20activity%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-json%22%3E%3CCODE%3E%7B%0A%20%20%20%20%22version%22%3A%20%222.0%22%2C%0A%20%20%20%20%22logging%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%22logLevel%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%22Host.Triggers.Workflows%22%3A%20%22Trace%22%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%7D%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20%22logging%22%20node%20controls%20the%20log%20type%20filtering%20%3CEM%3Efor%20all%20the%20workflows%20in%20your%20logic%20app%3C%2FEM%3E%20and%20follows%20the%20ASP.NET%20Core%20layout%20for%20log%20type%20filtering.%20To%20specify%20the%20log%20type%20for%20your%20logic%20app%2C%20in%20the%20%22logLevel%22%20object%2C%20set%20the%20%22Host.Triggers.Workflows%22%20property%20to%20log%20type%20that%20you%20want.%20For%20more%20information%20about%20logging%20in%20.NET%20Core%2C%20see%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Faspnet%2Fcore%2Ffundamentals%2Flogging%2F%3Fview%3Daspnetcore-2.1%26amp%3Bpreserve-view%3Dtrue%23log-filtering%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3ELog%20filtering%3C%2FA%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20next%20post%20in%20this%20series%20explores%20the%20ways%20that%20you%20can%20query%20the%20telemetry%20data%20for%20your%20logic%20app's%20workflows.%20This%20post%20also%20covers%20the%20ways%20that%20you%20can%20track%20workflow%20behavior%20and%20the%20performance%20for%20your%20hosting%20environment.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1877849%22%20slang%3D%22en-US%22%3E%3CP%3EIn%20this%20post%2C%20we%20explore%20the%20telemetry%20that%20the%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fintegrations-on-azure%2Fazure-logic-apps-running-anywhere-runtime-deep-dive%2Fba-p%2F1835564%22%20target%3D%22_self%22%3Eredesigned%20Logic%20Apps%20runtime%3C%2FA%3E%20emits%20during%20workflow%20execution%20along%20with%20other%20emitted%20events.%20You%20can%20use%20this%20telemetry%20to%20get%20better%20visibility%20into%20how%20well%20your%20workflows%20run%20and%20how%20the%20runtime%20works%20in%20various%20ways.%20This%20post%20also%20describes%20how%20you%20can%20monitor%20your%20workflows%20by%20using%20Application%20Insights%20and%20learn%20about%20the%20available%20trace%20types%20that%20you%20can%20use%20for%20logging.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22teaser.JPG%22%20style%3D%22width%3A%20420px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F232968i881413309480F457%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22teaser.JPG%22%20alt%3D%22teaser.JPG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1877849%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ELogic%20Apps%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Microsoft

In our previous post about the Azure Logic Apps (Preview) extension for Visual Studio Code, we provided an deep dive into how the redesigned Logic Apps runtime is hosted as an extension on the Azure Functions runtime. We also covered how the runtime interprets a workflow definition as jobs that are durably run by the Logic Apps orchestration engine.

In this post, we explore the telemetry that the runtime emits during workflow execution along with other emitted events. You can use this telemetry to get better visibility into how well your workflows run and how the runtime works in various ways. This post also describes how you can monitor your workflows by using Application Insights and learn about the available trace types that you can use for logging.

 

Integration with Application Insights

The redesigned runtime includes built-in integration with Application Insights, providing you near real-time telemetry (live metrics). This capability can help you investigate failures and performance problems more easily when you use this data to diagnose issues, set up alerts, and build charts.

To open Application Insights for a logic app that you created using the preview extension and deployed to Azure, follow these steps:

  1. In the Azure portal, find your deployed logic app.
  2. On the logic app menu, under Settings, select Application Insights.
  3. If your subscription already has Application Insights enabled, on the Application Insights pane, select View Application Insights data.

If your subscription doesn't have Application Insights enabled, on the Application Insights pane, select Turn on Application Insights. After the pane updates, at the bottom, select Apply.

For example, when Application Insights is already enabled, the pane looks like this:

 

Picture4.png

 

When Application Insights isn't enabled yet, the pane looks like this:

 

Picture5.png

 

Application Insights opens and shows various metrics for your logic app, for example:

 

Picture6.png

 

Available trace types

Each time that a workflow-related event happens, for example, when a workflow is triggered or when an action runs, the runtime emits various traces. These traces cover the lifetime of the workflow run and include, but aren't limited to, the following types:

  • Service activity, such as start, stop, and errors.
  • Jobs and dispatcher activity.
  • Workflow activity, such as trigger, action, and run.
  • Storage request activity, such as success or failure.
  • HTTP request activity, such as inbound, outbound, success, and failure.
  • Ad-hoc development traces, such as debug messages.

Each event type is assigned a severity level. This table shows the severity level that's assigned to each trace type:

 

Severity level

Trace type

Critical

Logs that describe an unrecoverable failure in your logic app.

Debug

Logs that you can use for investigation during development, for example, inbound and outbound HTTP calls.

Error

Logs that indicate a failure in workflow execution, but not a general failure in your logic app.

Information

Logs that track the general activity in your logic app or workflow, for example:

  • When a trigger, action, or run starts and ends.
  • When your logic app starts or ends.

Trace

Logs that contain the most detailed messages, for example, storage requests or dispatcher activity.

Warning

Logs that highlight an abnormal state in your logic app but doesn't prevent its running.

 

You can adjust the severity level for the data that's captured by your logic app and transmitted to Application Insights, based on the trace type that you want.

  1. In the Visual Studio Code project for your logic app, find the host.json file that exists at the project root location.
  2. Edit the host.json file by selecting the LogLevel enum value based on the trace type that you want.

The host.json file is included with the artifact that deploys to Azure Functions, along with other files such as the workflow.json file and connections.json file.

 

Sample host.json file

This example host.json file sets logging to the "Trace" severity level, which captures the most detailed messages, such as storage requests, plus all the messages that are related to workflow execution activity:

 

{
    "version": "2.0",
    "logging": {
        "logLevel": {
            "Host.Triggers.Workflows": "Trace"
        }
    }
}

 

The "logging" node controls the log type filtering for all the workflows in your logic app and follows the ASP.NET Core layout for log type filtering. To specify the log type for your logic app, in the "logLevel" object, set the "Host.Triggers.Workflows" property to log type that you want. For more information about logging in .NET Core, see Log filtering.

 

The next post in this series explores the ways that you can query the telemetry data for your logic app's workflows. This post also covers the ways that you can track workflow behavior and the performance for your hosting environment.