Monitoring and Logging

Retained JSON logs contain automatically discovered fields named service, status, and latencyMs; no latency metrics exist. An engineer needs each service's 95th-percentile latency for requests with status 500 during yesterday's incident; which Logs Insights query should run over that time range?

Show the answer

Correct answerC. filter status = 500 | stats pct(latencyMs, 95) by service

AWhy not this: The average measures the mean latency rather than the required 95th percentile.

BWhy not this: This aggregates all statuses and then filters the service name, not the request status.

CWhy this is right: This selects status 500 events and calculates their 95th-percentile latency separately for each service.

DWhy not this: Returning the 95 slowest events does not calculate a percentile or group results by service.

Filtering status before aggregation restricts the population to failed requests, and pct(latencyMs, 95) calculates each service's 95th percentile. Sorting and returning 95 events produces a list of slow requests, not a percentile.