Application Insights – Metrics, Logs and Traces · AZ-204: Developing Solutions for Microsoft Azure Monitor and Troubleshoot Azure Solutions
A multi-instance .NET service must publish a reliable count of checkout attempts. Adaptive sampling is enabled for request and trace telemetry, and t…
Practice question from Application Insights – Metrics, Logs and Traces (AZ-204: Developing Solutions for Microsoft Azure Monitor and Troubleshoot Azure Solutions), with the correct answer and a step-by-step solution.
hard · MCQ · Q-635074
A multi-instance .NET service must publish a reliable count of checkout attempts. Adaptive sampling is enabled for request and trace telemetry, and the count must remain accurate even when traffic is high. Which implementation is most appropriate?
- A.Call telemetryClient.TrackEvent("CheckoutAttempt") for every checkout and rely on the sampled event count.
- B.Create a metric with telemetryClient.GetMetric("CheckoutAttempts") and call metric.TrackValue(1) for each checkout attempt.Correct answer
- C.Write an informational ILogger message for every checkout and count the resulting AppTraces records.
- D.Call telemetryClient.TrackTrace("CheckoutAttempt") for every checkout and disable metric aggregation.
Solution
GetMetric creates a locally preaggregated custom metric, reducing telemetry volume and avoiding the loss of counts caused by sampling individual events or traces. Application Insights aggregates the metric data from the service instances, making it suitable for a high-volume count.
More from Application Insights – Metrics, Logs and Traces
- A production ASP.NET Core API uses Application Insights. The operations team wants a dashboard showing the number of failed requests and th…
- An application sends request and trace telemetry to a workspace-based Application Insights resource. You need to find failed requests toget…
- A .NET worker records one CPU-utilization value every second and needs an accurate one-minute average in Application Insights Metrics Explo…
- An ASP.NET Core application sends informational traces with a custom property named Region. You need a KQL query that returns only trace me…
Practise more Monitor and Troubleshoot Azure Solutions
Sign up free for adaptive practice on this chapter, with instant feedback and hints on every question.
Start practising freeFree to start · No credit card needed