Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions docs/platforms/apple/common/integrations/supabase.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: Supabase
description: "Correlate Sentry traces with Supabase logs on Apple platforms."
sidebar_order: 50
---

The Sentry Apple SDK instruments URLSession and automatically injects `sentry-trace` and `baggage` headers into outgoing requests — including those made by the Supabase Swift SDK. Enabling `enablePropagateTraceparent` also adds the W3C `traceparent` header, which Supabase reads to stamp API Gateway and Edge Function logs with your trace ID.

Combined with [Supabase Log Drains](/product/drains/supabase/), this lets you navigate from a Sentry span directly to the Supabase server logs it produced — with no changes to your `SupabaseClient` setup.

See the [Supabase Swift trace propagation documentation](https://supabase.com/docs/guides/monitoring-and-debugging/client-side-tracing) for full setup instructions, including the SwiftPM `OpenTelemetry` trait and `enablePropagateTraceparent` configuration.
11 changes: 11 additions & 0 deletions docs/platforms/dart/common/integrations/supabase.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: Supabase
description: "Correlate Sentry traces with Supabase logs in Dart and Flutter apps."
sidebar_order: 35
---

The Sentry Flutter/Dart SDK can propagate W3C trace context through Supabase API requests. Enabling `propagateTraceparent` (requires `sentry_flutter` ≥9.7.0) attaches the `traceparent` header to outgoing HTTP requests, which Supabase reads to stamp API Gateway and Edge Function logs with your trace ID.

Combined with [Supabase Log Drains](/product/drains/supabase/), this lets you navigate from a Sentry span directly to the Supabase server logs it produced.

See the [Supabase Dart trace propagation documentation](https://supabase.com/docs/guides/monitoring-and-debugging/client-side-tracing) for full setup instructions, including the `TracePropagationOptions` API.
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,11 @@ The integration automatically:
## Supported Versions

- `@supabase/supabase-js`: `>=2.0.0`

## Trace Propagation

Starting with `@supabase/supabase-js` version `2.106.0`, the Supabase client can propagate W3C trace context (`traceparent`) through Supabase services. Because `Sentry.init()` already registers a W3C-compliant OpenTelemetry provider, add `tracePropagation: true` to your `createClient` call. You'll also need to set `propagateTraceparent: true` in `Sentry.init()` (it defaults to `false`) so Sentry actually emits the `traceparent` header. For browser apps, add your Supabase project URL to `tracePropagationTargets` in `Sentry.init()` as well — Sentry only attaches trace headers to cross-origin requests for listed targets, and Supabase is always cross-origin.

The `trace_id` from a Sentry span then flows into Supabase API Gateway and Edge Function logs. Combined with [Supabase Log Drains](/product/drains/supabase/), this lets you navigate from a Sentry span directly to the server-side logs it produced.

See the [Supabase client-side tracing documentation](https://supabase.com/docs/guides/monitoring-and-debugging/client-side-tracing) for full setup instructions.
10 changes: 10 additions & 0 deletions docs/product/drains/supabase.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,13 @@ ___DSN___
2. Create a Sentry log drain in the [Supabase dashboard](https://supabase.com/dashboard/project/_/settings/log-drains). 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.

## Correlating Logs with Sentry Traces

If you enable [client-side trace propagation](https://supabase.com/docs/guides/monitoring-and-debugging/client-side-tracing) in the Supabase SDK, the `trace_id` in forwarded logs will match the Sentry trace that triggered the request. This lets you navigate from a Sentry span directly to the Supabase server logs it produced.

Setup instructions by platform:

- **JavaScript**: [Supabase JavaScript integration](/platforms/javascript/guides/node/configuration/integrations/supabase/#trace-propagation)
Comment thread
andreiborza marked this conversation as resolved.
- **Swift**: [Supabase Swift integration](/platforms/apple/integrations/supabase/)
- **Flutter/Dart**: [Supabase Dart integration](/platforms/dart/integrations/supabase/)
Loading