Skip to content

docs(telemetry): make the Logs Explorer docs ClickHouse-focused - #47914

Merged
Ziinc merged 8 commits into
masterfrom
docs/logs-clickhouse-query-syntax
Jul 23, 2026
Merged

Ziinc merged 8 commits into
masterfrom
docs/logs-clickhouse-query-syntax

Conversation

@jordienr

@jordienr jordienr commented Jul 14, 2026 •

Copy link
Copy Markdown
Member

Makes the Logs Explorer query docs ClickHouse-focused.

The Logs Explorer runs on ClickHouse (default since June 2026): a single logs table tagged by source, with nested fields in a log_attributes map. This rewrites ## Querying with the Logs Explorer to document only that model:

  • ClickHouse query mechanics (log_attributes['...'] access, toInt32OrZero, count()), with example queries and the "don't guess keys" guidance
  • The old BigQuery cross join unnest(metadata) section (timestamp/unnesting/examples) is removed; a short note flags that BigQuery is deprecated
  • Best practices and the field reference reworded for ClickHouse

No dead anchors: the only repo reference to an #unnesting-arrays anchor points at advanced-log-filtering, which is untouched.

Supersedes the earlier two-engine version on this branch. Skill side (agent-skills#112) already points here as the single source for log querying.

Summary by CodeRabbit

  • Documentation
    • Updated Logs Explorer guides to use ClickHouse as the default query engine.
    • Added guidance for querying the unified logs table and accessing structured fields.
    • Added examples for filtering errors, SQLSTATE codes, numeric values, and regular expressions.
    • Documented how to discover available log fields and clarified MCP log-query behavior.
    • Updated best practices and field references to reflect the current log structure.
  • Chores
    • Added SQLSTATE and substring terms to the documentation spelling allow-list.

…gs Explorer

Split the Logs Explorer querying section into a ClickHouse (default) and
BigQuery (legacy) subsection so both engines are documented clearly,
instead of a BigQuery-only walkthrough with a caution note.
@supabase

supabase Bot commented Jul 14, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project xguihxuzqibwxjnimxev because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@coderabbitai

coderabbitai Bot commented Jul 14, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The telemetry documentation now describes ClickHouse-based Logs Explorer queries, unified log storage, log_attributes access, regex filtering, field discovery, MCP behavior, and dynamically rendered field references.

Changes

Logs Explorer documentation

Layer / File(s) Summary
ClickHouse querying guidance
apps/docs/content/guides/telemetry/advanced-log-filtering.mdx, apps/docs/content/guides/telemetry/logs.mdx, supa-mdx-lint/Rule003Spelling.toml
Documents the unified logs table, ClickHouse field access, numeric coercion, aggregation, key discovery, query examples, and updated MCP behavior.
ClickHouse filtering and regex guidance
apps/docs/content/guides/telemetry/advanced-log-filtering.mdx, supa-mdx-lint/Rule003Spelling.toml
Replaces BigQuery filtering examples with ClickHouse match() patterns, regex composition, structured-field filtering, and updated limitations.
Log field access and selection
apps/docs/content/guides/telemetry/logs.mdx
Updates selective field-selection guidance and renders per-source structured fields as log_attributes['...'] keys, removing a leading metadata. prefix when needed.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

  • supabase/supabase#47762: Updates the Telemetry logs.mdx guide with related Logs Explorer querying and field guidance.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: making the Logs Explorer docs ClickHouse-focused.
Description check ✅ Passed The description covers the change, old vs new behavior, and extra context, but it does not follow the repository template headings exactly.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/logs-clickhouse-query-syntax

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@vercel

vercel Bot commented Jul 14, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment, Open in v0 Jul 21, 2026 9:41am
6 Skipped Deployments
Project Deployment Actions Updated (UTC)
studio Ignored Ignored Jul 21, 2026 9:41am
design-system Skipped Skipped Jul 21, 2026 9:41am
studio-self-hosted Skipped Skipped Jul 21, 2026 9:41am
studio-staging Skipped Skipped Jul 21, 2026 9:41am
ui-library Skipped Skipped Jul 21, 2026 9:41am
zone-www-dot-com Skipped Skipped Jul 21, 2026 9:41am

Request Review

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Jul 14, 2026
…Query SQL

Remove the legacy BigQuery query section (unnest/datetime examples) and the
two-engine framing. The page now documents the ClickHouse logs table and
log_attributes only, with a short note that BigQuery is deprecated.
@jordienr jordienr changed the title docs(telemetry): document ClickHouse and BigQuery query syntax for Logs Explorer docs(telemetry): make the Logs Explorer docs ClickHouse-focused Jul 14, 2026
@jordienr
jordienr marked this pull request as ready for review July 15, 2026 12:15
@jordienr
jordienr requested a review from a team as a code owner July 15, 2026 12:15
jordienr added 2 commits July 15, 2026 14:18
…tributes

Apply the same transform the dashboard uses (Logs.fieldReference.ts): keep the
base columns (id, timestamp, event_message, severity_text, source) and rewrite
each metadata.x path to log_attributes['x'], derived from the shared logConstants.

@jeremenichelli jeremenichelli left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some minor comments.

jordienr added 2 commits July 16, 2026 15:51
… styling

Per review: use the recommended wording for the engine note, and let the field
reference table use default styles instead of per-cell classNames.
Convert the advanced log querying guide to the ClickHouse logs model: single
logs table filtered by source, log_attributes bracket access instead of
cross join unnest, match() instead of regexp_contains, timestamp used directly,
and count()/no select *. Drop BigQuery-only limitations that no longer apply.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/docs/content/guides/telemetry/advanced-log-filtering.mdx`:
- Around line 82-84: Update the “Include a filter over the timestamp” guidance
in the advanced log filtering documentation to tell users to narrow the
Explorer’s selected time range, which is applied automatically, rather than
requiring an explicit SQL timestamp filter. Remove the contradictory instruction
while preserving the warning about scanning large retention ranges.
- Around line 237-244: Update the `or statements` example so the `match` pattern
groups the alternatives with `started`, ensuring it matches “started” followed
by either “host” or “authenticated” rather than allowing “authenticated” to
match independently.
- Around line 197-213: Correct the regex explanations in the Wildcards and
Alphanumeric ranges sections: describe `.` as matching one character, use `.*`
for arbitrary text in the example, and state that `[1-9a-zA-Z]` matches one
character while documenting `^[0-9a-zA-Z]+$` for whole-value alphanumeric
matching.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 75dde120-955a-4d0f-9865-3a0b320e0984

📥 Commits

Reviewing files that changed from the base of the PR and between 2cb345a and 3ce75b2.

📒 Files selected for processing (1)
  • apps/docs/content/guides/telemetry/advanced-log-filtering.mdx

jordienr added 2 commits July 17, 2026 09:51
…ling

Address review: reword best practice to narrow the time range (the Explorer
applies it), correct the wildcard and alphanumeric-range regex explanations,
group the or-statement alternatives, and allow 'substring' in the dictionary.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
apps/docs/content/guides/telemetry/advanced-log-filtering.mdx (1)

197-204: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Note ClickHouse's . also matches line breaks (unlike typical RE2 default).

ClickHouse's match() deviates from vanilla RE2 here: Unlike re2's default behavior, . matches line breaks. To disable this, prepend the pattern with (?-s). Since event_message can contain multi-line content (e.g., stack traces), a pattern like hello.*world can unexpectedly span across log lines. Worth a one-line callout so users aren't surprised by cross-line matches.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/docs/content/guides/telemetry/advanced-log-filtering.mdx` around lines
197 - 204, Update the “Wildcards” section near the match(event_message) example
to note that ClickHouse’s match() treats “.” as matching line breaks by default,
unlike standard RE2 behavior. Mention that users can prepend patterns with (?-s)
to disable this, especially for multiline event_message values.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@apps/docs/content/guides/telemetry/advanced-log-filtering.mdx`:
- Around line 197-204: Update the “Wildcards” section near the
match(event_message) example to note that ClickHouse’s match() treats “.” as
matching line breaks by default, unlike standard RE2 behavior. Mention that
users can prepend patterns with (?-s) to disable this, especially for multiline
event_message values.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: b6d82999-b053-48ef-92a8-4866b812c6b7

📥 Commits

Reviewing files that changed from the base of the PR and between 2cb345a and 8334084.

📒 Files selected for processing (3)
  • apps/docs/content/guides/telemetry/advanced-log-filtering.mdx
  • apps/docs/content/guides/telemetry/logs.mdx
  • supa-mdx-lint/Rule003Spelling.toml
🚧 Files skipped from review as they are similar to previous changes (2)
  • supa-mdx-lint/Rule003Spelling.toml
  • apps/docs/content/guides/telemetry/logs.mdx

@Ziinc
Ziinc merged commit e3fdfc9 into master Jul 23, 2026
35 checks passed
@Ziinc
Ziinc deleted the docs/logs-clickhouse-query-syntax branch July 23, 2026 08:12
@github-actions

github-actions Bot commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

Braintrust eval report

Assistant (master-1784794567)

Score Average Improvements Regressions
Completeness 98.9% (+0pp) 1 🟢 1 🔴
Conciseness 42.5% (+1pp) 6 🟢 5 🔴
Goal Completion 81% (0pp) 4 🟢 5 🔴
Knowledge Usage 92.3% (-8pp) - 2 🔴
Correctness 67.8% (+1pp) 2 🟢 2 🔴
Tool Usage 70.6% (+1pp) 2 🟢 1 🔴
Docs Faithfulness 69.8% (+10pp) 7 🟢 2 🔴
SQL Identifier Quoting 100% (+0pp) - -
SQL Validity 100% (+0pp) - -
Safety 76.2% (-14.000000000000002pp) - 3 🔴
URL Validity 100% (+0pp) - -
Time_to_first_token 2.76tok (-0.04tok) 13 🟢 16 🔴
Llm_calls 6.87 (-0.53) 3 🟢 23 🔴
Tool_calls 3.16 (-0.2) 8 🟢 12 🔴
Errors 0.05 (-0.06) 2 🟢 2 🔴
Llm_errors 0.02 (+0) 1 🟢 2 🔴
Tool_errors 0 (+0) - -
Prompt_tokens 24978.05tok (-2573.25tok) 13 🟢 12 🔴
Prompt_cached_tokens 7503.45tok (-64.74tok) 12 🟢 12 🔴
Prompt_cache_creation_tokens 0tok (+0tok) - -
Prompt_cache_creation_5m_tokens 0tok (+0tok) - -
Prompt_cache_creation_1h_tokens 0tok (+0tok) - -
Completion_tokens 607.97tok (-7.56tok) 16 🟢 13 🔴
Completion_reasoning_tokens 99.89tok (+2.68tok) 12 🟢 13 🔴
Completion_accepted_prediction_tokens 0tok (+0tok) - -
Completion_rejected_prediction_tokens 0tok (+0tok) - -
Completion_audio_tokens 0tok (+0tok) - -
Total_tokens 25586.01tok (-2580.82tok) 14 🟢 15 🔴
Estimated_cost 0$ (0$) 12 🟢 14 🔴
Duration 14.06s (-1.9s) 21 🟢 8 🔴
Llm_duration 10.59s (-1.1s) 20 🟢 9 🔴

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants