Skip to content

Commit e739e2f

Browse files
Merge pull request #23 from eth-cscs/1548-remove-sentry-dep
1548 remove Sentry dependency
2 parents f2282fb + 549a6dd commit e739e2f

23 files changed

+101
-711
lines changed

.gitignore

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ sessions/
2929
node_modules
3030
node_modules*
3131

32-
# sentry
33-
.sentryclirc
34-
.env.sentry-build-plugin
32+
33+
# Yarn Berry
34+
.yarn/*
35+
!.yarn/patches
36+
!.yarn/plugins
37+
!.yarn/releases
38+
!.yarn/sdks
39+
!.yarn/versions

.yarn/install-state.gz

-67.2 KB
Binary file not shown.

.yarnrc.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
nodeLinker: node-modules
1+
nodeLinker: node-modules
2+
packageExtensions:
3+
"remix-keycloak@*":
4+
peerDependencies:
5+
"@remix-run/react": "^2.16.0"

app/configs/sentry.config.ts

Lines changed: 0 additions & 21 deletions
This file was deleted.

app/entry.client.tsx

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
SPDX-License-Identifier: BSD-3-Clause
66
*************************************************************************/
77

8-
import * as Sentry from '@sentry/remix'
9-
import { replayIntegration } from '@sentry/remix'
108
import { hydrateRoot } from 'react-dom/client'
119
import { startTransition, StrictMode, useEffect } from 'react'
1210
import { RemixBrowser, useLocation, useMatches } from '@remix-run/react'
@@ -17,35 +15,10 @@ declare global {
1715
ENV: {
1816
APP_VERSION: string
1917
ENVIRONMENT: string
20-
SENTRY_ACTIVE: boolean
21-
SENTRY_DSN: string
22-
SENTRY_DEBUG: boolean
23-
SENTRY_TRACES_SAMPLE_RATE: number
2418
}
2519
}
2620
}
2721

28-
// Initialize sentry
29-
if (window.ENV.SENTRY_ACTIVE) {
30-
Sentry.init({
31-
dsn: window.ENV.SENTRY_DSN,
32-
debug: window.ENV.SENTRY_DEBUG,
33-
environment: window.ENV.ENVIRONMENT,
34-
release: window.ENV.APP_VERSION,
35-
tracesSampleRate: parseFloat(window.ENV.SENTRY_TRACES_SAMPLE_RATE + ''),
36-
replaysSessionSampleRate: 0.1,
37-
replaysOnErrorSampleRate: 1,
38-
integrations: [
39-
Sentry.browserTracingIntegration({
40-
useEffect,
41-
useLocation,
42-
useMatches,
43-
}),
44-
replayIntegration(),
45-
],
46-
})
47-
}
48-
4922
startTransition(() => {
5023
hydrateRoot(
5124
document,

app/entry.server.tsx

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,12 @@
44
Please, refer to the LICENSE file in the root directory.
55
SPDX-License-Identifier: BSD-3-Clause
66
*************************************************************************/
7-
import * as Sentry from '@sentry/remix'
87
import { PassThrough } from 'node:stream'
98
import { isbot } from 'isbot'
109
import { RemixServer } from '@remix-run/react'
1110
import { renderToPipeableStream } from 'react-dom/server'
1211
import { createReadableStreamFromReadable } from '@remix-run/node'
1312
import type { AppLoadContext, EntryContext } from '@remix-run/node'
14-
// configs
15-
import base from './configs/base.config'
16-
import sentry from './configs/sentry.config'
17-
18-
export function handleError(error: any, { request }: any) {
19-
Sentry.captureRemixServerException(error, 'remix.server', request)
20-
}
21-
22-
// Sentry initialization
23-
if (sentry.active) {
24-
Sentry.init({
25-
dsn: sentry.dsn,
26-
debug: sentry.debug,
27-
environment: base.environment,
28-
release: base.appVersion,
29-
tracesSampleRate: parseFloat(sentry.tracesSampleRate),
30-
})
31-
}
3213

3314
const ABORT_DELAY = 5_000
3415

app/helpers/response-helper.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
import { ValidationError } from 'yup'
99
import { StatusCodes } from 'http-status-codes'
10-
import { captureException } from '@sentry/remix'
1110
import { json, MaxPartSizeExceededError } from '@remix-run/node'
1211
// types
1312
import { ErrorType } from '~/types/error'
@@ -67,8 +66,6 @@ export const handleErrorResponse = (
6766
error: any,
6867
handlingThreshold: StatusCodes | null = StatusCodes.INTERNAL_SERVER_ERROR,
6968
) => {
70-
// Capture exception with remix
71-
captureException(error)
7269
// Validation http error
7370
if (error instanceof ValidationError) {
7471
return handleValidationErrorResponse(error)

app/root.tsx

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,10 @@ import {
1616
useLoaderData,
1717
useRouteError,
1818
} from '@remix-run/react'
19-
import { captureRemixErrorBoundaryError } from '@sentry/remix'
2019
// styles
2120
import stylesheet from '~/tailwind.css?url'
2221
// configs
2322
import base from './configs/base.config'
24-
import sentry from './configs/sentry.config'
2523
// pages
2624
import ErrorPage from './components/pages/ErrorPage'
2725
import logger from './logger/logger'
@@ -34,10 +32,6 @@ export async function loader({ context }: LoaderFunctionArgs) {
3432
APP_NAME: base.appName,
3533
APP_VERSION: base.appVersion,
3634
ENVIRONMENT: base.environment,
37-
SENTRY_ACTIVE: sentry.active,
38-
SENTRY_DSN: sentry.dsn,
39-
SENTRY_DEBUG: sentry.debug,
40-
SENTRY_TRACES_SAMPLE_RATE: sentry.tracesSampleRate,
4135
},
4236
})
4337
}
@@ -94,7 +88,6 @@ export default function App() {
9488
export function ErrorBoundary() {
9589
const error = useRouteError()
9690
logger.error(error)
97-
captureRemixErrorBoundaryError(error)
9891
return (
9992
<Document title='FirecREST Web UI - v2'>
10093
<ErrorPage />

app/routes/_app._index.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
*************************************************************************/
77

88
import { useLoaderData, useRouteError } from '@remix-run/react'
9-
import { captureRemixErrorBoundaryError } from '@sentry/remix'
109
import type { LoaderFunction, LoaderFunctionArgs } from '@remix-run/node'
1110
// loggers
1211
import logger from '~/logger/logger'
@@ -77,6 +76,5 @@ export default function AppIndexRoute() {
7776
export function ErrorBoundary() {
7877
const error = useRouteError()
7978
logger.error(error)
80-
captureRemixErrorBoundaryError(error)
8179
return <ErrorView error={error} />
8280
}

app/routes/_app.compute._index.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
SPDX-License-Identifier: BSD-3-Clause
66
*************************************************************************/
77

8-
import { captureRemixErrorBoundaryError } from '@sentry/remix'
98
import { useLoaderData, useRouteError } from '@remix-run/react'
109
import type { LoaderFunction, LoaderFunctionArgs } from '@remix-run/node'
1110
// types
@@ -60,6 +59,5 @@ export default function AppComputeIndexRoute() {
6059
export function ErrorBoundary() {
6160
const error = useRouteError()
6261
logger.error(error)
63-
captureRemixErrorBoundaryError(error)
6462
return <ErrorView error={error} />
6563
}

0 commit comments

Comments
 (0)