autoSchemaFile
breaks opentelemetry auto instrumentation for resolve
spans
#14049
Open
3 of 15 tasks
Labels
needs triage
This issue has not been looked into
Is there an existing issue for this?
Current behavior
Currently if
autoSchemaFile
is set and if the schema is passed as well in the configs for the factory, only the resolvers set using decorators and TypeScript classes to generate the corresponding GraphQL schema are instrumented. This happens because the wrapper functions from the autoinstrumentation library are executed before the merge of the schemas.Example:
The resolvers I have set on the schema only work when I remove the
autoSchemaFile
config.Minimum reproduction code
https://github.com/nestjs/nest/blob/master/sample/23-graphql-code-first/package.json
Steps to reproduce
autoSchemaFile
config is removed.Expected behavior
The instrumentation should only be invoked after the merge of the two schemas so all the resolve spans can be created.
Package
@nestjs/common
@nestjs/core
@nestjs/microservices
@nestjs/platform-express
@nestjs/platform-fastify
@nestjs/platform-socket.io
@nestjs/platform-ws
@nestjs/testing
@nestjs/websockets
Other package
@nestjs/graphql
NestJS version
10.3.10
Packages versions
@nestjs/graphql@npm:12.2.0
Node.js version
22.9.0
In which operating systems have you tested?
Other
No response
The text was updated successfully, but these errors were encountered: