|
| 1 | +--- |
| 2 | +title: Quick start for Supabase |
| 3 | +sidebar_label: Quick start for Supabase |
| 4 | +sidebar_position: 7 |
| 5 | +keywords: |
| 6 | + - "PostgresAI for Supabase" |
| 7 | + - "Postgres monitoring for Supabase" |
| 8 | + - "PostgresAI checkup for Supabase" |
| 9 | + - "Supabase Grafana" |
| 10 | +--- |
| 11 | + |
| 12 | +# Quick start guide for Supabase users |
| 13 | + |
| 14 | +Set up PostgresAI monitoring for your Supabase databases using the built-in Supabase integration in |
| 15 | +[PostgresAI Console](https://console.postgres.ai/). |
| 16 | + |
| 17 | +## Overview |
| 18 | + |
| 19 | +The Supabase integration uses OAuth to automatically discover your Supabase projects and provision |
| 20 | +monitoring — no manual database credentials or network configuration required. |
| 21 | + |
| 22 | +Two monitoring levels are available: |
| 23 | + |
| 24 | +| Level | Includes | Plan | |
| 25 | +|-------|----------|------| |
| 26 | +| **Quick setup** | Auto-discovery, daily checkups, JSON reports | Free | |
| 27 | +| **Full monitoring** | Grafana dashboards, real-time metrics, advanced alerts, historical data | Scaling | |
| 28 | + |
| 29 | +## Prerequisites |
| 30 | + |
| 31 | +1. A [Supabase](https://supabase.com/) account with at least one project. |
| 32 | +2. A [PostgresAI Console](https://console.postgres.ai/) account. Sign up with Google, LinkedIn, |
| 33 | + GitHub, or GitLab. |
| 34 | +3. An organization in PostgresAI Console. |
| 35 | + [Create one](https://console.postgres.ai/addorg) if you don't have one yet. |
| 36 | +4. A payment method on file (required for the Scaling plan). In your organization, open **Billing**, |
| 37 | + click **Edit payment methods**, and add a card in the Stripe portal. |
| 38 | + |
| 39 | +## Step 1. Start the Supabase setup |
| 40 | + |
| 41 | +In PostgresAI Console, navigate to **Checkup — Getting started** and click **Connect Supabase**. |
| 42 | + |
| 43 | +[](/assets/supabase-monitoring/supabase-monitoring-1.png) |
| 44 | + |
| 45 | +## Step 2. Choose monitoring level |
| 46 | + |
| 47 | +In the **Supabase monitoring** dialog, choose the monitoring level: |
| 48 | + |
| 49 | +- **Quick setup** (Free) — one-click OAuth connection with auto-discovery, daily checkups, and JSON |
| 50 | + reports. |
| 51 | +- **Full monitoring** (Scaling) — dedicated monitoring infrastructure with Grafana dashboards, |
| 52 | + real-time metrics, advanced alerts, and historical data. |
| 53 | + |
| 54 | +See [Pricing](/pricing) for the full list of available options with feature comparison. |
| 55 | + |
| 56 | +[](/assets/supabase-monitoring/supabase-monitoring-2.png) |
| 57 | + |
| 58 | +## Step 3. Authorize Supabase access |
| 59 | + |
| 60 | +After selecting a monitoring level, you are redirected to Supabase to authorize PostgresAI. |
| 61 | + |
| 62 | +Review the requested permissions and select the organization you want to monitor, then click |
| 63 | +**Authorize PostgresAI**. |
| 64 | + |
| 65 | +The requested permissions include: |
| 66 | + |
| 67 | +- **Read and Write** access to Postgres configurations, SQL snippets, SSL enforcement |
| 68 | + configurations, and TypeScript schema types. |
| 69 | +- **Read** access to the organization and all its members. |
| 70 | +- **Read** access to project metadata, upgrade status, network restrictions, and network bans. |
| 71 | + |
| 72 | +[](/assets/supabase-monitoring/supabase-monitoring-3.png) |
| 73 | + |
| 74 | +## Step 4. Select projects and deploy |
| 75 | + |
| 76 | +After authorization, you are returned to PostgresAI Console. |
| 77 | + |
| 78 | +1. In **Billing & plan**, confirm your payment method. |
| 79 | +2. In **Supabase project**, select the **Organization** and check the **Projects to provision**. |
| 80 | +3. Optionally, expand **Advanced setup** to configure SSH keys, cloud provider, or cloud region. |
| 81 | +4. Click **Deploy**. |
| 82 | + |
| 83 | +[](/assets/supabase-monitoring/supabase-monitoring-4.png) |
| 84 | + |
| 85 | +:::tip |
| 86 | +PostgresAI automatically creates a dedicated monitoring user in your Supabase database and deploys |
| 87 | +the monitoring stack. No manual database setup is required. |
| 88 | +::: |
| 89 | + |
| 90 | +## Step 5. Wait for deployment |
| 91 | + |
| 92 | +After clicking **Deploy**, the monitoring stack is provisioned and configured. Track progress on the |
| 93 | +installation page: |
| 94 | + |
| 95 | +1. Waiting for SSH |
| 96 | +2. Provisioning VM |
| 97 | +3. Installing base packages |
| 98 | +4. Starting monitoring services |
| 99 | +5. Finishing setup |
| 100 | + |
| 101 | +[](/assets/supabase-monitoring/supabase-monitoring-5.png) |
| 102 | + |
| 103 | +While waiting, you can set up the CLI tools: |
| 104 | + |
| 105 | +```bash |
| 106 | +# Install CLI |
| 107 | +npm i -g postgresai |
| 108 | + |
| 109 | +# Authenticate |
| 110 | +postgresai auth |
| 111 | + |
| 112 | +# Set up MCP for your AI coding tool (Cursor, Claude Code, etc.) |
| 113 | +postgresai mcp install |
| 114 | +``` |
| 115 | + |
| 116 | +## Step 6. Save Grafana credentials |
| 117 | + |
| 118 | +Once the deployment completes, the page shows **Deployment completed successfully!** with your |
| 119 | +Grafana access details: |
| 120 | + |
| 121 | +- **URL** — your dedicated Grafana instance |
| 122 | +- **Username** — `monitor` |
| 123 | +- **Password** — auto-generated |
| 124 | + |
| 125 | +[](/assets/supabase-monitoring/supabase-monitoring-6.png) |
| 126 | + |
| 127 | +:::caution |
| 128 | +Save your Grafana credentials in a password manager — they are not stored in PostgresAI Console. |
| 129 | +::: |
| 130 | + |
| 131 | +## Step 7. Open Grafana dashboards |
| 132 | + |
| 133 | +Open the Grafana URL from the deployment page. You can sign in using one of the following methods: |
| 134 | + |
| 135 | +- **Grafana credentials** — use the username and password from the previous step. |
| 136 | +- **PostgresAI OAuth** — click **Sign in with PostgresAI** for passwordless access. |
| 137 | + |
| 138 | +[](/assets/supabase-monitoring/supabase-monitoring-7.png) |
| 139 | + |
| 140 | +Start with **01. Node overview** for a high-level health check of your Supabase database. Key panels |
| 141 | +to check first: |
| 142 | + |
| 143 | +1. **Active session history (ASH)** — wait events over time |
| 144 | +2. **Sessions** — active, idle, and idle in transaction connections |
| 145 | +3. **TPS** — transactions per second |
| 146 | +4. **QPS** — queries per second |
| 147 | + |
| 148 | +## Step 8. Review first issues |
| 149 | + |
| 150 | +After about 30 minutes, PostgresAI generates the first automated issue reports. Navigate to |
| 151 | +**Issues** in PostgresAI Console to see detected problems and recommended actions. |
| 152 | + |
| 153 | +[](/assets/supabase-monitoring/supabase-monitoring-8.png) |
| 154 | + |
| 155 | +Common issues detected automatically include: |
| 156 | + |
| 157 | +- **Redundant indexes** — duplicate indexes wasting storage |
| 158 | +- **Unused indexes** — indexes that are never scanned |
| 159 | +- **Invalid indexes** — indexes that failed to build |
| 160 | +- **Autovacuum tuning** — recommended configuration changes |
| 161 | +- **Minor version updates** — available PostgreSQL updates |
| 162 | + |
| 163 | +See [How to work with issues](/docs/postgresai-howtos/how-to-work-with-issues) for details on |
| 164 | +managing issues, assigning team members, and integrating with AI coding tools. |
| 165 | + |
| 166 | +## Next steps |
| 167 | + |
| 168 | +- [Dashboard guide](/docs/monitoring/dashboards/) — complete dashboard reference |
| 169 | +- [PostgresAI CLI](/docs/postgresai-howtos/postgresai-cli) — CLI setup and commands |
| 170 | +- [MCP integration](/docs/postgresai-howtos/how-to-install-mcp) — set up MCP for Cursor, Claude |
| 171 | + Code, or other AI coding tools |
| 172 | + |
| 173 | +## FAQ |
| 174 | + |
| 175 | +### What database role is created and what permissions does it have? |
| 176 | + |
| 177 | +The monitoring user is created automatically during Supabase setup with read-only access to metadata |
| 178 | +only. To review the exact SQL statements used to create the monitoring role: |
| 179 | + |
| 180 | +```bash |
| 181 | +npx postgresai@latest prepare-db --print-sql |
| 182 | +``` |
| 183 | + |
| 184 | +This shows all `grant` statements and confirms the minimal, read-only nature of the permissions. |
| 185 | + |
| 186 | +### What data is collected from my database? |
| 187 | + |
| 188 | +PostgresAI monitoring collects only database metadata — no actual data or query parameters. To |
| 189 | +review exactly what metrics are collected, examine the metric definitions: |
| 190 | + |
| 191 | +- **Prometheus sink metrics**: |
| 192 | + [metrics.yml (pgwatch-prometheus)](https://gitlab.com/postgres-ai/postgresai/-/blob/0.14.0/config/pgwatch-prometheus/metrics.yml) |
| 193 | +- **PostgreSQL sink metrics** (including normalized queries): |
| 194 | + [metrics.yml (pgwatch-postgres)](https://gitlab.com/postgres-ai/postgresai/-/blob/0.14.0/config/pgwatch-postgres/metrics.yml) |
| 195 | + |
| 196 | +See also: [data privacy details](/docs/monitoring/#data-privacy-metadata-only). |
0 commit comments