What problem does it solve?
When a SQL statement in Materialize runs slowly, it is hard to know where the time is actually spent. This Skill captures distributed traces of query execution via OpenTelemetry and Tempo, then breaks down span durations and self-times so you can pinpoint the exact code paths causing latency.
Core Features & Use Cases
- Trace Capture Workflow: Guides starting the Tempo/Grafana monitoring stack, launching environmentd with tracing enabled, and setting the opentelemetry_filter at runtime.
- Trace ID Extraction: Uses psql with emit_trace_id_notice to capture the trace ID for any SQL statement.
- Span Tree Analysis: The trace_tree.py script parses Tempo's OTLP JSON output, decodes base64 span IDs, and prints a hierarchical span tree with self-time rankings and source code locations.
- Use Case: A developer notices a CREATE TABLE statement takes several seconds. They trace it, fetch the trace from Tempo, and discover most time is spent in group_commit_apply::append_fut writing to the durable log.
Quick Start
Trace my slow SQL query in my local Materialize instance and show me where the execution time is going.