Use Sentry when you want hosted error monitoring, traces, and logs for a Bun-hosted Redop server. This page follows the Bun setup model from Sentry and shows how to apply it to a Redop app.Documentation Index
Fetch the complete documentation index at: https://redop.useagents.site/docs/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
You need:- a Sentry account and project
- a Redop server running on Bun
Step 1: Install
Add the Bun SDK to your project:Step 2: Initialize Sentry early
Initialize Sentry before you import the rest of your app. Createinstrument.ts at the project root:
Step 3: Preload the instrumentation file
Start Bun with--preload so Sentry initializes before your Redop server code runs.
Step 4: Capture Redop errors with context
Sentry can capture unhandled Bun errors automatically, but Redop also gives you a clean place to attach request metadata withonError(...).
Step 5: Verify the setup
Trigger a deliberate failure and confirm it appears in Sentry.- the captured error in Issues
- any traces in Traces if tracing is enabled
- any structured log entries in Logs if logs are enabled
Add source maps
If your production stack traces are minified, upload source maps:Bun limitation for bundled code
Sentry’s Bun auto-instrumentation depends on module loading hooks. If you bundle your app into a single file, use manual instrumentation instead of relying on the preload-based setup.Next steps
- tune
tracesSampleRatefor production traffic - add tags or extra context from
ctx.requestId, tool names, tenant IDs, or auth metadata - upload source maps before production deploys
- review Sentry’s Bun docs for tracing, logs, and advanced configuration