Supabase Log Drains
Learn how to set up Supabase Log Drains to forward logs to Sentry.
The Sentry Supabase Log drain will forward all logs from your Supabase stack to Sentry.
Supabase Log Drains are only available on the Supabase Pro, Team, and Enterprise Plans
Before you begin, ensure you have:
- A Supabase project that you want to monitor
- A Sentry project you want to send data to
To set up the Sentry log drain, follow these steps:
- Grab your DSN from your Sentry project's Client Keys (DSN) settings.
___DSN___
___DSN___
- Create a Sentry log drain in the Supabase dashboard. Make sure you provide the DSN you grabbed in the previous step.
Then you should get logs in your Sentry project. All fields from the log event are attached as attributes to the Sentry log, which can be used for filtering and grouping in the Sentry UI.
Enable client-side trace propagation to add Sentry trace IDs to Supabase API Gateway and Edge Function logs. The shared trace_id links sampled spans to their Supabase logs.
Only sampled requests have a Sentry span. Increase your trace sample rate to capture more spans. Setting respectSamplingDecision: false sends full context for unsampled requests but does not cause Sentry to sample them.
If traces and logs use different sample rates, use cross-event querying to find traces with logs. For direct browser calls to Supabase Edge Functions, add sentry-trace to the CORS allow-list.
Setup instructions by platform:
- JavaScript: Supabase JavaScript integration
- Swift: Supabase Swift integration
- Flutter/Dart: Supabase Dart integration
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").