Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(tracing): Support Apollo/GraphQL with NestJS #7194

Merged
merged 6 commits into from Feb 16, 2023

Conversation

onurtemizkan
Copy link
Collaborator

Resolves: #5808
Ref: #5808 (comment)

NestJS provides a pre-constructed GraphQL schema to Apollo server.
Since we create spans on resolver level, and can't access resolvers from Apollo schemas, we need to monkey-patch the schema creation / resolver exploration utilites from NestJS.

This PR adds the same resolver-level support to NestJS-created GraphQL schemas, when Apollo integration is initialized with new Apollo({ nestjs: true }).

The default behaviour hasn't changed.

Sample event: Link

@onurtemizkan onurtemizkan marked this pull request as ready for review February 15, 2023 13:58
@github-actions
Copy link
Contributor

github-actions bot commented Feb 16, 2023

size-limit report 📦

Path Size
@sentry/browser - ES5 CDN Bundle (gzipped + minified) 20.05 KB (0%)
@sentry/browser - ES5 CDN Bundle (minified) 62.14 KB (0%)
@sentry/browser - ES6 CDN Bundle (gzipped + minified) 18.68 KB (0%)
@sentry/browser - ES6 CDN Bundle (minified) 55.28 KB (0%)
@sentry/browser - Webpack (gzipped + minified) 20.41 KB (0%)
@sentry/browser - Webpack (minified) 66.73 KB (0%)
@sentry/react - Webpack (gzipped + minified) 20.44 KB (0%)
@sentry/nextjs Client - Webpack (gzipped + minified) 47.78 KB (0%)
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) 26.93 KB (+0.01% 🔺)
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified) 25.2 KB (0%)
@sentry/replay ES6 CDN Bundle (gzipped + minified) 42.52 KB (+0.01% 🔺)
@sentry/replay - Webpack (gzipped + minified) 36.72 KB (0%)
@sentry/browser + @sentry/tracing + @sentry/replay - ES6 CDN Bundle (gzipped + minified) 60.14 KB (+0.01% 🔺)
@sentry/browser + @sentry/replay - ES6 CDN Bundle (gzipped + minified) 53.75 KB (0%)

@github-actions
Copy link
Contributor

Replay SDK metrics 🚀

    Plain +Sentry +Replay
Revision Value Value Diff Ratio Value Diff Ratio
LCP This PR 79babe9 72.40 ms 93.06 ms +20.66 ms +28.54 % 131.09 ms +58.69 ms +81.06 %
Previous 5359ba9 77.44 ms 110.32 ms +32.88 ms +42.45 % 133.06 ms +55.62 ms +71.81 %
CLS This PR 79babe9 0.06 ms 0.06 ms -0.00 ms -0.01 % 0.06 ms -0.00 ms -0.45 %
Previous 5359ba9 0.06 ms 0.06 ms -0.00 ms -0.11 % 0.06 ms -0.00 ms -0.36 %
CPU This PR 79babe9 13.12 % 12.08 % -1.04 pp -7.92 % 17.52 % +4.40 pp +33.50 %
Previous 5359ba9 16.86 % 17.38 % +0.52 pp +3.10 % 21.15 % +4.29 pp +25.48 %
JS heap avg This PR 79babe9 1.94 MB 1.99 MB +47 kB +2.42 % 2.87 MB +927.46 kB +47.71 %
Previous 5359ba9 1.94 MB 2 MB +63.6 kB +3.28 % 2.87 MB +935.26 kB +48.28 %
JS heap max This PR 79babe9 2.3 MB 2.56 MB +258.01 kB +11.20 % 3.36 MB +1.06 MB +46.03 %
Previous 5359ba9 2.3 MB 2.57 MB +270.06 kB +11.72 % 3.36 MB +1.05 MB +45.76 %
netTx This PR 79babe9 0 B 0 B 0 B n/a 2.23 kB +2.23 kB n/a
Previous 5359ba9 0 B 0 B 0 B n/a 2.2 kB +2.2 kB n/a
netRx This PR 79babe9 0 B 0 B 0 B n/a 41 B +41 B n/a
Previous 5359ba9 0 B 0 B 0 B n/a 41 B +41 B n/a
netCount This PR 79babe9 0 0 0 n/a 1 +1 n/a
Previous 5359ba9 0 0 0 n/a 1 +1 n/a
netTime This PR 79babe9 0.00 ms 0.00 ms 0.00 ms n/a 103.20 ms +103.20 ms n/a
Previous 5359ba9 0.00 ms 0.00 ms 0.00 ms n/a 79.05 ms +79.05 ms n/a

Previous results on branch: develop

RevisionLCPCLSCPUJS heap avgJS heap maxnetTxnetRxnetCountnetTime
5359ba9+55.62 ms-0.00 ms+4.29 pp+935.26 kB+1.05 MB+2.2 kB+41 B+1+79.05 ms

*) pp - percentage points - an absolute difference between two percentages.
Last updated: Thu, 16 Feb 2023 11:40:29 GMT

@AbhiPrasad AbhiPrasad merged commit a8449de into develop Feb 16, 2023
@AbhiPrasad AbhiPrasad deleted the onur/apollo-nestjs-support branch February 16, 2023 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Apollo performance tracing not working with nestjs graphql
2 participants