Skip to content

Distributed Tracing for Java Azure Functions

Sonia Kulkarni edited this page Apr 21, 2020 · 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 see more logging details for the following requests, dependencies, logs and metrics.

https://docs.microsoft.com/en-us/azure/azure-monitor/app/java-in-process-agent#autocollected-requests-dependencies-logs-and-metrics

How to enable it for Java Function App? Navigate to the functions app, go to configurations. Under Application Settings select New application setting. Add the following two application settings with below values, then click Save on the upper left. DONE!

XDT_MicrosoftApplicationInsights_Java -> 1 ApplicationInsightsAgent_EXTENSION_VERSION -> ~2

What would you expect to see? In your Application Insights workspace, under Investigate in the left pane:

  1. Application Map blade
  2. Live Metrics blade - outgoing requests
  3. Performance blade - dependencies

Few things to keep in mind:

  • This feature is currently in private 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 this feature is useful for your scenario and any other feedback you may have, so we can improve different aspects of it and consider making this available out of the box with an optimized cold start if there is demand.

You can reach out to us with any feedback on [email protected]

Clone this wiki locally