Skip to content

Commit

Permalink
sentry tracing
Browse files Browse the repository at this point in the history
  • Loading branch information
kentcdodds committed Nov 3, 2023
1 parent b81fa69 commit a55f6dc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 4 additions & 1 deletion app/utils/monitoring.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ export function init() {
dsn: ENV.SENTRY_DSN,
environment: ENV.MODE,
tracesSampleRate: 1,
integrations: [new Sentry.Integrations.Prisma({ client: prisma })],
integrations: [
new Sentry.Integrations.Http({ tracing: true }),
new Sentry.Integrations.Prisma({ client: prisma }),
],
})
}
7 changes: 5 additions & 2 deletions server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
installGlobals,
type ServerBuild,
} from '@remix-run/node'
import { wrapExpressCreateRequestHandler } from '@sentry/remix'
import * as Sentry from '@sentry/remix'
import { ip as ipAddress } from 'address'
import chalk from 'chalk'
import closeWithGrace from 'close-with-grace'
Expand All @@ -25,7 +25,7 @@ installGlobals()

const MODE = process.env.NODE_ENV

const createRequestHandler = wrapExpressCreateRequestHandler(
const createRequestHandler = Sentry.wrapExpressCreateRequestHandler(
_createRequestHandler,
)

Expand Down Expand Up @@ -76,6 +76,9 @@ app.use(compression())
// http://expressjs.com/en/advanced/best-practice-security.html#at-a-minimum-disable-x-powered-by-header
app.disable('x-powered-by')

app.use(Sentry.Handlers.requestHandler())
app.use(Sentry.Handlers.tracingHandler())

// Remix fingerprints its assets so we can cache forever.
app.use(
'/build',
Expand Down

0 comments on commit a55f6dc

Please sign in to comment.