Skip to content

Metrics View

The Metrics view aggregates request data from traces and SLO windows into a dashboard showing request volume, latency distribution, and error rates across all AWS services handled by CloudMock.

At the top of the view, three summary cards show aggregate metrics:

CardDescription
Total RequestsTotal number of traced requests across all services
Avg LatencyMean response time across all requests
Error RatePercentage of requests that returned a 5xx status or had an error span. Color-coded: green (< 1%), yellow (1-5%), red (> 5%)

Below the summary cards, a table lists every AWS service that has received traffic:

ColumnDescription
ServiceAWS service name (s3, dynamodb, cognito-idp, etc.)
RequestsTotal request count for this service
Avg LatencyMean response time
P50Median latency (50th percentile)
P9595th percentile latency
P9999th percentile latency
Error RatePercentage of failed requests, color-coded by severity

Services are sorted by request count, highest first.

Latency percentiles are computed from two sources, with SLO windows taking priority:

  1. SLO windows — If SLO rules are configured, the SLO engine maintains sliding windows with pre-computed P50, P95, and P99 values. These are used when available.
  2. Trace durations — If no SLO window exists for a service, percentiles are computed directly from the trace duration list.

Select two or more services using the checkboxes in the per-service table, then click Compare. The comparison view shows:

  • Side-by-side stat cards for each selected service, with request count, avg latency, P99, and error rate.
  • Overlaid time-series charts for request volume, P99 latency, and error rate, with each service plotted in a different color.

This is useful for comparing traffic patterns across services — for example, verifying that your DynamoDB call volume tracks with your API Gateway request volume.

The bottom of the view shows three line charts computed from trace data bucketed by minute:

Requests per minute over time. Spikes indicate bursts of traffic; gaps indicate idle periods.

The 99th percentile latency per minute. This chart surfaces latency outliers that the average might hide.

The percentage of errored requests per minute. A sudden jump here correlates with an incident or a faulty deployment.

The Metrics view pulls data from the SLO engine (GET /api/slo). When SLO rules are defined, the per-service percentile columns reflect the SLO window calculations, which use a sliding time window rather than the full trace history. This gives more accurate recent-state percentiles.

To configure SLO rules, use the SLOs view or the admin API:

Terminal window
curl -X PUT http://localhost:4599/api/slo \
-H "Content-Type: application/json" \
-d '[{"service":"s3","latency_p99_ms":100,"error_rate_threshold":0.01}]'
MethodPathDescription
GET/api/metricsAggregate metrics (request count, error rate, latency percentiles)
GET/api/metrics/timelineTime-series metrics for charting
GET/api/compare?service=X&action=YBefore/after comparison
GET/api/sloCurrent SLO status with per-service windows
GET/api/tracesTrace data used for metric computation