Agent skill · supabase

clickhouse-logs-queries

Write, review, and migrate Supabase logs queries against the ClickHouse-backed `logs` table (the `logs.all.otel` analytics endpoint). Use this whenever a task involves Logs Explorer SQL, the `log_attributes` map, querying a log `source` (edge_logs, postgres_logs, auth_logs, etc.), translating an old BigQuery `cross join unnest(metadata)` logs query to ClickHouse, or wiring analytics log SQL in `apps/studio/data/logs` and `apps/studio/components/interfaces/Settings/Logs`. Reach for it even when the user just says "logs query", "Logs Explorer", or pastes a BigQuery logs query to convert, not only when they name ClickHouse.

What it needs

About 5k tokens when loaded.

What this skill does

Querying Supabase logs (ClickHouse) Supabase logs live in a single ClickHouse logs table, served by the logs.all.otel analytics endpoint. Every log line from every part of the stack is one row in this table, tagged by a source column. This replaces the older BigQuery model, where each service had its own table and fields were reached through cross join unnest(metadata). Two kinds of work use this skill, and they share the same SQL model: 1. Writing or reviewing a logs query (in the Logs Explorer or anywhere a raw ClickHouse logs query is needed). Start here in this file. 2. Wiring a logs query in the Studio codebase (branded analytics SQL, the endpoint picker, the OTEL query builders). Read references/codebase-integration.md. If you are converting an existing BigQuery logs query, read references/bigquery-migration.md for the full translation table. The logs table Each row has a small set of real columns. Everything specific to a service lives in logattributes. Column Type Notes ---------------- --------------------- ----------------------------------------------------- id String Unique log identifier. timestamp DateTime64 (UTC) When the log was produced. Order/compare it directly. eventmessage String The raw log line. severitytext String Log level, when the source sets one. source String The service the log came from. Always filter on this. logattributes Map(String, String) Structured per-source fields, keyed by a dotted path. timestamp is formatted like 2026-06-22T09:34:06.215000 (ISO 8601, microsecond precision, no trailing Z). In the Logs Explorer the selected time range is applied for you, so you rarely need to write a timestamp filter by hand. A minimal, well-formed query. Lead with a comment naming the query, filter by source, and always limit: Sources source selects the service. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills supabase/clickhouse-logs-queries--f787c0

View the source on GitHub

Browse the @skills marketplace