Skip to content

Commit 262e761

Browse files
thomasleducardatan
andauthored
chore(deps): support sentry v10 (#2715)
* chore(deps): sentry: Update sentry to ^10.17 * chore(deps): Add Changesets * Support * No need for @sentry/core --------- Co-authored-by: Arda TANRIKULU <[email protected]>
1 parent 8880627 commit 262e761

File tree

6 files changed

+298
-343
lines changed

6 files changed

+298
-343
lines changed

.changeset/tough-pumas-occur.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@envelop/sentry': minor
3+
---
4+
5+
Support Sentry v9 and v10

packages/plugins/sentry/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ yarn add @sentry/node @sentry/tracing @envelop/sentry
3737
import { execute, parse, specifiedRules, subscribe, validate } from 'graphql'
3838
import { envelop, useEngine } from '@envelop/core'
3939
import { useSentry } from '@envelop/sentry'
40-
// do this only once in you entry file.
41-
import '@sentry/tracing'
4240

4341
const getEnveloped = envelop({
4442
plugins: [

packages/plugins/sentry/__tests__/sentry.spec.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ import { useSentry } from '@envelop/sentry';
55
import { assertSingleExecutionValue, createTestkit } from '@envelop/testing';
66
import { makeExecutableSchema } from '@graphql-tools/schema';
77
import * as Sentry from '@sentry/node';
8-
import { Span } from '@sentry/types';
9-
import '@sentry/tracing';
108

119
describe('sentry', () => {
1210
test('report unexpected error', async () => {
@@ -260,8 +258,7 @@ describe('sentry', () => {
260258
dsn: 'https://[email protected]/1',
261259
transport: sentryTransport,
262260
});
263-
264-
let activeSpan: Span | undefined;
261+
let activeSpan: Sentry.Span | undefined;
265262
const schema = makeExecutableSchema({
266263
typeDefs: /* GraphQL */ `
267264
type Query {

packages/plugins/sentry/package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
},
4949
"peerDependencies": {
5050
"@envelop/core": "workspace:^",
51-
"@sentry/node": "^8.0.0",
51+
"@sentry/node": "^8.0.0 || ^9.0.0 || ^10.0.0",
5252
"graphql": "^14.0.0 || ^15.0.0 || ^16.0.0"
5353
},
5454
"dependencies": {
@@ -57,9 +57,7 @@
5757
"devDependencies": {
5858
"@envelop/core": "workspace:^",
5959
"@graphql-tools/schema": "10.0.25",
60-
"@sentry/node": "^8.22.0",
61-
"@sentry/tracing": "^7.114.0",
62-
"@sentry/types": "^8.22.0",
60+
"@sentry/node": "^10.17.0",
6361
"graphql": "16.8.1",
6462
"sentry-testkit": "6.2.2",
6563
"typescript": "5.9.3"

packages/plugins/sentry/src/index.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,21 @@ import {
88
type Plugin,
99
} from '@envelop/core';
1010
import * as Sentry from '@sentry/node';
11-
import type { TraceparentData } from '@sentry/types';
11+
12+
interface TraceparentData {
13+
/**
14+
* Trace ID
15+
*/
16+
traceId?: string | undefined;
17+
/**
18+
* Parent Span ID
19+
*/
20+
parentSpanId?: string | undefined;
21+
/**
22+
* If this transaction has a parent, the parent's sampling decision
23+
*/
24+
parentSampled?: boolean | undefined;
25+
}
1226

1327
export type SentryPluginOptions<PluginContext extends Record<string, any>> = {
1428
/**

0 commit comments

Comments
 (0)