Skip to content

Commit

Permalink
change sentry import to correct package (#903)
Browse files Browse the repository at this point in the history
* change sentry import to correct package

* modify docs to reflect current sentry situation
  • Loading branch information
nichtsam authored Jan 17, 2025
1 parent be29d40 commit b39e2d9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
10 changes: 6 additions & 4 deletions docs/monitoring.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,12 @@ env var during runtime:
fly secrets set SENTRY_DSN=<your_dsn>
```

See the guide for the remix
[here](https://docs.sentry.io/platforms/javascript/guides/remix/). Run the
installation wizard but note that some of the steps included already exist in
this codebase so be sure to remove any duplication.
See the guides for React Router v7
[here(library)](https://docs.sentry.io/platforms/javascript/guides/react/features/react-router/v7/)
and
[here(framwork)](https://docs.sentry.io/platforms/javascript/guides/react-router/).
Note that the dedicated SDK for React Router is under development and features
are lacking.

To generate the auth token, click
[this](https://sentry.io/orgredirect/settings/:orgslug/developer-settings/new-internal/)
Expand Down
6 changes: 3 additions & 3 deletions server/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import crypto from 'node:crypto'
import { createRequestHandler } from '@react-router/express'
import * as Sentry from '@sentry/react'
import * as Sentry from '@sentry/node'
import { ip as ipAddress } from 'address'
import chalk from 'chalk'
import closeWithGrace from 'close-with-grace'
Expand Down Expand Up @@ -144,7 +144,7 @@ const maxMultiple =
!IS_PROD || process.env.PLAYWRIGHT_TEST_BASE_URL ? 10_000 : 1
const rateLimitDefault = {
windowMs: 60 * 1000,
limit: 1000 * maxMultiple,
limit: 1000 * maxMultiple,
standardHeaders: true,
legacyHeaders: false,
validate: { trustProxy: false },
Expand All @@ -166,7 +166,7 @@ const strongestRateLimit = rateLimit({
const strongRateLimit = rateLimit({
...rateLimitDefault,
windowMs: 60 * 1000,
limit: 100 * maxMultiple,
limit: 100 * maxMultiple,
})

const generalRateLimit = rateLimit(rateLimitDefault)
Expand Down
7 changes: 3 additions & 4 deletions server/utils/monitoring.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { prismaIntegration, httpIntegration } from '@sentry/node'
import * as Sentry from '@sentry/node'
import { nodeProfilingIntegration } from '@sentry/profiling-node'
import * as Sentry from '@sentry/react'

export function init() {
Sentry.init({
Expand All @@ -18,8 +17,8 @@ export function init() {
/\/site\.webmanifest/,
],
integrations: [
prismaIntegration(),
httpIntegration(),
Sentry.prismaIntegration(),
Sentry.httpIntegration(),
nodeProfilingIntegration(),
],
tracesSampler(samplingContext) {
Expand Down

0 comments on commit b39e2d9

Please sign in to comment.