Skip to content

Commit

Permalink
fix: Revert SDK bump
Browse files Browse the repository at this point in the history
Sentry master acceptance tests are failing.
  • Loading branch information
lforst committed Apr 23, 2024
1 parent 2d3ecb1 commit a83e890
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 773 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": "8.0.0-beta.3",
"@sentry/profiling-node": "8.0.0-beta.3",
"@sentry/node": "7.91.0",
"@sentry/profiling-node": "1.3.2",
"canvas": "^2.11.2",
"dotenv": "^8.2.0",
"echarts": "5.4.0",
Expand Down
13 changes: 1 addition & 12 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
#!/usr/bin/env node

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

Sentry.init({
dsn: process.env.SENTRY_DSN,
integrations: [nodeProfilingIntegration()],
profilesSampleRate: 1,
tracesSampleRate: 1,
_experiments: {
metricsAggregator: true,
},
});

import dotenv from 'dotenv';
import yargs from 'yargs';

Expand All @@ -23,6 +11,7 @@ import {renderStream} from './renderStream';
import {PollingConfig} from './types';

dotenv.config();
Sentry.init({dsn: process.env.SENTRY_DSN});

const defaultPollingConfig: PollingConfig = {
/**
Expand Down
20 changes: 18 additions & 2 deletions src/renderServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import {performance} from 'node:perf_hooks';

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

import {ConfigService} from './config';
Expand All @@ -16,7 +17,23 @@ export function renderServer(config: ConfigService) {
const app = express();
const renderRoutes = express.Router();

Sentry.init({
dsn: process.env.SENTRY_DSN,
integrations: [
new Sentry.Integrations.Http({tracing: true}),
new Sentry.Integrations.Express({router: renderRoutes}),
new ProfilingIntegration(),
],
profilesSampleRate: 1,
tracesSampleRate: 1,
_experiments: {
metricsAggregator: true,
},
});

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 @@ -74,6 +91,7 @@ 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 @@ -87,7 +105,5 @@ export function renderServer(config: ConfigService) {
: resp.status(503).send('NOT CONFIGURED')
);

Sentry.setupExpressErrorHandler(app);

return app;
}
Loading

0 comments on commit a83e890

Please sign in to comment.