Chapter 1 · AZ-204: Developing Solutions for Microsoft Azure Monitor and Troubleshoot Azure Solutions
Application Insights – Metrics, Logs and Traces
20 practice questions · 5 marks weightage
Practice questions
- Question 1Q-347372See the answer and solution
A production ASP.NET Core API uses Application Insights. The operations team wants a dashboard showing the number of failed requests and the trend in server response time without analyzing individual telemetry records. Which approach is most appropriate?
- A.Use Application Insights Metrics Explorer with the Failed requests and Server response time metrics.
- B.Enable verbose tracing and count log messages every time the dashboard loads.
- C.Query dependency telemetry because request metrics are not collected automatically.
- D.Store every request in a custom application database and calculate the values there.
- Question 2Q-7291B8See the answer and solution
An application sends request and trace telemetry to a workspace-based Application Insights resource. You need to find failed requests together with error-level traces produced during the same operation. Which Kusto query correctly correlates the two telemetry types?
- A.AppRequests | where Success == false | project OperationId, RequestName=Name, RequestTime=TimeGenerated | join kind=inner (AppTraces | where SeverityLevel >= 3 | project OperationId, TraceTime=TimeGenerated, Message) on OperationId
- B.AppRequests | where Success == false | join kind=inner (AppTraces | where SeverityLevel >= 3) on Name
- C.AppRequests | where Success == false | project OperationId | union AppTraces | where SeverityLevel >= 3
- D.AppTraces | where SeverityLevel == "Error" | join kind=inner (AppRequests | where Success == false) on Message
- Question 3Q-635074See the answer and solution
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.
- 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.
- Question 4Q-3A6691See the answer and solution
A .NET worker records one CPU-utilization value every second and needs an accurate one-minute average in Application Insights Metrics Explorer. Which code is the most appropriate way to record the custom metric?
- A.telemetryClient.TrackTrace($"CPU: {cpuPercent}");
- B.telemetryClient.GetMetric("CpuUtilization").TrackValue(cpuPercent);
- C.telemetryClient.TrackEvent("CpuUtilization", new Dictionary<string, string> { ["Value"] = cpuPercent.ToString() });
- D.telemetryClient.TrackRequest("CpuUtilization", DateTimeOffset.UtcNow, TimeSpan.FromSeconds(cpuPercent), "200", true);
- Question 5Q-D7B25BSee the answer and solution
An ASP.NET Core application sends informational traces with a custom property named Region. You need a KQL query that returns only trace messages from the west region whose message contains the term timeout. Which query is correct?
- A.traces | where tostring(customDimensions["Region"]) == "west" and message has "timeout"
- B.traces | where Region == "west" and message == "timeout"
- C.traces | where tostring(customDimensions["Region"]) == "west" | where message == "timeout"
- D.traces | where tostring(customDimensions["Region"]) contains "west" | where customDimensions["message"] has "timeout"
15 more questions on Application Insights – Metrics, Logs and Traces
Sign up free to practise the full chapter. Questions you get wrong come back until you've mastered them.
Start practising freeFree to start · No credit card needed