Query telemetry
Query OpenTelemetry logs, traces, and metrics with SQL-backed tools in Altertable. Use the signal guides for individual records, then correlate signals or join them to business data with SQL.
In Altertable, the Logs explorer can group matching records into a segmentation chart over time. The Traces explorer can limit results to root spans, open a trace waterfall, and correlate a trace with its logs. Use SQL when you need to join telemetry to product, customer, or operational catalogs.
Query a signal
- Logs contain log bodies, severity, and trace/span identifiers.
- Traces contain request spans, timings, and service attributes.
- Metrics contain gauge, sum, histogram, and summary points.
Correlate logs and traces
Join a log to its span using both trace_id and span_id:
SELECTlogs.timestamp,logs.severity_text,logs.body,spans.service_name,spans.name AS span_nameFROM opentelemetry.main.logs AS logsJOIN opentelemetry.main.spans AS spansON logs.trace_id = spans.trace_idAND logs.span_id = spans.span_idWHERE logs.timestamp >= now() - INTERVAL '1 hour'ORDER BY logs.timestamp DESCLIMIT 100;
This query returns logs with matching spans. Logs without both identifiers or a matching span are not included. When joining telemetry to business data, also check customer or account identifiers and the time range.
Investigate with an agent
For table schemas and accepted signals, see the data model. For the status of the Grafana integration, see Grafana availability.