Telemetry
Telemetry SQL Cookbook

SQL log analysis and observability recipes

Analyze logs as typed, structured event tables. Start with the question and leave with the query and chart. Each recipe pairs a realistic schema with copyable DataFusion SQL, synthetic result data, a useful visualization, public JSON and CSV fixtures, interpretation notes, edge cases, and a dashboard or alert recommendation.

New to the approach? Read the SQL observability and event analytics guide for the event model, architecture, query patterns, and migration tradeoffs behind the cookbook.

Planned and executed with Apache DataFusion 45.2.0
Crawlable result tables with visual previews
Downloadable JSON, CSV, and static SVG assets
Connected SaaS dataset for multi-table learning
Read-only browser playground for reproducible fixtures
Operational edge cases and alert guidance
Synthetic examples—no customer data

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.

Start SQL Lab

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

12 recipes
Beginnerapi_requests

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 result
Intermediateapi_requests

Calculate p50, p95, and p99 API Latency

Compare median and tail latency by endpoint with DataFusion-compatible percentile SQL.

See SQL and result
Intermediateapi_requests

Calculate 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 result
Intermediateapi_requests

Compare 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 result
Beginnerapi_requests

Rank 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 result
Beginnerapi_requests

Calculate API Timeout Rate by Route

Rank routes by timeout rate while preserving request volume and configured timeout boundaries.

See SQL and result
Intermediatedependency_calls

Compare Dependency p95 Latency

Find databases, APIs, caches, and queues contributing the most tail latency to requests.

See SQL and result
Intermediateapi_requests

Measure API Availability Against an SLO

Calculate daily availability and show whether a service met its explicit objective.

See SQL and result
Beginnerapi_throughput_events

Calculate API Request Throughput by Route

Calculate observed requests per minute by stable API route and keep error volume beside throughput.

See SQL and result
Intermediateapi_attempt_events

Measure 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 result
Beginnerfeature_rollout_events

Compare Feature Rollout Error Rate

Compare request errors and average latency between feature-flag rollout and control cohorts for one release.

See SQL and result
Intermediateincident_account_impact_events

Measure 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 result

Recipe collection

Background jobs

6 recipes

Recipe collection

Webhooks

3 recipes

Recipe collection

AI and LLM

8 recipes

Recipe collection

Product analytics

9 recipes
Intermediateproduct_events

Build a Signup-to-Activation Funnel in SQL

Calculate unique-user conversion through signup, onboarding, integration, and first-value milestones.

See SQL and result
Advancedproduct_events

Calculate Weekly Cohort Retention

Group users by first activity week and measure the percentage returning in later weeks.

See SQL and result
Advancedproduct_events

Find Features Used Before Upgrade

Join feature events to upgrade events and rank behaviors that occur before paid conversion.

See SQL and result
Advancedproduct_events

Calculate 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 result
Intermediateproduct_events

Compare Funnel Conversion by Acquisition Source

Measure signup-to-activation conversion by acquisition source while deduplicating repeated milestone events.

See SQL and result
Advancedproduct_events

Measure Time to Activation

Calculate the distribution of elapsed time between signup and a user’s first meaningful product action.

See SQL and result
Advancedproduct_events

Measure Churn and Reactivation by Cohort

Classify accounts as retained, churned, or reactivated from recurring meaningful product activity.

See SQL and result
Advancedexperiment_events

Compare Experiment Conversion and Revenue Lift

Measure conversion, revenue per participant, and relative lift by experiment variant without double-counting repeated events.

See SQL and result
Intermediateproduct_journey_events

Measure 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 result

Recipe collection

Structured events

4 recipes

Recipe collection

Data quality

6 recipes

Recipe collection

Revenue and billing

5 recipes

Recipe collection

Infrastructure

4 recipes

Recipe collection

Security and audit

7 recipes

Recipe collection

Database reliability

12 recipes
Beginnerdatabase_query_events

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 result
Beginnerdatabase_pool_samples

Measure Database Connection-Pool Saturation

Measure average pool utilization, queued acquisition waits, timeouts, and idle capacity by application service.

See SQL and result
Intermediatedatabase_transaction_events

Calculate Database Transaction Rollback Rate

Compare committed and rolled-back transactions by service while preserving error categories, duration, and affected accounts.

See SQL and result
Intermediatedatabase_lock_wait_events

Find Database Lock Waits and Deadlocks

Rank blocked database operation fingerprints by incident count, wait duration, unresolved locks, and detected deadlocks.

See SQL and result
Beginnerdatabase_replication_samples

Measure 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 result
Beginnerdatabase_migration_events

Track Database Migration Failures by Release

Compare database migration success, failure, rollback, and duration by application release before completing a rollout.

See SQL and result
Intermediatedatabase_request_query_events

Detect N+1 Database Query Patterns

Detect database fingerprints repeated many times inside one application request.

See SQL and result
Beginnerdatabase_query_events

Rank Database Queries by Total Time Impact

Combine call volume and latency to find database fingerprints consuming the most application time.

See SQL and result
Intermediatedatabase_transaction_events

Measure Long-Running Database Transactions

Find application transaction classes with long tails, rollbacks, and excessive open duration.

See SQL and result
Beginnerdatabase_error_events

Analyze Database Errors by SQLSTATE and Release

Group database failures by portable SQLSTATE class, application operation, and release.

See SQL and result
Intermediatedatabase_connection_events

Measure Database Connection Timeouts and Churn

Compare connection opens, closes, acquisition timeouts, and affected requests by service and region.

See SQL and result
Advanceddatabase_replica_read_events

Measure Database Replica Staleness by Region

Compare application-observed replica replay lag, stale reads, and failover outcomes by region.

See SQL and result

Recipe collection

Frontend reliability

5 recipes

Use 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.

Get an API key