Roo-Code/apps/web/src/instrumentation.ts
Chris Estreich 5edb2f8bb6
Encrypt and store secret ENV vars in the repo with dotenvx (#114)
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
Co-authored-by: Matt Rubens <mrubens@users.noreply.github.com>
Co-authored-by: John Richmond <5629+jr@users.noreply.github.com>
2025-06-26 10:54:39 -07:00

40 lines
1.3 KiB
TypeScript

import * as Sentry from '@sentry/nextjs';
export const onRequestError = Sentry.captureRequestError;
export async function register() {
if (process.env.NEXT_RUNTIME === 'nodejs') {
// Node.js Sentry configuration
Sentry.init({
// Sentry DSN
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
// Adjust this value in production, or use tracesSampler for greater control
tracesSampleRate: 1,
// Setting this option to true will print useful information to the console while you're setting up Sentry.
debug: false,
// Increase max length for messages to prevent truncation (default is 250)
maxValueLength: 8192,
});
}
if (process.env.NEXT_RUNTIME === 'edge') {
// Edge Sentry configuration
// Note: User context (userId, orgId, orgRole) is set in layouts via setSentryUserContext()
Sentry.init({
// Sentry DSN
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
// Adjust this value in production, or use tracesSampler for greater control
tracesSampleRate: 1,
// Setting this option to true will print useful information to the console while you're setting up Sentry.
debug: false,
// Increase max length for messages to prevent truncation (default is 250)
maxValueLength: 8192,
});
}
}