diff --git a/dev-packages/deno-integration-tests/suites/orchestrion-graphql/test.ts b/dev-packages/deno-integration-tests/suites/orchestrion-graphql/test.ts
new file mode 100644
index 000000000000..c6ce701e37ba
--- /dev/null
+++ b/dev-packages/deno-integration-tests/suites/orchestrion-graphql/test.ts
@@ -0,0 +1,107 @@
+//
+
+import { tracingChannel } from 'node:diagnostics_channel';
+import type { TransactionEvent } from '@sentry/core';
+import type { DenoClient } from '@sentry/deno';
+import { getCurrentScope, getGlobalScope, getIsolationScope, init, startSpan } from '@sentry/deno';
+import { assert } from 'https://deno.land/std@0.212.0/assert/assert.ts';
+import { assertEquals } from 'https://deno.land/std@0.212.0/assert/assert_equals.ts';
+import { assertExists } from 'https://deno.land/std@0.212.0/assert/assert_exists.ts';
+
+function resetGlobals(): void {
+ getCurrentScope().clear();
+ getCurrentScope().setClient(undefined);
+ getIsolationScope().clear();
+ getGlobalScope().clear();
+}
+
+/** See deno-redis.test.ts — same sink shape, deduped for clarity. */
+function transactionSink(): {
+ beforeSendTransaction: (event: TransactionEvent) => null;
+ waitFor: (predicate: (event: TransactionEvent) => boolean) => Promise;
+} {
+ const transactions: TransactionEvent[] = [];
+ const waiters: { predicate: (e: TransactionEvent) => boolean; resolve: (e: TransactionEvent) => void }[] = [];
+ return {
+ beforeSendTransaction(event) {
+ transactions.push(event);
+ for (let i = waiters.length - 1; i >= 0; i--) {
+ const w = waiters[i]!;
+ if (w.predicate(event)) {
+ waiters.splice(i, 1);
+ w.resolve(event);
+ }
+ }
+ return null;
+ },
+ waitFor(predicate) {
+ const already = transactions.find(predicate);
+ if (already) return Promise.resolve(already);
+ return new Promise(resolve => {
+ waiters.push({ predicate, resolve });
+ });
+ },
+ };
+}
+
+function withTimeout(p: Promise, ms: number, what: string): Promise {
+ let timer: ReturnType | undefined;
+ const timeout = new Promise((_, reject) => {
+ timer = setTimeout(() => reject(new Error(`Timed out waiting for ${what} after ${ms}ms`)), ms);
+ });
+ return Promise.race([p, timeout]).finally(() => {
+ if (timer !== undefined) clearTimeout(timer);
+ });
+}
+
+// Drives one graphql parse channel and asserts the resulting nested span. The
+// composed integration subscribes to both the orchestrion channel (graphql
+// v14–16) and graphql v17's native `graphql:parse` channel; both emit the same
+// `graphql.parse` span, so exercising each channel proves that half is wired.
+async function assertParseSpan(channelName: string): Promise {
+ resetGlobals();
+ const sink = transactionSink();
+ init({
+ dsn: 'https://username@domain/123',
+ tracesSampleRate: 1,
+ beforeSendTransaction: sink.beforeSendTransaction,
+ });
+
+ const channel = tracingChannel(channelName);
+ const ctx = { arguments: [] };
+
+ startSpan({ name: 'parent', op: 'test' }, () => {
+ channel.start.runStores(ctx, () => {
+ channel.end.publish(ctx);
+ });
+ channel.asyncStart.runStores(ctx, () => {
+ channel.asyncEnd.publish(ctx);
+ });
+ });
+
+ const parent = await withTimeout(
+ sink.waitFor(t => t.transaction === 'parent'),
+ 5000,
+ "'parent' transaction",
+ );
+
+ const parseSpan = parent.spans?.find(s => s.description === 'graphql.parse');
+ assertExists(parseSpan, `expected a graphql.parse span, got: ${parent.spans?.map(s => s.description).join(', ')}`);
+ assertEquals(parseSpan!.op, 'graphql');
+ assertEquals(parseSpan!.data?.['sentry.origin'], 'auto.graphql.diagnostic_channel');
+}
+
+Deno.test('graphql instrumentation: included in default integrations (Deno 2.8.0+)', () => {
+ resetGlobals();
+ const client = init({ dsn: 'https://username@domain/123' }) as DenoClient;
+ const names = client.getOptions().integrations.map(i => i.name);
+ assert(names.includes('Graphql'), `Graphql should be in defaults, got ${names.join(', ')}`);
+});
+
+Deno.test('graphql instrumentation: orchestrion:graphql:parse channel produces a nested span (v14–16)', async () => {
+ await assertParseSpan('orchestrion:graphql:parse');
+});
+
+Deno.test('graphql instrumentation: native graphql:parse channel produces a nested span (v17)', async () => {
+ await assertParseSpan('graphql:parse');
+});
diff --git a/packages/deno/src/index.ts b/packages/deno/src/index.ts
index 3bd9cca9fbbc..cc9f64607158 100644
--- a/packages/deno/src/index.ts
+++ b/packages/deno/src/index.ts
@@ -120,6 +120,7 @@ export {
dataloaderChannelIntegration,
expressChannelIntegration,
genericPoolChannelIntegration,
+ graphqlDiagnosticsChannelIntegration,
hapiChannelIntegration,
kafkajsChannelIntegration,
knexChannelIntegration,
diff --git a/packages/deno/src/sdk.ts b/packages/deno/src/sdk.ts
index 8672aaee0dc1..d4dd9ab50b7a 100644
--- a/packages/deno/src/sdk.ts
+++ b/packages/deno/src/sdk.ts
@@ -15,6 +15,7 @@ import {
amqplibChannelIntegration,
expressChannelIntegration,
genericPoolChannelIntegration,
+ graphqlDiagnosticsChannelIntegration,
hapiChannelIntegration,
kafkajsChannelIntegration,
koaChannelIntegration,
@@ -70,6 +71,11 @@ export function getDefaultIntegrations(_options: Options): Integration[] {
: []),
// node:diagnostics_channel.tracingChannel exists on Deno 1.44.3+.
...(TRACING_CHANNEL_SUPPORTED ? [denoRedisIntegration()] : []),
+ // graphql is gated on tracingChannel rather than the module hook: the
+ // composed integration also subscribes to graphql v17's native diagnostics
+ // channels, which need only tracingChannel. The orchestrion implementation
+ // (graphql v14–16) stays inert until the runtime hook injects those channels.
+ ...(TRACING_CHANNEL_SUPPORTED ? [graphqlDiagnosticsChannelIntegration()] : []),
// orchestrion-based instrumentations. We add a deliberate list here rather
// than every channel integration: each one needs a Deno test proving it
// records spans.
diff --git a/packages/deno/test/__snapshots__/mod.test.ts.snap b/packages/deno/test/__snapshots__/mod.test.ts.snap
index 8a7e56e1fb33..e42efbeef8d3 100644
--- a/packages/deno/test/__snapshots__/mod.test.ts.snap
+++ b/packages/deno/test/__snapshots__/mod.test.ts.snap
@@ -115,6 +115,7 @@ snapshot[`captureException 1`] = `
"DenoServe",
"DenoHttp",
"DenoRedis",
+ "Graphql",
"Amqplib",
"Express",
"GenericPool",
@@ -204,6 +205,7 @@ snapshot[`captureMessage 1`] = `
"DenoServe",
"DenoHttp",
"DenoRedis",
+ "Graphql",
"Amqplib",
"Express",
"GenericPool",
@@ -300,6 +302,7 @@ snapshot[`captureMessage twice 1`] = `
"DenoServe",
"DenoHttp",
"DenoRedis",
+ "Graphql",
"Amqplib",
"Express",
"GenericPool",
@@ -403,6 +406,7 @@ snapshot[`captureMessage twice 2`] = `
"DenoServe",
"DenoHttp",
"DenoRedis",
+ "Graphql",
"Amqplib",
"Express",
"GenericPool",
diff --git a/packages/server-utils/src/orchestrion/index.ts b/packages/server-utils/src/orchestrion/index.ts
index b27f74b9b28d..2d6d4f4e5abf 100644
--- a/packages/server-utils/src/orchestrion/index.ts
+++ b/packages/server-utils/src/orchestrion/index.ts
@@ -47,6 +47,7 @@ export {
genericPoolChannelIntegration,
googleGenAIChannelIntegration,
graphqlChannelIntegration,
+ graphqlDiagnosticsChannelIntegration,
hapiChannelIntegration,
koaChannelIntegration,
ioredisChannelIntegration,