Microsoft Certified: DevOps Engineer ExpertImplement an instrumentation strategyMedium

A team is developing a serverless application using Azure Functions and needs to implement distributed tracing to understand the end-to-end flow of requests across multiple functions and external services. The tracing should be integrated with Azure Monitor for visualization and analysis. Which approach should they use to implement distributed tracing for their Azure Functions?

  1. AEnable Application Insights for the Function App and use its distributed tracing capabilities.
  2. BDeploy a custom OpenTelemetry collector sidecar alongside each function.
  3. CUse Azure Event Hubs to stream trace data between functions.
  4. DManually add custom log entries with correlation IDs to each function.
Show answer & explanation

Correct answer: A. Enable Application Insights for the Function App and use its distributed tracing capabilities.

Azure Application Insights automatically provides distributed tracing for Azure Functions by collecting telemetry data, including dependencies and requests, and correlating them across service boundaries. This requires minimal configuration and offers rich visualization.

Why the other options are wrong

  • B. While OpenTelemetry is a valid approach for distributed tracing, Application Insights offers built-in, managed integration for Azure Functions, making it a simpler and more native solution without requiring custom collector deployments.
  • C. Event Hubs is a streaming service and does not inherently provide distributed tracing capabilities; it would require custom processing to achieve this.
  • D. Manual correlation ID logging is cumbersome, error-prone, and lacks the automated visualization and dependency mapping provided by Application Insights.

Application Insights Distributed Tracing

A feature of Application Insights that visualizes the end-to-end flow of requests across different components and services in a distributed application.

  • Automatically correlates telemetry data (requests, dependencies, logs).
  • Provides a 'transaction search' and 'application map' for visualization.
  • Supports various Azure services and SDKs for instrumentation.

Memory trick: Application Insights traces the journey of every request.

More Implement an instrumentation strategy questions