Common event contract
Fields that keep these queries reusable
- timestamp_utc, route_template, method, and status_code
- latency_ms, request_id, release, environment, and dependency
- team_id or account_id when customer-impact analysis is approved
Definitions before SQL
Decisions the query cannot make for you
- 1Define which responses count as failures before calculating a rate.
- 2Set a minimum request volume so quiet routes do not dominate percentages.
- 3Keep route templates and releases stable enough to compare over time.
Recommended sequence
Build detection first, then diagnosis
Analysis patterns
Make the result explain a decision
Normalize by request volume
Pair failure counts with rates and a minimum-volume threshold so a quiet route cannot outrank a genuinely risky endpoint.
Compare stable dimensions
Group by route template, release, dependency, or environment instead of raw URLs and other unbounded values.
Connect detection to impact
Start with a service-level change, then identify the customers, releases, and dependencies that contributed to it.
Complete recipes
Copy the query, then validate the assumptions
Calculate API Error Rate by Route
Use SQL to rank API routes by 5xx error rate while protecting the result from low-volume noise.
Which API routes have the highest meaningful 5xx error rate?
See SQL and resultCalculate p50, p95, and p99 API Latency
Compare median and tail latency by endpoint with DataFusion-compatible percentile SQL.
Which endpoints have the worst tail latency?
See SQL and resultCalculate 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.
How quickly is the API consuming its 99.9% availability budget?
See SQL and resultCompare API Reliability by Release
Compare traffic, 5xx rate, and p95 latency across application releases without attributing every post-deploy change to the deploy.
Which releases coincide with worse API errors or tail latency?
See SQL and resultRank Error Fingerprints by Customer Impact
Rank normalized application errors by occurrences and affected accounts instead of letting one retry loop dominate the incident view.
Which error groups affect the most customer accounts?
See SQL and resultCalculate API Timeout Rate by Route
Rank routes by timeout rate while preserving request volume and configured timeout boundaries.
Which API routes time out often enough to affect users?
See SQL and resultCompare Dependency p95 Latency
Find databases, APIs, caches, and queues contributing the most tail latency to requests.
Which downstream dependencies have the worst tail latency and failure rate?
See SQL and resultMeasure API Availability Against an SLO
Calculate daily availability and show whether a service met its explicit objective.
Did each service meet its daily availability objective?
See SQL and resultCalculate API Request Throughput by Route
Calculate observed requests per minute by stable API route and keep error volume beside throughput.
Which API routes are processing the most requests per minute?
See SQL and resultMeasure API 429 Rate-Limit Recovery
Measure how often rate-limited requests recover on a later attempt without treating every retry as a new request.
Do requests that receive HTTP 429 recover successfully after retrying?
See SQL and resultCompare Feature Rollout Error Rate
Compare request errors and average latency between feature-flag rollout and control cohorts for one release.
Is the feature-flag rollout less reliable than its control cohort?
See SQL and resultMeasure Incident Customer Impact by Plan
Count affected accounts and average impact duration by plan without exposing customer names or raw request data.
How many accounts were affected by the incident in each plan?
See SQL and resultAdapt the event contract before the threshold
Keep the analysis pattern, but validate table names, field types, business definitions, time windows, and minimum-volume rules against your own events. Every published query is also planned and executed against an empty typed table with the pinned engine.