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

  1. Question 1Q-347372

    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?

    1. A.Use Application Insights Metrics Explorer with the Failed requests and Server response time metrics.
    2. B.Enable verbose tracing and count log messages every time the dashboard loads.
    3. C.Query dependency telemetry because request metrics are not collected automatically.
    4. D.Store every request in a custom application database and calculate the values there.
    See the answer and solution
  2. Question 2Q-7291B8

    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?

    1. 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
    2. B.AppRequests | where Success == false | join kind=inner (AppTraces | where SeverityLevel >= 3) on Name
    3. C.AppRequests | where Success == false | project OperationId | union AppTraces | where SeverityLevel >= 3
    4. D.AppTraces | where SeverityLevel == "Error" | join kind=inner (AppRequests | where Success == false) on Message
    See the answer and solution
  3. Question 3Q-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?

    1. A.Call telemetryClient.TrackEvent("CheckoutAttempt") for every checkout and rely on the sampled event count.
    2. B.Create a metric with telemetryClient.GetMetric("CheckoutAttempts") and call metric.TrackValue(1) for each checkout attempt.
    3. C.Write an informational ILogger message for every checkout and count the resulting AppTraces records.
    4. D.Call telemetryClient.TrackTrace("CheckoutAttempt") for every checkout and disable metric aggregation.
    See the answer and solution
  4. Question 4Q-3A6691

    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?

    1. A.telemetryClient.TrackTrace($"CPU: {cpuPercent}");
    2. B.telemetryClient.GetMetric("CpuUtilization").TrackValue(cpuPercent);
    3. C.telemetryClient.TrackEvent("CpuUtilization", new Dictionary<string, string> { ["Value"] = cpuPercent.ToString() });
    4. D.telemetryClient.TrackRequest("CpuUtilization", DateTimeOffset.UtcNow, TimeSpan.FromSeconds(cpuPercent), "200", true);
    See the answer and solution
  5. Question 5Q-D7B25B

    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?

    1. A.traces | where tostring(customDimensions["Region"]) == "west" and message has "timeout"
    2. B.traces | where Region == "west" and message == "timeout"
    3. C.traces | where tostring(customDimensions["Region"]) == "west" | where message == "timeout"
    4. D.traces | where tostring(customDimensions["Region"]) contains "west" | where customDimensions["message"] has "timeout"
    See the answer and solution

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 free

Free to start · No credit card needed