Query DuckLake with SQL
This guide shows you how to query the DuckLake telemetry tables directly with DuckDB SQL. canardstack does not expose SQL through its HTTP API.
Attach DuckLake
Section titled “Attach DuckLake”INSTALL ducklake;LOAD ducklake;
ATTACH 'ducklake:/path/to/catalog.ducklake' AS canardlake (DATA_PATH '/path/to/ducklake-data');USE canardlake;For MotherDuck-backed DuckLake:
export MOTHERDUCK_TOKEN='<your-motherduck-token>'duckdbATTACH 'md:test-ducklake' AS canardlake;USE canardlake;Query Logs
Section titled “Query Logs”SELECT time_unix_nano, service_name, severity_text, bodyFROM otlp_logsWHERE time_unix_nano >= now() - INTERVAL 1 HOURORDER BY time_unix_nano DESCLIMIT 100;Query Traces
Section titled “Query Traces”SELECT start_time_unix_nano, trace_id, span_id, service_name, name, duration_time_unix_nanoFROM otlp_tracesWHERE start_time_unix_nano >= now() - INTERVAL 1 HOURORDER BY start_time_unix_nano DESCLIMIT 100;Query Metrics
Section titled “Query Metrics”SELECT time_unix_nano, name, service_name, coalesce(double_value, int_value::DOUBLE) AS valueFROM otlp_metrics_gaugeWHERE time_unix_nano >= now() - INTERVAL 1 HOURORDER BY time_unix_nano DESCLIMIT 100;Keep direct SQL bounded with event-time predicates, LIMIT, and selected
columns.