mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-10-03 12:10:34 +00:00
Import Sentry in middleware
This commit is contained in:
@@ -1,10 +0,0 @@
|
||||
import { init } from '@sentry/nextjs';
|
||||
|
||||
const dsn = process.env.SENTRY_DSN;
|
||||
if (dsn) {
|
||||
init({
|
||||
dsn,
|
||||
// Disable tracing as it creates additional requests in an env where subrequests are limited.
|
||||
tracesSampleRate: 0,
|
||||
});
|
||||
}
|
||||
@@ -2,8 +2,7 @@ import * as Sentry from '@sentry/nextjs';
|
||||
import { Instrumentation } from 'next';
|
||||
|
||||
export async function register() {
|
||||
console.log('Instrumentation.register');
|
||||
await import('../sentry.edge.config');
|
||||
await import('./sentry');
|
||||
}
|
||||
|
||||
export const onRequestError: Instrumentation.onRequestError = async (...args) => {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import './sentry';
|
||||
import { ContentAPITokenPayload, GitBookAPI } from '@gitbook/api';
|
||||
import { setTag, setContext } from '@sentry/nextjs';
|
||||
import assertNever from 'assert-never';
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { init } from '@sentry/nextjs';
|
||||
import * as Sentry from '@sentry/nextjs';
|
||||
|
||||
const dsn = process.env.SENTRY_DSN;
|
||||
if (dsn) {
|
||||
console.log('Initializing Sentry with DSN:', dsn);
|
||||
init({
|
||||
Sentry.init({
|
||||
dsn,
|
||||
// Disable tracing as it creates additional requests in an env where subrequests are limited.
|
||||
tracesSampleRate: 0,
|
||||
Reference in New Issue
Block a user