Skip to content

Commit 6635305

Browse files
committed
Update Sentry and wait for 4.78.0
Waiting for getsentry/sentry-docs#6641
1 parent 66fec76 commit 6635305

File tree

17 files changed

+120
-169
lines changed

17 files changed

+120
-169
lines changed

packages/services/api/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
"@aws-sdk/s3-request-presigner": "3.312.0",
1717
"@graphql-inspector/core": "4.0.3",
1818
"@octokit/app": "13.1.2",
19-
"@sentry/node": "7.44.2",
20-
"@sentry/types": "7.44.2",
19+
"@sentry/node": "7.47.0",
20+
"@sentry/types": "7.47.0",
2121
"@slack/web-api": "6.8.1",
2222
"@theguild/buddy": "0.1.0",
2323
"@trpc/client": "10.20.0",

packages/services/emails/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"typecheck": "tsc --noEmit"
1212
},
1313
"dependencies": {
14-
"@sentry/node": "7.44.2",
14+
"@sentry/node": "7.47.0",
1515
"@trpc/server": "10.20.0",
1616
"@whatwg-node/fetch": "0.8.5",
1717
"bullmq": "3.10.4",

packages/services/rate-limit/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111
"typecheck": "tsc --noEmit"
1212
},
1313
"dependencies": {
14-
"@sentry/node": "7.44.2",
15-
"@sentry/tracing": "7.44.2",
14+
"@sentry/node": "7.47.0",
1615
"@trpc/client": "10.20.0",
1716
"@trpc/server": "10.20.0",
1817
"@whatwg-node/fetch": "0.8.5",

packages/services/schema/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
"@apollo/federation": "0.38.1",
1414
"@graphql-tools/stitch": "8.7.48",
1515
"@graphql-tools/stitching-directives": "2.3.34",
16-
"@sentry/node": "7.44.2",
17-
"@sentry/tracing": "7.44.2",
16+
"@sentry/node": "7.47.0",
1817
"@trpc/server": "10.20.0",
1918
"@whatwg-node/fetch": "0.8.5",
2019
"dotenv": "16.0.3",

packages/services/server/.env.template

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
ENVIRONMENT=local
12
LOG_LEVEL=debug
23
POSTGRES_USER=postgres
34
POSTGRES_PASSWORD=postgres

packages/services/server/package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@
1919
"@escape.tech/graphql-armor-max-depth": "1.8.4",
2020
"@escape.tech/graphql-armor-max-directives": "1.6.5",
2121
"@escape.tech/graphql-armor-max-tokens": "1.3.2",
22-
"@sentry/integrations": "7.44.2",
23-
"@sentry/node": "7.44.2",
24-
"@sentry/tracing": "7.44.2",
22+
"@sentry/integrations": "7.47.0",
23+
"@sentry/node": "7.47.0",
2524
"@trpc/server": "10.20.0",
2625
"@whatwg-node/fetch": "0.8.5",
2726
"@whatwg-node/server": "0.7.5",

packages/services/service-common/package.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
"private": true,
77
"peerDependencies": {
88
"@sentry/node": "^7.0.0",
9-
"@sentry/tracing": "^7.0.0",
109
"@sentry/utils": "^7.0.0",
1110
"@trpc/server": "10.20.0"
1211
},
@@ -19,9 +18,8 @@
1918
"zod": "3.21.4"
2019
},
2120
"devDependencies": {
22-
"@sentry/node": "7.44.2",
23-
"@sentry/tracing": "7.44.2",
24-
"@sentry/types": "7.44.2",
25-
"@sentry/utils": "7.44.2"
21+
"@sentry/node": "7.47.0",
22+
"@sentry/types": "7.47.0",
23+
"@sentry/utils": "7.47.0"
2624
}
2725
}

packages/services/service-common/src/sentry.ts

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
import type { FastifyInstance, FastifyPluginAsync, FastifyRequest } from 'fastify';
22
import fp from 'fastify-plugin';
33
import * as Sentry from '@sentry/node';
4-
import '@sentry/tracing';
5-
import { Transaction } from '@sentry/tracing';
6-
import type { ExtractedNodeRequestData, TraceparentData } from '@sentry/types';
4+
import type { ExtractedNodeRequestData, TraceparentData, Transaction } from '@sentry/types';
75
import { extractTraceparentData, normalize } from '@sentry/utils';
86
import { cleanRequestId } from './helpers';
97

108
const plugin: FastifyPluginAsync = async server => {
11-
server.decorateRequest('sentryTransaction', null);
9+
server.decorateReply('sentryTransaction', null);
1210

1311
function shouldIgnore(request: FastifyRequest) {
1412
if (
@@ -22,7 +20,7 @@ const plugin: FastifyPluginAsync = async server => {
2220
return false;
2321
}
2422

25-
server.addHook('onRequest', async request => {
23+
server.addHook('onRequest', async (request, reply) => {
2624
if (shouldIgnore(request)) {
2725
return;
2826
}
@@ -53,11 +51,10 @@ const plugin: FastifyPluginAsync = async server => {
5351
},
5452
{ request: extractedRequestData },
5553
);
56-
(request as any).sentryTransaction = transaction;
54+
(reply as any).sentryTransaction = transaction;
55+
transaction.sampled = true;
5756

58-
Sentry.getCurrentHub().configureScope(scope => {
59-
scope.setSpan(transaction);
60-
});
57+
Sentry.configureScope(scope => scope.setSpan(transaction));
6158

6259
return;
6360
});
@@ -68,7 +65,7 @@ const plugin: FastifyPluginAsync = async server => {
6865
}
6966

7067
setImmediate(() => {
71-
const transaction: Transaction = (request as any).sentryTransaction;
68+
const transaction: Transaction = (reply as any).sentryTransaction;
7269

7370
transaction.setData('url', request.url);
7471
transaction.setData('query', request.query);

packages/services/storage/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"db:generate": "schemats generate --config schemats.cjs -o src/db/types.ts"
1313
},
1414
"dependencies": {
15-
"@sentry/node": "7.44.2",
15+
"@sentry/node": "7.47.0",
1616
"@theguild/buddy": "0.1.0",
1717
"dotenv": "16.0.3",
1818
"got": "12.6.0",
@@ -23,7 +23,7 @@
2323
"zod": "3.21.4"
2424
},
2525
"devDependencies": {
26-
"@sentry/types": "7.44.2",
26+
"@sentry/types": "7.47.0",
2727
"@tgriesser/schemats": "9.0.1",
2828
"@types/node": "18.15.11",
2929
"@types/pg": "8.6.6",

packages/services/stripe-billing/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111
"typecheck": "tsc --noEmit"
1212
},
1313
"dependencies": {
14-
"@sentry/node": "7.44.2",
15-
"@sentry/tracing": "7.44.2",
14+
"@sentry/node": "7.47.0",
1615
"@trpc/client": "10.20.0",
1716
"@trpc/server": "10.20.0",
1817
"@whatwg-node/fetch": "0.8.5",

0 commit comments

Comments
 (0)