Skip to content

Commit

Permalink
deps: Bump Sentry SDK to 8.0.0-beta.3
Browse files Browse the repository at this point in the history
  • Loading branch information
lforst committed Apr 23, 2024
1 parent 390925f commit 6a5c913
Show file tree
Hide file tree
Showing 3 changed files with 763 additions and 53 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
"README"
],
"dependencies": {
"@sentry/node": "7.91.0",
"@sentry/profiling-node": "1.3.2",
"@sentry/node": "8.0.0-beta.3",
"@sentry/profiling-node": "8.0.0-beta.3",
"canvas": "^2.11.2",
"dotenv": "^8.2.0",
"echarts": "5.4.0",
Expand Down
13 changes: 4 additions & 9 deletions src/renderServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import {performance} from 'node:perf_hooks';

import * as Sentry from '@sentry/node';
import {ProfilingIntegration} from '@sentry/profiling-node';
import {nodeProfilingIntegration} from '@sentry/profiling-node';
import express from 'express';

import {ConfigService} from './config';
Expand All @@ -19,11 +19,7 @@ export function renderServer(config: ConfigService) {

Sentry.init({
dsn: process.env.SENTRY_DSN,
integrations: [
new Sentry.Integrations.Http({tracing: true}),
new Sentry.Integrations.Express({router: renderRoutes}),
new ProfilingIntegration(),
],
integrations: [nodeProfilingIntegration()],
profilesSampleRate: 1,
tracesSampleRate: 1,
_experiments: {
Expand All @@ -32,8 +28,6 @@ export function renderServer(config: ConfigService) {
});

renderRoutes.use(express.json({limit: '20mb'}));
renderRoutes.use(Sentry.Handlers.requestHandler());
renderRoutes.use(Sentry.Handlers.tracingHandler());
renderRoutes.use((req, resp) => {
if (!config.isLoaded) {
resp.status(503).send();
Expand Down Expand Up @@ -91,7 +85,6 @@ export function renderServer(config: ConfigService) {
Sentry.metrics.increment('render.count');
Sentry.metrics.distribution('render.time', time);
});
renderRoutes.use(Sentry.Handlers.errorHandler());

app.post('/render', renderRoutes);

Expand All @@ -105,5 +98,7 @@ export function renderServer(config: ConfigService) {
: resp.status(503).send('NOT CONFIGURED')
);

Sentry.setupExpressErrorHandler(app);

return app;
}
Loading

0 comments on commit 6a5c913

Please sign in to comment.