Skip to content

Commit

Permalink
Update Sentry and wait for 4.78.0
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilkisiela committed Apr 13, 2023
1 parent a9774f6 commit 7a8673a
Show file tree
Hide file tree
Showing 17 changed files with 120 additions and 169 deletions.
4 changes: 2 additions & 2 deletions packages/services/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"@aws-sdk/s3-request-presigner": "3.309.0",
"@graphql-inspector/core": "4.0.2",
"@octokit/app": "13.1.2",
"@sentry/node": "7.44.2",
"@sentry/types": "7.44.2",
"@sentry/node": "7.47.0",
"@sentry/types": "7.47.0",
"@slack/web-api": "6.8.1",
"@theguild/buddy": "0.1.0",
"@trpc/client": "10.19.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/services/emails/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@sentry/node": "7.44.2",
"@sentry/node": "7.47.0",
"@trpc/server": "10.19.1",
"@whatwg-node/fetch": "0.8.4",
"bullmq": "3.10.4",
Expand Down
3 changes: 1 addition & 2 deletions packages/services/rate-limit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@sentry/node": "7.44.2",
"@sentry/tracing": "7.44.2",
"@sentry/node": "7.47.0",
"@trpc/client": "10.19.1",
"@trpc/server": "10.19.1",
"@whatwg-node/fetch": "0.8.4",
Expand Down
3 changes: 1 addition & 2 deletions packages/services/schema/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
"@apollo/federation": "0.38.1",
"@graphql-tools/stitch": "8.7.47",
"@graphql-tools/stitching-directives": "2.3.33",
"@sentry/node": "7.44.2",
"@sentry/tracing": "7.44.2",
"@sentry/node": "7.47.0",
"@trpc/server": "10.19.1",
"@whatwg-node/fetch": "0.8.4",
"dotenv": "16.0.3",
Expand Down
1 change: 1 addition & 0 deletions packages/services/server/.env.template
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
ENVIRONMENT=local
LOG_LEVEL=debug
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
Expand Down
5 changes: 2 additions & 3 deletions packages/services/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@
"@escape.tech/graphql-armor-max-depth": "1.8.4",
"@escape.tech/graphql-armor-max-directives": "1.6.5",
"@escape.tech/graphql-armor-max-tokens": "1.3.2",
"@sentry/integrations": "7.44.2",
"@sentry/node": "7.44.2",
"@sentry/tracing": "7.44.2",
"@sentry/integrations": "7.47.0",
"@sentry/node": "7.47.0",
"@trpc/server": "10.19.1",
"@whatwg-node/fetch": "0.8.4",
"@whatwg-node/server": "0.7.5",
Expand Down
8 changes: 3 additions & 5 deletions packages/services/service-common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"private": true,
"peerDependencies": {
"@sentry/node": "^7.0.0",
"@sentry/tracing": "^7.0.0",
"@sentry/utils": "^7.0.0",
"@trpc/server": "10.19.1"
},
Expand All @@ -19,9 +18,8 @@
"zod": "3.21.4"
},
"devDependencies": {
"@sentry/node": "7.44.2",
"@sentry/tracing": "7.44.2",
"@sentry/types": "7.44.2",
"@sentry/utils": "7.44.2"
"@sentry/node": "7.47.0",
"@sentry/types": "7.47.0",
"@sentry/utils": "7.47.0"
}
}
17 changes: 7 additions & 10 deletions packages/services/service-common/src/sentry.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import type { FastifyInstance, FastifyPluginAsync, FastifyRequest } from 'fastify';
import fp from 'fastify-plugin';
import * as Sentry from '@sentry/node';
import '@sentry/tracing';
import { Transaction } from '@sentry/tracing';
import type { ExtractedNodeRequestData, TraceparentData } from '@sentry/types';
import type { ExtractedNodeRequestData, TraceparentData, Transaction } from '@sentry/types';
import { extractTraceparentData, normalize } from '@sentry/utils';
import { cleanRequestId } from './helpers';

const plugin: FastifyPluginAsync = async server => {
server.decorateRequest('sentryTransaction', null);
server.decorateReply('sentryTransaction', null);

function shouldIgnore(request: FastifyRequest) {
if (
Expand All @@ -22,7 +20,7 @@ const plugin: FastifyPluginAsync = async server => {
return false;
}

server.addHook('onRequest', async request => {
server.addHook('onRequest', async (request, reply) => {
if (shouldIgnore(request)) {
return;
}
Expand Down Expand Up @@ -53,11 +51,10 @@ const plugin: FastifyPluginAsync = async server => {
},
{ request: extractedRequestData },
);
(request as any).sentryTransaction = transaction;
(reply as any).sentryTransaction = transaction;
transaction.sampled = true;

Sentry.getCurrentHub().configureScope(scope => {
scope.setSpan(transaction);
});
Sentry.configureScope(scope => scope.setSpan(transaction));

return;
});
Expand All @@ -68,7 +65,7 @@ const plugin: FastifyPluginAsync = async server => {
}

setImmediate(() => {
const transaction: Transaction = (request as any).sentryTransaction;
const transaction: Transaction = (reply as any).sentryTransaction;

transaction.setData('url', request.url);
transaction.setData('query', request.query);
Expand Down
4 changes: 2 additions & 2 deletions packages/services/storage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"db:generate": "schemats generate --config schemats.cjs -o src/db/types.ts"
},
"dependencies": {
"@sentry/node": "7.44.2",
"@sentry/node": "7.47.0",
"@theguild/buddy": "0.1.0",
"dotenv": "16.0.3",
"got": "12.6.0",
Expand All @@ -23,7 +23,7 @@
"zod": "3.21.4"
},
"devDependencies": {
"@sentry/types": "7.44.2",
"@sentry/types": "7.47.0",
"@tgriesser/schemats": "9.0.1",
"@types/node": "18.15.11",
"@types/pg": "8.6.6",
Expand Down
3 changes: 1 addition & 2 deletions packages/services/stripe-billing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@sentry/node": "7.44.2",
"@sentry/tracing": "7.44.2",
"@sentry/node": "7.47.0",
"@trpc/client": "10.19.1",
"@trpc/server": "10.19.1",
"@whatwg-node/fetch": "0.8.4",
Expand Down
3 changes: 1 addition & 2 deletions packages/services/tokens/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@sentry/node": "7.44.2",
"@sentry/tracing": "7.44.2",
"@sentry/node": "7.47.0",
"@trpc/server": "10.19.1",
"dotenv": "16.0.3",
"ioredis": "5.3.1",
Expand Down
3 changes: 1 addition & 2 deletions packages/services/usage-estimator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@sentry/node": "7.44.2",
"@sentry/tracing": "7.44.2",
"@sentry/node": "7.47.0",
"@trpc/server": "10.19.1",
"@whatwg-node/fetch": "0.8.4",
"dotenv": "16.0.3",
Expand Down
3 changes: 1 addition & 2 deletions packages/services/usage-ingestor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@sentry/node": "7.44.2",
"@sentry/tracing": "7.44.2",
"@sentry/node": "7.47.0",
"agentkeepalive": "4.3.0",
"date-fns": "2.29.3",
"dotenv": "16.0.3",
Expand Down
3 changes: 1 addition & 2 deletions packages/services/usage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@sentry/node": "7.44.2",
"@sentry/tracing": "7.44.2",
"@sentry/node": "7.47.0",
"@trpc/client": "10.19.1",
"@trpc/server": "10.19.1",
"@whatwg-node/fetch": "0.8.4",
Expand Down
3 changes: 1 addition & 2 deletions packages/services/webhooks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@sentry/node": "7.44.2",
"@sentry/tracing": "7.44.2",
"@sentry/node": "7.47.0",
"@trpc/server": "10.19.1",
"bullmq": "3.10.4",
"dotenv": "16.0.3",
Expand Down
4 changes: 2 additions & 2 deletions packages/web/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
"@radix-ui/react-toggle-group": "1.0.3",
"@radix-ui/react-toolbar": "1.0.3",
"@radix-ui/react-tooltip": "1.0.5",
"@sentry/nextjs": "7.44.2",
"@sentry/types": "7.44.2",
"@sentry/nextjs": "7.47.0",
"@sentry/types": "7.47.0",
"@stripe/react-stripe-js": "2.1.0",
"@stripe/stripe-js": "1.52.0",
"@tanstack/react-table": "8.0.0-beta.8",
Expand Down
Loading

0 comments on commit 7a8673a

Please sign in to comment.