Event contract
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 recipe is read-only and reviewed against Telemetry's DataFusion query patterns. Sample output is deterministic and synthetic; validate field types, thresholds, and business definitions against your own data.
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.
How the SQL works
- 1Grouping by release keeps overlapping rollout traffic separate.
- 2The minimum-volume rule protects the comparison from tiny canary samples.
- 3Treat the result as correlation: follow with route, region, customer, and error-type breakdowns before assigning cause.
Edge cases to decide
- 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 setupPut the recipe to work
Related instrumentation and guides
Continue the analysis
Calculate API Error Rate by Route
Use SQL to rank API routes by 5xx error rate while protecting the result from low-volume noise.
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 real 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.