Skip to content

Distributed Tracing for Java Azure Functions

kaibocai edited this page Feb 1, 2022 · 35 revisions

What is distributed tracing?

Distributed tracing is the equivalent of call stacks for modern cloud and microservices architectures, with the addition of a simplistic performance profiler thrown in. In Azure Monitor, we provide two experiences for consuming distributed trace data. The first is our transaction diagnostics view, which is like a call stack with a time dimension added in. The transaction diagnostics view provides visibility into one single transaction/request, and is helpful for finding the root cause of reliability issues and performance bottlenecks on a per request basis.

Azure Monitor also offers an application map view which aggregates many transactions to show a topological view of how the systems interact, and what the average performance and error rates are.

What is being supported by Java Azure Functions ?

You can now view richer data from your function applications pertaining to the following requests, dependencies, logs and metrics.

How to enable it for Java Function Apps?

Navigate to the functions app Overview blade, go to configurations. Under Application Settings click "+ New application setting". Add the following two application settings with below values, then click Save on the upper left. DONE!

Windows:

  • XDT_MicrosoftApplicationInsights_Java -> 1
  • ApplicationInsightsAgent_EXTENSION_VERSION -> ~2

Linux Dedicated

  • ApplicationInsightsAgent_EXTENSION_VERSION -> ~3

Linux Consumption

  • APPLICATIONINSIGHTS_ENABLE_AGENT: true

What would you expect to see in Application Insights?

  • Application Map - Application Map helps you spot performance bottlenecks or failure hotspots across all components and dependencies of your distributed application.

  • End-to-end transaction monitoring - Use end-to-end transaction monitoring to view one single distributed trace . This enables easy diagnostics for the application component, dependency, or exception that caused a transaction slowdown or failure.

  • Dashboards - Application Insights provides you an overview dashboard to allow quick, at-a-glance assessment of your application's health and performance. The dashboard allows you to drill-down into failures, performance etc.

  • Live Stream Metrics - Live Metrics Stream provides near-real-time performance indicators to make sure everything works as expected. Live stream can be used for various scenarios such as to validate a fix while it is released, by watching performance and failure counts, or observing the effect of test loads, and diagnosing issues live.

  • Smart Detection - Smart detections needs no configuration and provides automatic alerts that adapt to your app's normal patterns of telemetry and trigger when there's something outside the usual pattern.

  • Metrics Explorer - Explore, filter, and segment aggregated data such as rates of requests, failures, and exceptions, response times, and page load times.

  • Analytics - Answer tough questions about your app's performance and usage with KQL – a powerful query language.

Few things to keep in mind:

  • This feature is currently in public preview for Java Azure Functions, and has a cold start implication of 8-9 seconds in the Consumption plan.
  • We would love to hear if you find this feature useful for your scenario and any other feedback that you may have so as to improve on its various aspects. We will consider making this functionality available out of the box by default with an optimized cold start based on demand.

Feedback

You can reach out to us with any feedback on javaazurefunctions@microsoft.com