Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/tough-pumas-occur.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@envelop/sentry': minor
---

Support Sentry v9 and v10
2 changes: 0 additions & 2 deletions packages/plugins/sentry/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ yarn add @sentry/node @sentry/tracing @envelop/sentry
import { execute, parse, specifiedRules, subscribe, validate } from 'graphql'
import { envelop, useEngine } from '@envelop/core'
import { useSentry } from '@envelop/sentry'
// do this only once in you entry file.
import '@sentry/tracing'

const getEnveloped = envelop({
plugins: [
Expand Down
5 changes: 1 addition & 4 deletions packages/plugins/sentry/__tests__/sentry.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import { useSentry } from '@envelop/sentry';
import { assertSingleExecutionValue, createTestkit } from '@envelop/testing';
import { makeExecutableSchema } from '@graphql-tools/schema';
import * as Sentry from '@sentry/node';
import { Span } from '@sentry/types';
import '@sentry/tracing';

describe('sentry', () => {
test('report unexpected error', async () => {
Expand Down Expand Up @@ -260,8 +258,7 @@ describe('sentry', () => {
dsn: 'https://public@sentry.example.com/1',
transport: sentryTransport,
});

let activeSpan: Span | undefined;
let activeSpan: Sentry.Span | undefined;
const schema = makeExecutableSchema({
typeDefs: /* GraphQL */ `
type Query {
Expand Down
6 changes: 2 additions & 4 deletions packages/plugins/sentry/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
},
"peerDependencies": {
"@envelop/core": "workspace:^",
"@sentry/node": "^8.0.0",
"@sentry/node": "^8.0.0 || ^9.0.0 || ^10.0.0",
"graphql": "^14.0.0 || ^15.0.0 || ^16.0.0"
},
"dependencies": {
Expand All @@ -57,9 +57,7 @@
"devDependencies": {
"@envelop/core": "workspace:^",
"@graphql-tools/schema": "10.0.25",
"@sentry/node": "^8.22.0",
"@sentry/tracing": "^7.114.0",
"@sentry/types": "^8.22.0",
"@sentry/node": "^10.17.0",
"graphql": "16.8.1",
"sentry-testkit": "6.2.2",
"typescript": "5.9.3"
Expand Down
16 changes: 15 additions & 1 deletion packages/plugins/sentry/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,21 @@ import {
type Plugin,
} from '@envelop/core';
import * as Sentry from '@sentry/node';
import type { TraceparentData } from '@sentry/types';

interface TraceparentData {
/**
* Trace ID
*/
traceId?: string | undefined;
/**
* Parent Span ID
*/
parentSpanId?: string | undefined;
/**
* If this transaction has a parent, the parent's sampling decision
*/
parentSampled?: boolean | undefined;
}

export type SentryPluginOptions<PluginContext extends Record<string, any>> = {
/**
Expand Down
Loading