Event schema
Fields the query expects
| Field | Type | Why it exists |
|---|---|---|
| timestamp_utc | Timestamp | Request completion time. |
| release_version | Utf8 | Application release or build identifier. |
| status_code | Int64 | HTTP response status code. |
| latency_ms | Float64 | Request duration in milliseconds. |
Copy the query
SELECT
release_version,
COUNT(*) AS requests,
100.0 * SUM(CASE WHEN status_code >= 500 THEN 1 ELSE 0 END)
/ NULLIF(COUNT(*), 0) AS error_rate_pct,
approx_percentile_cont(latency_ms, 0.95) AS p95_latency_ms
FROM api_requests
WHERE timestamp_utc >= now() - INTERVAL '7 days'
AND release_version IS NOT NULL
GROUP BY release_version
HAVING COUNT(*) >= 100
ORDER BY error_rate_pct DESC, p95_latency_ms DESC;This read-only query is planned and executed against an empty typed table with Apache DataFusion 45.2.0. We review the synthetic sample output separately. Check field types, thresholds, and counting rules against your own data. Read the testing methodology.
Query result
5xx rate by release
Release 2026.07.27.2 has the highest error rate and p95 latency.
| release_version | requests | error_rate_pct | p95_latency_ms |
|---|---|---|---|
| 2026.07.27.2 | 22,640 | 1.82 | 1,180 |
| 2026.07.27.1 | 18,110 | 0.44 | 620 |
| 2026.07.26.4 | 39,400 | 0.31 | 590 |
Synthetic example output. Run the query against your own event schema and thresholds before using it for operational decisions.
Reproduce the example
Download the sample data
The JSON bundle includes the event schema with field types, illustrative input rows, exact SQL, expected output, review notes, and engine version. The CSV contains the displayed result.
How the SQL works
- 1Grouping by release keeps overlapping rollout traffic separate.
- 2The minimum-volume rule excludes canary groups with too few requests to compare.
- 3Treat the result as correlation: follow with route, region, customer, and error-type breakdowns before assigning cause.
Edge cases to check
- Requests without a release identifier cannot support deploy analysis.
- A gradual rollout needs deployment start time and traffic share alongside these aggregates.
- Do not compare releases that served fundamentally different routes or customer segments without segmentation.
Recommended dashboard
- Bars: error_rate_pct by release
- Grouped bars: p95 latency and request volume
- Table: error types for the selected release
Alert guidance
Alert when the newest release exceeds the previous stable release on both rate and minimum volume.
Read alert setupSet up the events this query needs
Related instrumentation and guides
Continue the analysis
Calculate API error rate by route
Rank API routes by 5xx error rate. Exclude routes with fewer than 20 requests so one failure does not dominate the results.
Open recipeCalculate p50, p95, and p99 API latency
Compare median and tail latency by endpoint with DataFusion-compatible percentile SQL.
Open recipeCalculate API error-budget burn rate
Turn hourly request failures into an SLO burn-rate series that shows how quickly the allowed error budget is being consumed.
Open recipeRun it on your events
Create a table, adapt the fields, and save the result
Start free, send structured events, and use the query result as a chart, shared dashboard widget, or alert input.