mirror of
https://github.com/supabase/supabase.git
synced 2026-10-06 18:05:11 +03:00
## I have read the [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) file. Yes. ## What kind of change does this PR introduce? Documentation update. ## What is the current behavior? The observability overview and access page overlap; configuration interrupts querying; related guides send log queries to the old editor. ## What is the new behavior? The observability overview and navigation follow the same four sections: Read project data, Detect and diagnose, Hire an agent, and Configure and export. The overview absorbs the redundant access page, with permanent redirects for both HTML and Markdown URLs. “Query logs with SQL” owns ClickHouse querying through MCP, the Management API, and Explorer with query source Logs. Logging configuration moves to its own guide; sources, captured headers, and limits live in the field reference. Inspection links to canonical diagnostic SQL. Related Storage and database guides use the replacement Explorer workflow and retain existing anchors where headings move. ## Additional context Validation: Markdown generation, docs typecheck, targeted ESLint, formatting, and content-listing tests. Browser overview/navigation checked; old HTML and Markdown URLs return 308, and the new configuration page returns 200 in both formats. Three ClickHouse examples and the Postgres configuration query ran in a disposable container sandbox. Changed pages have no MDX lint violations; repository-wide existing failures remain. Self-review: the Management API request was verified against its published schema but not sent to a hosted project. Realtime ingestion and hosted logging configuration still need a hosted smoke check. No compatibility path for the deprecated logs engine is documented. Stage 2 of 3; depends on stage 1. Stack: #50073 → #50074 → #50075. Production docs build also passes at the stack tip after standard reference generation. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Documentation** - Reorganized observability guidance around reading data, detecting issues, diagnosing problems, agent setup, and exporting data. - Added a guide for configuring Postgres and Realtime logging. - Updated log investigation instructions to use Explorer, SQL queries, and clearer filters. - Added log source, field, and captured-header references. - Improved advisor guidance and database performance troubleshooting. - Added redirects for moved observability content. - **Accessibility** - Improved screen-reader labels for copy and feature-selection controls. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
125 lines
5.6 KiB
Plaintext
125 lines
5.6 KiB
Plaintext
---
|
|
id: 'logs-field-reference'
|
|
title: 'Log sources and fields'
|
|
description: 'Log sources, ClickHouse fields, and event capture limits'
|
|
---
|
|
|
|
Each event is a row in the ClickHouse `logs` table. Filter the `source` column to select a service. The tables below list its fields; a field is not necessarily populated on every event.
|
|
|
|
`id`, `timestamp`, `event_message`, `severity_text`, and `source` are top-level columns. Service fields are string values in `log_attributes`, even when the original event contains a number or boolean. Use the **ClickHouse query field** column directly. See [Query logs with SQL](/docs/guides/observability/advanced-log-filtering) for casting and field discovery.
|
|
|
|
## Sources
|
|
|
|
| `source` | Events |
|
|
| -------------------- | ----------------------------------------------------------------- |
|
|
| `edge_logs` | HTTP requests through the API gateway, including REST and GraphQL |
|
|
| `postgres_logs` | Database activity, statements, and errors |
|
|
| `postgrest_logs` | PostgREST server logs |
|
|
| `auth_logs` | Auth server: login, JWT, OAuth, email |
|
|
| `auth_audit_logs` | Auth audit events |
|
|
| `storage_logs` | Storage API: uploads and object access |
|
|
| `realtime_logs` | Realtime server: channels, presence, broadcast |
|
|
| `function_edge_logs` | HTTP request and response for an Edge Function invocation |
|
|
| `function_logs` | `console` output from inside an Edge Function |
|
|
| `supavisor_logs` | Shared pooler: pooling and timeouts |
|
|
| `pgbouncer_logs` | Dedicated pooler |
|
|
| `pg_upgrade_logs` | Database version upgrade |
|
|
|
|
For `postgres_logs`, statement text and error details can appear in `event_message`. A missing structured field does not mean the event has no detail.
|
|
|
|
## Captured HTTP headers
|
|
|
|
API Gateway logs capture only the headers below. Other headers still reach the application and client but are omitted from these logs.
|
|
|
|
Request headers:
|
|
|
|
- `accept`
|
|
- `cf-connecting-ip`
|
|
- `cf-ipcountry`
|
|
- `host`
|
|
- `user-agent`
|
|
- `x-forwarded-proto`
|
|
- `referer`
|
|
- `content-length`
|
|
- `x-real-ip`
|
|
- `x-client-info`
|
|
- `x-forwarded-user-agent`
|
|
- `range`
|
|
- `prefer`
|
|
|
|
Response headers:
|
|
|
|
- `cf-cache-status`
|
|
- `cf-ray`
|
|
- `content-location`
|
|
- `content-range`
|
|
- `content-type`
|
|
- `content-length`
|
|
- `date`
|
|
- `transfer-encoding`
|
|
- `x-kong-proxy-latency`
|
|
- `x-kong-upstream-latency`
|
|
- `sb-gateway-mode`
|
|
- `sb-gateway-version`
|
|
|
|
## Capture limits
|
|
|
|
- Hosted Postgres events longer than 100,000 characters and Edge Function log messages longer than 10,000 characters are truncated.
|
|
- Internal Supabase service connection events are not recorded in hosted Postgres logs.
|
|
- An Edge Function invocation uses `function_edge_logs`; its console output uses `function_logs`.
|
|
- For [API Load Balancer](/docs/guides/platform/read-replicas#api-load-balancer) traffic, `log_attributes['load_balancer_redirect_identifier']` identifies the upstream database.
|
|
|
|
## Fields by source
|
|
|
|
<SharedData data="logConstants">
|
|
{(logConstants) => (
|
|
<Tabs scrollable size="small" type="underlined" defaultActiveId="edge_logs" queryGroup="source">
|
|
{logConstants.schemas.map((schema) => (
|
|
<TabPanel id={schema.reference} key={schema.reference} label={schema.name}>
|
|
<p>
|
|
Source: <code>{schema.reference}</code>
|
|
</p>
|
|
<div className="border rounded-md divide-y overflow-hidden">
|
|
{schema.fields
|
|
.sort((a, b) => a.path.localeCompare(b.path))
|
|
.map((field) => {
|
|
const shortName = field.path.replace(/^metadata\./, '')
|
|
const isTopLevel = field.queryField === field.path
|
|
return (
|
|
<div key={field.path} className="px-4 py-3">
|
|
<div className="flex items-center gap-2 flex-wrap">
|
|
<code className="text-sm">{shortName}</code>
|
|
<span className="text-xs font-mono text-foreground-lighter bg-surface-200 px-1.5 py-0.5 rounded">
|
|
{field.type}
|
|
</span>
|
|
</div>
|
|
{!isTopLevel && (
|
|
<div className="mt-2 flex flex-col gap-1">
|
|
<div className="flex items-baseline gap-2">
|
|
<span className="text-[10px] font-medium uppercase tracking-wide text-foreground-lighter border rounded px-1.5 py-px shrink-0">
|
|
schema
|
|
</span>
|
|
<code className="text-xs text-foreground-lighter break-all">
|
|
{field.path}
|
|
</code>
|
|
</div>
|
|
<div className="flex items-baseline gap-2">
|
|
<span className="text-[10px] font-medium uppercase tracking-wide text-foreground-lighter border rounded px-1.5 py-px shrink-0">
|
|
clickhouse
|
|
</span>
|
|
<code className="text-xs text-foreground-lighter break-all">
|
|
{field.queryField}
|
|
</code>
|
|
</div>
|
|
</div>
|
|
)}
|
|
</div>
|
|
)
|
|
})}
|
|
</div>
|
|
</TabPanel>
|
|
))}
|
|
</Tabs>
|
|
)}
|
|
</SharedData>
|