81
complete SQL recipes
12
operational and product categories
1:1
query-to-result visualizations
Interactive SQL Lab
Follow one account across product, API, AI, jobs, billing, and databases
The recipe pages explain one analysis pattern at a time. The SQL Lab adds a versioned 15-table dataset and guided lessons for realistic joins, activation funnels, LLM unit economics, incident impact, retry recovery, and database reliability.
Reproducible SQL
Syntax checks are automated; interpretation stays explicit
Every published query must be read-only, include a typed event contract, and successfully plan and execute with Apache DataFusion 45.2.0. Synthetic results, business definitions, and edge cases are reviewed separately because valid SQL can still answer the wrong question.
Recipe collection
API reliability
Calculate API Error Rate by Route
Use SQL to rank API routes by 5xx error rate while protecting the result from low-volume noise.
See SQL and resultCalculate p50, p95, and p99 API Latency
Compare median and tail latency by endpoint with DataFusion-compatible percentile SQL.
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.
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.
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.
See SQL and resultCalculate API Timeout Rate by Route
Rank routes by timeout rate while preserving request volume and configured timeout boundaries.
See SQL and resultCompare Dependency p95 Latency
Find databases, APIs, caches, and queues contributing the most tail latency to requests.
See SQL and resultMeasure API Availability Against an SLO
Calculate daily availability and show whether a service met its explicit 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.
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.
See SQL and resultCompare Feature Rollout Error Rate
Compare request errors and average latency between feature-flag rollout and control cohorts for one release.
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.
See SQL and resultRecipe collection
Background jobs
Measure Background Job Retry and Failure Rate
Find unreliable jobs by comparing successful runs, retries, failures, and tail duration.
See SQL and resultFind Stalled Background Jobs With SQL
Join job start and finish events to identify work that exceeded its expected completion window.
See SQL and resultMeasure Queue Wait Time by Job
Separate time spent waiting in a queue from execution duration and compare p50 and p95 delay by job name.
See SQL and resultMeasure Dead-Letter Queue Growth
Compare dead-letter creation and resolution to find queues accumulating unrecoverable work.
See SQL and resultDetect Missed Cron Schedules
Compare consecutive cron-run events with each schedule interval to find late or missing executions.
See SQL and resultDetect Background-Job Retry Storms
Find time buckets where repeated job attempts create disproportionate queue work and failures.
See SQL and resultRecipe collection
Webhooks
Measure Webhook Retry Recovery
Separate permanent webhook failures from deliveries that recovered on a later attempt.
See SQL and resultMeasure Webhook Latency and Duplicate Rate
Compare processing latency, duplicate deliveries, and failures by webhook provider and event type.
See SQL and resultMeasure Webhook End-to-End Completion
Follow each webhook from receipt through downstream completion and measure the share that finishes within an operating target.
See SQL and resultRecipe collection
AI and LLM
Calculate LLM Cost by Feature and Model
Attribute model spend, tokens, request volume, and cost per request to product features.
See SQL and resultMeasure Accepted AI Outputs per Dollar
Connect model spend to accepted, saved, or otherwise useful product outcomes.
See SQL and resultMeasure LLM Cache Savings and Retry Cost
Compare cached requests, retry volume, and estimated spend by model to find avoidable AI cost.
See SQL and resultMeasure LLM Time to First Token
Compare streaming responsiveness and total generation latency by model and feature.
See SQL and resultDetect Repeating AI Agent Tool Loops
Find agent runs that repeatedly call a small set of tools without reaching a successful outcome.
See SQL and resultMeasure AI Agent Task Success and Human Handoff
Compare agent task success, reviewer acceptance, cost, latency, and human-handoff rate by workflow and model.
See SQL and resultFind AI Quality Regressions by Prompt Version
Compare evaluated quality, acceptance, handoff, and cost by prompt version.
See SQL and resultEvaluate RAG Retrieval Quality by Version
Compare relevant-document retrieval, grounded answers, retrieval latency, and evaluation cost across RAG pipeline versions.
See SQL and resultRecipe collection
Product analytics
Build a Signup-to-Activation Funnel in SQL
Calculate unique-user conversion through signup, onboarding, integration, and first-value milestones.
See SQL and resultCalculate Weekly Cohort Retention
Group users by first activity week and measure the percentage returning in later weeks.
See SQL and resultFind Features Used Before Upgrade
Join feature events to upgrade events and rank behaviors that occur before paid conversion.
See SQL and resultCalculate DAU, WAU, and Product Stickiness
Measure daily and weekly active users together and calculate DAU-to-WAU stickiness from a consistent activity definition.
See SQL and resultCompare Funnel Conversion by Acquisition Source
Measure signup-to-activation conversion by acquisition source while deduplicating repeated milestone events.
See SQL and resultMeasure Time to Activation
Calculate the distribution of elapsed time between signup and a user’s first meaningful product action.
See SQL and resultMeasure Churn and Reactivation by Cohort
Classify accounts as retained, churned, or reactivated from recurring meaningful product activity.
See SQL and resultCompare Experiment Conversion and Revenue Lift
Measure conversion, revenue per participant, and relative lift by experiment variant without double-counting repeated events.
See SQL and resultMeasure Product Journey Drop-Off by Session
Measure how many sessions reach each ordered product milestone and calculate both journey completion and step-to-step conversion.
See SQL and resultRecipe collection
Structured events
Detect Missing Service Heartbeats
Find services, workers, or scheduled tasks that stopped reporting before a failure event appeared.
See SQL and resultQuery Nested AI Tool-Call Events
Filter dotted nested fields and rank failing tools without flattening the original event payload.
See SQL and resultDetect Error-Rate Spikes With a Rolling Baseline
Compare each hourly API error rate with a rolling seven-bucket average instead of relying on one permanent threshold.
See SQL and resultReconstruct a Correlated Workflow Timeline
Reconstruct ordered cross-service workflow steps and elapsed time from a shared workflow identifier.
See SQL and resultRecipe collection
Data quality
Measure Event Ingestion Freshness
Find event sources that stopped delivering data or are arriving substantially later than they occurred.
See SQL and resultFind Duplicate Event IDs
Identify event identifiers delivered more than once and measure whether duplicate handling is working.
See SQL and resultMeasure Required-Field Null Rate
Find event contracts where a required account, status, or correlation field is disappearing.
See SQL and resultMeasure Late-Arriving Events
Measure event delivery delay by source and identify producers that send stale or out-of-order data.
See SQL and resultTrack Event Schema-Version Adoption
Measure schema-version rollout by producer and find old event contracts that remain active after a deployment.
See SQL and resultMeasure Telemetry Volume by Event Name
Rank event types by payload bytes, average event size, and rejection rate before changing retention or collection policy.
See SQL and resultRecipe collection
Revenue and billing
Calculate Trial-to-Paid Conversion
Measure how many trial accounts become paid customers within a fixed conversion window.
See SQL and resultMeasure Payment-Failure Recovery
Calculate how often failed invoices are recovered by a later successful payment attempt.
See SQL and resultCalculate Monthly Recurring Revenue Movement
Separate new, expansion, contraction, churn, and reactivation MRR from billing lifecycle events.
See SQL and resultCalculate Net and Gross Revenue Retention
Calculate NRR and GRR from account-level monthly recurring-revenue snapshots while keeping expansion out of gross retention.
See SQL and resultCalculate Usage Quota Burn by Account
Measure billable units against each account's included monthly quota and rank accounts approaching an overage.
See SQL and resultRecipe collection
Infrastructure
Find Host and Container Resource Saturation
Rank infrastructure sources by sustained CPU, memory, and disk utilization while preserving sample volume.
See SQL and resultFind Cache Misses and Stampede Risk
Compare hit rate, backend cost, and concurrent misses by bounded cache-key pattern.
See SQL and resultCalculate Incident Detection and Recovery Time
Calculate time to detect and time to recover from structured incident lifecycle events.
See SQL and resultFind Kubernetes Restarts by Workload
Rank Kubernetes workloads by container restart events, readiness failures, and observed cumulative restart count.
See SQL and resultRecipe collection
Security and audit
Analyze Authentication Failure Rate
Measure authentication failures by method and reason while keeping traffic volume and affected identities visible.
See SQL and resultAudit AI Agent Tool Authorization Decisions
Review allowed, denied, and approval-required agent tool decisions by risk class without collecting prompts, tool arguments, results, or credentials.
See SQL and resultAudit Privileged Actions with SQL
Summarize sensitive administrative actions, denied attempts, and review-required outcomes without collecting raw secrets or resource contents.
See SQL and resultDetect Suspicious Authentication Bursts
Find short authentication windows with repeated failures across many identities or coarse network sources.
See SQL and resultAnalyze Access-Policy Denials
Rank denied actions by policy, resource class, actor role, and affected identities.
See SQL and resultAudit API-Key Lifecycle Events
Review creation, use, rotation, and revocation events without logging API-key material.
See SQL and resultReview Sensitive Data Exports with SQL
Summarize export volume, denied attempts, data classifications, and review status without storing exported contents.
See SQL and resultRecipe collection
Database reliability
Find Slow Database Queries by Fingerprint
Rank normalized database operations by slow-query rate, average duration, and worst observed duration without storing raw SQL or parameters.
See SQL and resultMeasure Database Connection-Pool Saturation
Measure average pool utilization, queued acquisition waits, timeouts, and idle capacity by application service.
See SQL and resultCalculate Database Transaction Rollback Rate
Compare committed and rolled-back transactions by service while preserving error categories, duration, and affected accounts.
See SQL and resultFind Database Lock Waits and Deadlocks
Rank blocked database operation fingerprints by incident count, wait duration, unresolved locks, and detected deadlocks.
See SQL and resultMeasure Database Replication and CDC Lag
Compare replica and change-data-capture consumers by average lag, worst lag, bytes behind, and stale-sample rate.
See SQL and resultTrack Database Migration Failures by Release
Compare database migration success, failure, rollback, and duration by application release before completing a rollout.
See SQL and resultDetect N+1 Database Query Patterns
Detect database fingerprints repeated many times inside one application request.
See SQL and resultRank Database Queries by Total Time Impact
Combine call volume and latency to find database fingerprints consuming the most application time.
See SQL and resultMeasure Long-Running Database Transactions
Find application transaction classes with long tails, rollbacks, and excessive open duration.
See SQL and resultAnalyze Database Errors by SQLSTATE and Release
Group database failures by portable SQLSTATE class, application operation, and release.
See SQL and resultMeasure Database Connection Timeouts and Churn
Compare connection opens, closes, acquisition timeouts, and affected requests by service and region.
See SQL and resultMeasure Database Replica Staleness by Region
Compare application-observed replica replay lag, stale reads, and failover outcomes by region.
See SQL and resultRecipe collection
Frontend reliability
Compare Core Web Vitals by Route and Release
Compare LCP, INP, and CLS samples by stable route and release while keeping the percentage of passing samples visible.
See SQL and resultRank JavaScript Errors by Route and Release
Find frontend releases and routes with the most repeated JavaScript failures and affected sessions.
See SQL and resultMeasure SPA Navigation Latency by Route
Compare typical and tail client-side navigation time by destination route and frontend release.
See SQL and resultCalculate Browser Long-Task Rate by Route
Measure main-thread blocking events and their total blocked time by route and frontend release.
See SQL and resultFind Slow Frontend Resources by Host
Rank scripts, stylesheets, images, and API resources by tail duration, failures, and transferred bytes.
See SQL and resultUse your own events
Replace the sample table and keep the analysis pattern
Telemetry creates tables from structured events. Once the fields are flowing, adapt a recipe, save the result, and turn it into a shared dashboard or alert.