mirror of
https://github.com/supabase/supabase.git
synced 2026-12-04 07:29:16 +00:00
## Problem
Several docs snippets and statements are wrong or incomplete:
- The OpenCode MCP config generated by `McpUrlBuilder` uses the old
shape (`mcp.supabase` with `enabled: true`). Current OpenCode config
expects servers under `mcp.servers.<name>` and uses `disabled` instead
of `enabled`, so the snippet does not register the server.
- The Python type generation guide builds Pydantic models with
`PublicMovies(m)`. `BaseModel` does not accept a positional dict, so the
example raises `TypeError`.
- The API keys page does not mention that the Data API OpenAPI root
(`GET /rest/v1/`) accepts only secret keys, so a publishable key gets a
401 there.
- The logs page says retention depends on the plan but does not give the
values.
- The Auth Hooks page names the Send SMS hook secret
`SEND_SMS_HOOK_SECRETS`, while the Send SMS hook page, the other hook
pages, and the self-hosting guide use the singular `..._HOOK_SECRET`.
## Solution
- `packages/ui-patterns/src/McpUrlBuilder`: OpenCode config now emits `{
"mcp": { "servers": { "supabase": { "type": "remote", "url": ... } } }
}`. Updated `OpenCodeMcpConfig`, `isOpenCodeMcpConfig`, and `getMcpUrl`
to match.
- `generating-python-types.mdx`: use `PublicMovies.model_validate(m)` in
the select, insert, and update examples.
- `getting-started/api-keys.mdx`: add a Known limitations bullet about
`GET /rest/v1/` requiring a secret key, with table routes or
`/auth/v1/health` as the check for a publishable key.
- `observability/logs.mdx`: add a per-plan retention table (Free 1 day,
Pro 7 days, Team 28 days, Enterprise 90 days), matching
`packages/shared-data/pricing.ts`.
- `auth/auth-hooks.mdx`: rename `SEND_SMS_HOOK_SECRETS` to
`SEND_SMS_HOOK_SECRET`.
Checks run: `pnpm turbo run typecheck --filter='...[origin/master]'`
(passed, run with `--concurrency=1` after the first run was OOM-killed),
`pnpm turbo run lint --filter='[origin/master]'` (passed, no errors),
`vitest run src/McpUrlBuilder` in `packages/ui-patterns` (37 passed),
and Prettier on changed files. Docs tests were skipped because they need
Docker.
## Review instructions
1. On the docs preview, open `/docs/guides/getting-started/mcp`, select
OpenCode, and confirm the config shows `mcp.servers.supabase` with
`type: "remote"` and the URL, and no `enabled` field.
2. Open `/docs/guides/ai-tools/mcp`, select OpenCode, and confirm the
same config.
3. Open `/docs/guides/api/rest/generating-python-types` and confirm the
select, insert, and update examples use
`PublicMovies.model_validate(m)`.
4. Open `/docs/guides/getting-started/api-keys#known-limitations` and
confirm the bullet about `GET /rest/v1/` accepting only secret keys.
5. Open `/docs/guides/observability/logs` and confirm the retention
table lists Free 1 day, Pro 7 days, Team 28 days, Enterprise 90 days.
6. Open `/docs/guides/auth/auth-hooks` and confirm the Send SMS examples
use `SEND_SMS_HOOK_SECRET`, not `SEND_SMS_HOOK_SECRETS`.
## Checklist
- [x] I have read
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
- [x] If I wrote a new docs topic or edited an existing topic, I used
the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs
[style
guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide)
Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com>
77 lines
5.4 KiB
Plaintext
77 lines
5.4 KiB
Plaintext
---
|
|
id: 'logs'
|
|
title: 'Logs in Studio'
|
|
description: 'Filter, inspect, and export project events in the Logs view'
|
|
---
|
|
|
|
Use [Logs](/dashboard/project/_/logs) to inspect events across your hosted project's services. For SQL queries through [Explorer](/dashboard/project/_/explorer), MCP, or the API, see [Query logs with SQL](/docs/guides/observability/advanced-log-filtering).
|
|
|
|
For terminal workflows with Supabase CLI v3, see [Logs in the CLI](/docs/guides/observability/cli-logs).
|
|
|
|
## Find events [#product-logs]
|
|
|
|
1. Open [Logs](/dashboard/project/_/logs).
|
|
2. Set the **Time Range** in the sidebar, or select a range on the timeline.
|
|
3. Select one or more **Log Type** values.
|
|
4. Add filters in the filter bar, or type text to search event messages.
|
|
5. Select a row to inspect the event.
|
|
|
|
Without a log type selection, Logs queries **Postgres** and **API Gateway**. Selecting types replaces this default set. The timeline groups events by success, warning, and error.
|
|
|
|
## Filter events
|
|
|
|
| Filter | Behavior |
|
|
| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
| Log Type | Select API Gateway, Postgres, Auth, Storage, PostgREST, Edge Function, Realtime, or [pooler](/docs/guides/database/connecting-to-postgres/pooling-and-limits) events. |
|
|
| Level | Match success, warning, or error. |
|
|
| Status | Match an HTTP status or Postgres SQLSTATE. |
|
|
| Method | Match an HTTP method. |
|
|
| Pathname | Match a request path. |
|
|
| Event message | Use **iLike** or **Not iLike** for case-insensitive text matching or exclusion. Plain text matches anywhere in the message; `%` specifies a wildcard pattern. |
|
|
| User | Match the user's ID in Auth actor IDs or API Gateway JWT subjects. Other log types cannot match this filter. |
|
|
|
|
Filters other than **Event message** and **User** support **Equals** and **Not equal**. **User** supports **Equals**. Included values within a field match any selected value; exclusions remove every selected value. Filters on different fields must all match.
|
|
|
|
### Gateway and service logs
|
|
|
|
The nested service toggles under **API Gateway** include or exclude gateway request paths. Selecting the separate **Auth**, **Storage**, or **PostgREST** log type retrieves that service's own logs. These are different events.
|
|
|
|
For SQL source names, see the [Log field reference](/docs/guides/observability/log-field-reference).
|
|
|
|
### Postgres [#postgres]
|
|
|
|
Postgres logs contain database activity and errors. Connection events appear when [connection logging](/docs/guides/platform/postgres-connection-logging) is enabled. Clear **Connection logs** under **Postgres** to hide them.
|
|
|
|
To record additional statement classes, see [Configure statement logging](/docs/guides/observability/configure-logging#postgres-statements).
|
|
|
|
## Inspect an event [#expanding-results]
|
|
|
|
Select a row to open its detail panel. **Overview**, when available for the log type, shows service details. **Raw JSON** shows the event data. Dock the panel at the bottom or on the right.
|
|
|
|
Edge Function invocations can include associated console output. In SQL, invocation events use `function_edge_logs` and console events use `function_logs`.
|
|
|
|
## Watch, share, and export
|
|
|
|
- Select **Live** to fetch new events automatically. Select it again to pause. Starting live mode clears the fixed time range and sort; selecting a time range or sort stops live mode.
|
|
- Copy the page URL to share the current filters. Recipients need access to the project.
|
|
- Open **Download logs**, choose CSV or JSON, and select a result limit of 100, 500, or 1,000 rows. The export applies the current filters. Without a fixed time range, choose the duration to retrieve.
|
|
|
|
For continuous export, use [Log drains](/docs/guides/observability/log-drains).
|
|
|
|
## Missing results [#single-service-collections]
|
|
|
|
Check the time range, selected log types, and exclusions first. **User** combined with only Postgres or another unsupported type returns no matches. An empty result does not establish that the user had no activity.
|
|
|
|
Events must be recorded before they can appear in Logs. See [Configure logging](/docs/guides/observability/configure-logging) and the [source limitations](/docs/guides/observability/log-field-reference#capture-limits).
|
|
|
|
Retention for API and database logs depends on your [pricing plan](/pricing):
|
|
|
|
| Plan | Log retention |
|
|
| ---------- | ------------- |
|
|
| Free | 1 day |
|
|
| Pro | 7 days |
|
|
| Team | 28 days |
|
|
| Enterprise | 90 days |
|
|
|
|
See [Manage Logs usage](/docs/guides/platform/manage-your-usage/logs) for billing details.
|