Monitoring with Sentry
Add the Sentry Deno SDK to your Supabase Edge Functions to easily track exceptions and get notified of errors or performance issues.
Prerequisites
- Create a Sentry account.
- Make sure you have the latest version of the Supabase CLI installed.
1. Create Supabase function
Create a new function locally:
2. Add the Sentry Deno SDK
Handle exceptions within your function and send them to Sentry.
3. Deploy and test
Run function locally:
Test it: http://localhost:54321/functions/v1/sentryfied
Deploy function to Supabase:
4. Try it yourself
Find the complete example on GitHub.
Working With Scopes
Sentry Deno SDK currently do not support Deno.serve
instrumentation, which means that there is no scope separation between requests.
Because of that, when the Edge Functions runtime is reused between multiple requests, all globally captured breadcrumbs and contextual data
will be shared, which is not the desired behavior. To work around this, all default integrations in the example code above are disabled,
and you should be relying on withScope
to encapsulate
all Sentry SDK API calls, or pass context directly
to the captureException
or captureMessage
calls.