mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 09:25:06 +03:00
docs: add sentry integration docs (#21439)
* docs: add sentry integration docs * feat: add sentry edge functions monitoring guide. * feat: add sentry functions example. * fix: navbar. * chore: nits. * chore: add to functions example list. * fix: formatting. * chore: add nextjs example. * fix: rename sentry guide * remove configuration options * Apply suggestions from code review Co-authored-by: Kamil Ogórek <kamil.ogorek@gmail.com> --------- Co-authored-by: thorwebdev <thor@supabase.io> Co-authored-by: Thor 雷神 Schaeff <5748289+thorwebdev@users.noreply.github.com> Co-authored-by: Kamil Ogórek <kamil.ogorek@gmail.com>
This commit is contained in:
5 files changed
+395
-2
No files matched your search
@@ -0,0 +1,32 @@
|
||||
import * as Sentry from 'https://deno.land/x/sentry/index.mjs'
|
||||
|
||||
Sentry.init({
|
||||
dsn: SENTRY_DSN,
|
||||
integrations: [],
|
||||
debug: true,
|
||||
// Performance Monitoring
|
||||
tracesSampleRate: 1.0,
|
||||
// Set sampling rate for profiling - this is relative to tracesSampleRate
|
||||
profilesSampleRate: 1.0,
|
||||
})
|
||||
|
||||
// Set region and execution_id as custom tags
|
||||
Sentry.setTag('region', Deno.env.get('SB_REGION'))
|
||||
Sentry.setTag('execution_id', Deno.env.get('SB_EXECUTION_ID'))
|
||||
|
||||
Deno.serve(async (req) => {
|
||||
try {
|
||||
const { name } = await req.json()
|
||||
const data = {
|
||||
message: `Hello ${name}!`,
|
||||
}
|
||||
|
||||
return new Response(JSON.stringify(data), { headers: { 'Content-Type': 'application/json' } })
|
||||
} catch (e) {
|
||||
Sentry.captureException(e)
|
||||
return new Response(JSON.stringify({ msg: 'error' }), {
|
||||
status: 500,
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
})
|
||||
}
|
||||
})
|
||||
Reference in new issue
Block a user