Skip to content

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

Merged
AbhiPrasad merged 6 commits into
developfrom
onur/apollo-nestjs-support
Feb 16, 2023
Merged

feat(tracing): Support Apollo/GraphQL with NestJS#7194
AbhiPrasad merged 6 commits into
developfrom
onur/apollo-nestjs-support

Conversation

@onurtemizkan

Copy link
Copy Markdown
Contributor

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

github-actionsBot commented Feb 16, 2023

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize
@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
Copy Markdown
Contributor

Replay SDK metrics 🚀

Plain+Sentry+Replay
RevisionValueValueDiffRatioValueDiffRatio
LCPThis PR 79babe972.40 ms93.06 ms+20.66 ms+28.54 %131.09 ms+58.69 ms+81.06 %
Previous 5359ba977.44 ms110.32 ms+32.88 ms+42.45 %133.06 ms+55.62 ms+71.81 %
CLSThis PR 79babe90.06 ms0.06 ms-0.00 ms-0.01 %0.06 ms-0.00 ms-0.45 %
Previous 5359ba90.06 ms0.06 ms-0.00 ms-0.11 %0.06 ms-0.00 ms-0.36 %
CPUThis PR 79babe913.12 %12.08 %-1.04 pp-7.92 %17.52 %+4.40 pp+33.50 %
Previous 5359ba916.86 %17.38 %+0.52 pp+3.10 %21.15 %+4.29 pp+25.48 %
JS heap avgThis PR 79babe91.94 MB1.99 MB+47 kB+2.42 %2.87 MB+927.46 kB+47.71 %
Previous 5359ba91.94 MB2 MB+63.6 kB+3.28 %2.87 MB+935.26 kB+48.28 %
JS heap maxThis PR 79babe92.3 MB2.56 MB+258.01 kB+11.20 %3.36 MB+1.06 MB+46.03 %
Previous 5359ba92.3 MB2.57 MB+270.06 kB+11.72 %3.36 MB+1.05 MB+45.76 %
netTxThis PR 79babe90 B0 B0 Bn/a2.23 kB+2.23 kBn/a
Previous 5359ba90 B0 B0 Bn/a2.2 kB+2.2 kBn/a
netRxThis PR 79babe90 B0 B0 Bn/a41 B+41 Bn/a
Previous 5359ba90 B0 B0 Bn/a41 B+41 Bn/a
netCountThis PR 79babe9000n/a1+1n/a
Previous 5359ba9000n/a1+1n/a
netTimeThis PR 79babe90.00 ms0.00 ms0.00 msn/a103.20 ms+103.20 msn/a
Previous 5359ba90.00 ms0.00 ms0.00 msn/a79.05 ms+79.05 msn/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 developFeb 16, 2023
@AbhiPrasad
AbhiPrasad deleted the onur/apollo-nestjs-support branch February 16, 2023 12:06
Sign up for freeto 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

@onurtemizkan@AbhiPrasad