Files
supabase/apps/docs/content/_partials/metrics_access.mdx
Kody JacksonandClaude Sonnet 5.5 5ca501cd24 chore(docs) - Remove inline Accordion component for machine readability -> details/summary instead (#53274)
## Problem

Accordion components -- as currently constructed -- aren't machine
readable b/c they require JS. Additionally, they aren't heavily used at
all.

## Solution

Removes accordion component from codebase + moves existing usage into
`<details>` / `<summary>` components. Adds some default styling for the
new HTML pattern so they look similar.

Could also refactor accordion to auto-template out details/summary too.
No strong pref here.

## Limits

The sidebar navigation accordions use radix-ui directly and are
unchanged.

## Preview links

### Before

[Creating a client
(before)](https://supabase.com/docs/guides/auth/server-side/creating-a-client#nextjs-utility-functions)


https://github.com/user-attachments/assets/fd320358-7a35-46f8-b7b4-177b023e748e

### After

[Creating a client
(before)](https://docs-git-kody-devrel-850-remove-accordions-docs-mdx-supabase.vercel.app/docs/guides/auth/server-side/creating-a-client#nextjs-utility-functions)


https://github.com/user-attachments/assets/22049184-9157-46d2-a3a6-64ca2c991e24

---------

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-12 11:31:54 -06:00

38 lines
1.6 KiB
Plaintext

<details>
<summary>What you can do with the Metrics API</summary>
Every Supabase project exposes a metrics feed at `https://<project-ref>.supabase.co/customer/v1/privileged/metrics`. Replace `<project-ref>` with the identifier from your project URL or from the dashboard sidebar.
1. Copy your project reference and confirm the base URL using the helper below.
<ProjectConfigVariables variable="url" />
2. Configure your collector to scrape once per minute. The endpoint already emits the full set of metrics on each request.
3. Authenticate with HTTP Basic Auth:
- **Username**: `service_role`
- **Password**: a **Secret API key** (`sb_secret_...`). You can create/copy it in [**Project Settings → API Keys**](/dashboard/project/_/settings/api-keys). For more context, see [API keys](/docs/guides/getting-started/api-keys).
To test locally, run `curl` with your Secret API key:
```bash
curl <project-url>/customer/v1/privileged/metrics \
--user 'service_role:sb_secret_...'
```
You can provision long-lived automation tokens in two ways:
- Create an account access token once at [**Account Settings > Access Tokens**](/dashboard/account/tokens) and reuse it wherever you configure observability tooling.
- **Optional**: programmatically exchange an access token for project API keys via the [Management API](/docs/reference/api/v1-get-project-api-keys).
```bash
# (Optional) Exchange an account access token for project API keys
export SUPABASE_ACCESS_TOKEN="your-access-token"
export PROJECT_REF="your-project-ref"
curl -H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN" \
"https://api.supabase.com/v1/projects/$PROJECT_REF/api-keys?reveal=true"
```
</details>