diff --git a/docs/platforms/apple/common/integrations/supabase.mdx b/docs/platforms/apple/common/integrations/supabase.mdx new file mode 100644 index 0000000000000..4bcec18881bf7 --- /dev/null +++ b/docs/platforms/apple/common/integrations/supabase.mdx @@ -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. diff --git a/docs/platforms/dart/common/integrations/supabase.mdx b/docs/platforms/dart/common/integrations/supabase.mdx new file mode 100644 index 0000000000000..15b99cc37b4ea --- /dev/null +++ b/docs/platforms/dart/common/integrations/supabase.mdx @@ -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. diff --git a/docs/platforms/javascript/common/configuration/integrations/supabase.mdx b/docs/platforms/javascript/common/configuration/integrations/supabase.mdx index f33cf94112439..02cb262a8e9a8 100644 --- a/docs/platforms/javascript/common/configuration/integrations/supabase.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/supabase.mdx @@ -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. diff --git a/docs/product/drains/supabase.mdx b/docs/product/drains/supabase.mdx index 07265811be566..bb74dd854c650 100644 --- a/docs/product/drains/supabase.mdx +++ b/docs/product/drains/supabase.mdx @@ -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) +- **Swift**: [Supabase Swift integration](/platforms/apple/integrations/supabase/) +- **Flutter/Dart**: [Supabase Dart integration](/platforms/dart/integrations/supabase/)