Official agent skill

Clickhouse Logs Queries

by supabase in supabase/supabase

Write, review, and migrate Supabase logs queries against the ClickHouse-backed logs table (the logs.all.otel analytics endpoint).

OfficialApache-2.0Auto-check passedDatabases

Install Clickhouse Logs Queries

skills CLI
$ npx skills add supabase/supabase --skill clickhouse-logs-queries -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install supabase/supabase clickhouse-logs-queries --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/supabase/supabase.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/clickhouse-logs-queries .claude/skills/clickhouse-logs-queries && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
clickhouse-logs-queries
GitHub stars
111k
Token cost
~2.4k tokens
SKILL.md length
866 words
Files
3 (incl. references)
Skills in repo
22
Repo updated
First seen
Licence
Apache-2.0

At a glance

Write, review, and migrate Supabase logs queries against the ClickHouse-backed logs table (the logs.all.otel analytics endpoint).

  • Works in 2 steps: Writing or reviewing a logs query (in… → Wiring a logs query in the Studio…
  • Just says logs query
  • SKILL.md covers The logs table, Sources, Reading fields from… and ClickHouse vs BigQuery functions, plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Clickhouse Logs Queries is an agent skill from supabase/supabase, published by the product's own GitHub organization. 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 logattributes map, querying a log source (edgelogs, postgreslogs, authlogs, 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"…

Its SKILL.md is about 2.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files, including reference files (for example `references/bigquery-migration.md` and `references/codebase-integration.md`).

It sits in Databases, covering Data warehousing. It works with ClickHouse, Supabase, Google BigQuery and SQL. The repository describes itself as: The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications. The licence is Apache-2.0.

When your agent uses it

  • Just says logs query
  • Pastes a BigQuery logs query to convert
  • Not only when they name ClickHouse

Example prompts

  • “logs query”
  • “Logs Explorer”
  • “/clickhouse-logs-queries”

Workflow steps

2 steps, taken from the first numbered list in SKILL.md.

  1. Writing or reviewing a logs query (in the Logs Explorer or anywhere a raw
  2. Wiring a logs query in the Studio codebase (branded analytics SQL, the

What it can do on your machine

Read from SKILL.md and the folder at commit 0b85e0d. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are sql).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Clickhouse Logs Queries loads about 2.4k tokens when it runs, and up to ~4.9k if it reads all its reference files. Until then it costs about 163 tokens; SKILL.md has 866 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~163
When it runs · the whole SKILL.md, loaded when a task matches
~2.4k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~4.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from supabase/supabase at commit 0b85e0d, republished under its Apache-2.0 licence (© supabase). 866 words, ~2,375 tokens.

Download SKILL.mdSave it as .claude/skills/clickhouse-logs-queries/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
clickhouse-logs-queries
description
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.

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 log_attributes.

ColumnTypeNotes
idStringUnique log identifier.
timestampDateTime64 (UTC)When the log was produced. Order/compare it directly.
event_messageStringThe raw log line.
severity_textStringLog level, when the source sets one.
sourceStringThe service the log came from. Always filter on this.
log_attributesMap(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:

sql
-- recent edge requests
select timestamp, event_message
from logs
where source = 'edge_logs'
order by timestamp desc
limit 100;

Sources

source selects the service. The common ones:

  • edge_logs — API gateway requests and responses
  • postgres_logs — database statements and errors (also where pg_cron logs live)
  • auth_logs — authentication and authorization activity
  • function_edge_logs — edge function requests and responses
  • function_logs — console output from inside edge functions
  • storage_logs — object upload and retrieval activity
  • realtime_logs — Realtime client connections
  • postgrest_logs, supavisor_logs, pgbouncer_logs — mostly id, timestamp, event_message

The Logs Explorer Field Reference drawer lists every source and the fields it actually sets. When in doubt about a key, discover it from real data rather than guessing (see below).

Reading fields from log_attributes

log_attributes maps a string key to a string value. Read a field with bracket access. There are no unnesting joins:

sql
select
  log_attributes['request.method'] as method,
  log_attributes['request.path'] as path,
  log_attributes['response.status_code'] as status
from logs
where source = 'edge_logs'

The key keeps the dotted path that BigQuery expressed through nested structs, with the metadata root dropped: BigQuery metadata.request.method becomes log_attributes['request.method']. Keep the full prefix — request.cf.country is log_attributes['request.cf.country'], not log_attributes['cf.country'].

Common keys by source:

  • edge_logs: request.method, request.path, request.search, response.status_code, identifier
  • postgres_logs: parsed.error_severity, parsed.detail, parsed.hint, parsed.query, identifier
  • auth_logs: level, status, path, msg, error
  • function_edge_logs: response.status_code, request.method, request.pathname, function_id, execution_id, execution_time_ms
  • function_logs: event_type, function_id, execution_id, level
Numeric fields are strings

Map values are always strings. To compare or aggregate a numeric field, wrap it in toInt32OrZero, which returns 0 for missing or non-numeric values so it never errors on partial data:

sql
select count() as server_errors
from logs
where source = 'edge_logs'
  and toInt32OrZero(log_attributes['response.status_code']) between 500 and 599
Discover the keys a source sets

Read mapKeys from recent rows rather than guessing key names:

sql
select arrayJoin(mapKeys(log_attributes)) as key, count() as n
from logs
where source = 'postgres_logs'
group by key
order by n desc
limit 100;

arrayJoin(mapKeys(...)) flattens the map keys into one row per key so you can rank them by frequency. (The Studio codebase does exactly this for the Field Reference drawer and to feed real keys to the AI rewrite.)

Show full SKILL.md (335 more words)Show less

ClickHouse vs BigQuery functions

These are the substitutions that trip people up most:

NeedBigQueryClickHouse
Count rowscount(*)count()
Regex matchregexp_contains(x, 'p')match(x, 'p')
Substring matchx like '%p%'x ilike '%p%' (case-insensitive) or like
Numeric coercioncast(x as int64)toInt32OrZero(x)
Read the timestampcast(timestamp as datetime)timestamp (use the column directly)
Map keysn/a (used unnest)mapKeys(log_attributes)

The logs.all.otel analytics endpoint (and the Logs Explorer on top of it) rejects count(*) and select * — use count() and list the columns you need. (Raw ClickHouse supports both; this is a constraint of the logs query surface.)

Best practices

These keep queries correct and cheap. Log tables are large; an unbounded scan reads far more data than you need.

  • Start every query with an identifying comment (e.g. -- errors since last deploy). It labels the query in logs and review, and makes each of several queries in a file easy to tell apart.
  • Always include a LIMIT. Even for aggregates while you iterate.
  • Always query from logs where source = '...'. There is no per-service table (no edge_logs, postgres_logs, etc. table) — there is one logs table, and source scopes it to a service. Filtering by source is required, not just an optimization.
  • Keep the time range tight. A smaller window returns results faster.
  • Filter on the real columns (source, timestamp) before reaching into log_attributes.
  • Order by timestamp desc to see the most recent logs first.
  • Use count(), not count(*) or select *.

Worked examples

Requests by status code:

sql
select
  toInt32OrZero(log_attributes['response.status_code']) as status,
  count() as count
from logs
where source = 'edge_logs'
group by status
order by count desc
limit 50

Auth errors:

sql
select timestamp, event_message, log_attributes['msg'] as message
from logs
where source = 'auth_logs'
  and log_attributes['level'] in ('error', 'fatal')
order by timestamp desc
limit 100

Search the raw message:

sql
select timestamp, event_message
from logs
where source = 'postgres_logs'
  and event_message ilike '%deadlock%'
order by timestamp desc
limit 100

Postgres errors grouped by severity (the canonical unnest-to-map conversion):

sql
select log_attributes['parsed.error_severity'] as severity, count() as count
from logs
where source = 'postgres_logs'
  and log_attributes['parsed.error_severity'] in ('ERROR', 'FATAL', 'PANIC')
group by severity
order by count desc
limit 100

When the user pastes a BigQuery query

Convert it rather than running it as-is. The mechanical steps (drop the per-service table for from logs where source = ..., remove every cross join unnest(...), rewrite unnest-alias columns as log_attributes['...'] lookups, swap the functions above) are spelled out with a full before/after in references/bigquery-migration.md. The Logs Explorer also has a built-in Rewrite to ClickHouse action that does this with AI; point users to it for one-off conversions in the dashboard.

© supabase, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files (references) in .agents/skills/clickhouse-logs-queries of supabase/supabase.

  • SKILL.md
  • references/bigquery-migration.md
  • references/codebase-integration.md

Open the folder on GitHubat commit 0b85e0d

Compare with similar skills

Clickhouse Logs Queries next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Clickhouse Logs Queries compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Clickhouse Logs Queries this skillsupabase/supabase111k—~2.4kAutomated safety check: PassApache-2.0
Semantic Analystsidequery/sidemantic129—~982Automated safety check: PassAGPL-3.0
Chdb SQLvemetric/vemetric3951 repos~1.2kAutomated safety check: PassApache-2.0
Querying Tempotempoxyz/tidx107—~3.1kAutomated safety check: PassMIT
Database MigrationRain-kl/OpenFlare288—~1.3kAutomated safety check: PassApache-2.0
SQL Queriesw95/awesome-claude-corporate-skills2393 repos~2.8kAutomated safety check: PassMIT

Similar skills

  • Semantic Analyst

    sidequery/sidemantic

    Answer analytical, KPI, metric, trend, cohort, and business-performance questions through a Sidemantic semantic layer.

    129 GitHub stars~982 tokensUpdated yesterday
    DatabasesAuto-check passed
  • Chdb SQL

    vemetric/vemetric

    A skill your agent uses when the user wants to run SQL — especially analytical SQL — on local files (parquet/csv/json), URLs, S3 paths, or remote databases (Postgres, MySQL, MongoDB, ClickHouse…

    395 GitHub starsUsed in 1 repo~1.2k tokens
    DatabasesAuto-check passed
  • Querying Tempo

    tempoxyz/tidx

    Query indexed Tempo chain data via tidx HTTP API and CLI. An agent skill from tempoxyz/tidx.

    107 GitHub stars~3.1k tokensUpdated today
    DatabasesAuto-check passed
  • Database Migration

    Rain-kl/OpenFlare

    Wavelet 项目专用:当新增或修改数据库表结构、索引、初始化数据、系统配置 seed、模板 seed、默认管理员、goose SQL 迁移、internal/infra/persistence/migrator、ClickHouse 分析库 DDL 或数据库升级流程时必须使用。本技能指导在 internal/infra/persistence/migrator/goose 下编写…

    288 GitHub stars~1.3k tokensUpdated yesterday
    DatabasesAuto-check passed
  • SQL Queries

    w95/awesome-claude-corporate-skills

    Write correct, performant SQL across all major data warehouse dialects (Snowflake, BigQuery, Databricks, PostgreSQL, etc.).

    239 GitHub starsUsed in 3 repos~2.8k tokens
    DatabasesAuto-check passed
  • Warehouse SQL

    HybridAIOne/hybridclaw

    Review and run read-only natural-language SQL against a customer data warehouse with cached schema introspection and explicit write grants.

    158 GitHub stars~1.8k tokensUpdated today
    DatabasesAuto-check passed

More from supabase/supabase

All 22 skills in this repo
  • Official

    React composition patterns that scale. An agent skill from supabase/supabase.

    111k GitHub starsUsed in 58 repos~726 tokens
    Auto-check passed
  • Review The Docs

    supabase/supabase

    Official

    Review Supabase docs changes locally in your supabase/supabase checkout — either an open PR (triage, classify, verify) or your own branch before opening a PR (local self-review).

    111k GitHub stars~4.6k tokensUpdated today
    Auto-check passed
  • Vitest

    supabase/supabase

    Official

    Vitest API and config reference (Jest-compatible) — mocking with vi., spies, fake timers, coverage configuration, fixtures, snapshots, and test filtering.

    111k GitHub starsUsed in 12 repos~1.1k tokens
    Auto-check passed
  • Safe SQL Execution

    supabase/supabase

    Official

    A skill your agent uses whenever code will build, return, fetch, or execute SQL that runs against a user's real Postgres database — even when the request reads like an ordinary feature or bug fix…

    111k GitHub stars~4.2k tokensUpdated today
    Auto-check passed
  • Studio E2E Tests

    supabase/supabase

    Official

    Write and run Playwright E2E tests for Supabase Studio (e2e/studio).

    111k GitHub stars~2.8k tokensUpdated today
    Auto-check passed
  • Studio Error Handling

    supabase/supabase

    Official

    Error display and troubleshooting pattern for Supabase Studio.

    111k GitHub stars~1.3k tokensUpdated today
    Auto-check passed

Categories

Questions about Clickhouse Logs Queries

What does Clickhouse Logs Queries do?

Write, review, and migrate Supabase logs queries against the ClickHouse-backed logs table (the logs.all.otel analytics endpoint). Clickhouse Logs Queries is an agent skill from supabase/supabase, published by the product's own GitHub organization.otel analytics endpoint).

When should I use Clickhouse Logs Queries?

Clickhouse Logs Queries fits situations like: just says logs query; pastes a BigQuery logs query to convert; not only when they name ClickHouse.

How do I install Clickhouse Logs Queries in Claude Code?

Run `npx skills add supabase/supabase --skill clickhouse-logs-queries -a claude-code`. Or copy the skill folder (.agents/skills/clickhouse-logs-queries in supabase/supabase) into .claude/skills/clickhouse-logs-queries in your project. Claude Code loads it when a task matches its description.

How do I install Clickhouse Logs Queries in Codex?

Run `npx skills add supabase/supabase --skill clickhouse-logs-queries -a codex`. Or copy the skill folder (.agents/skills/clickhouse-logs-queries in supabase/supabase) into .agents/skills/clickhouse-logs-queries in your project. Codex loads it when a task matches its description.

Can I use Clickhouse Logs Queries in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add supabase/supabase --skill clickhouse-logs-queries -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/clickhouse-logs-queries, .gemini/skills/clickhouse-logs-queries, .github/skills/clickhouse-logs-queries and .opencode/skills/clickhouse-logs-queries in your project.

What does Clickhouse Logs Queries need to run?

SKILL.md names no scripts, command-line tools or credentials: Clickhouse Logs Queries is instructions for the agent only.

Does Clickhouse Logs Queries access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Clickhouse Logs Queries safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Clickhouse Logs Queries use?

Clickhouse Logs Queries is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Clickhouse Logs Queries use?

About 2.4k tokens (SKILL.md is roughly 9.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 2.5k tokens, read only when the agent opens those files.

What are the alternatives to Clickhouse Logs Queries?

Skills that share tags, products or a category with Clickhouse Logs Queries: Semantic Analyst (sidequery/sidemantic, 129 stars), Chdb SQL (vemetric/vemetric, 395 stars), Querying Tempo (tempoxyz/tidx, 107 stars) and Database Migration (Rain-kl/OpenFlare, 288 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Clickhouse Logs Queries?

supabase (a GitHub organization, an official publisher) maintains it in supabase/supabase, which has 111,256 GitHub stars. The repository holds 22 skills in this directory. The repository was last updated on October 9, 2026.

Source: supabase/supabase on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.