1. Event schema
One row in api_requests, with the types used by the query made explicit.
- timestamp_utc
- Timestamp
- route_template
- Utf8
- latency_ms
- Float64
- status_code
- Int64
Query recent and historical events with DataFusion SQL. Save queries for your dashboards, or export large results asynchronously for use in other tools.
Outcomes
How it works
Decide what you need to know before selecting columns. For example, which API routes had the highest error rate in the last hour?
Check row counts, missing values, time windows, and denominators. Investigate groups you did not expect before saving the query.
Save the query with a name your team will recognize. Reuse it in a dashboard, export, or alert when the same question comes up again.
Writing and running SQL in Telemetry
Write SQL with autocomplete, inspect the results, and create a chart.
Boundaries
Try the example
This example includes the schema, read-only SQL, and synthetic results. Use it to check how the query works. It does not measure customer results.
One row in api_requests, with the types used by the query made explicit.
Which endpoints have the worst tail latency?
SELECT
route_template,
COUNT(*) AS requests,
approx_percentile_cont(latency_ms, 0.50) AS p50_ms,
approx_percentile_cont(latency_ms, 0.95) AS p95_ms,
approx_percentile_cont(latency_ms, 0.99) AS p99_ms
FROM api_requests
WHERE timestamp_utc >= now() - INTERVAL '24 hours'
AND status_code < 500
GROUP BY route_template
HAVING COUNT(*) >= 50
ORDER BY p95_ms DESC
LIMIT 10;Export requests have the slowest tail and the largest gap between typical and worst-case performance.
| route_template | requests | p50_ms |
|---|---|---|
| /api/reports/export | 50 | 800 |
| /api/projects/:id/sync | 50 | 320 |
| /api/search | 50 | 120 |
Capabilities
See the analysis
Compare median and tail latency by endpoint with DataFusion-compatible percentile SQL.
Open recipeGroup users by first activity week and measure the percentage returning in later weeks.
Open recipeJoin feature events to upgrade events and rank behaviors that occur before paid conversion.
Open recipeCustomer evidence
Related capabilities
Use a focused prompt, send synthetic events, and verify the first useful query before expanding coverage.