I’m running an Apollo v4 server with @opentelemetry/instrumentation-graphql
registered from the following initialisation:
new GraphQLInstrumentation({
ignoreTrivialResolveSpans: true
})
I then do a simple query for a single instance of a type with 4 requested fields, one of which is __typename
, one of which has a non-default resolver and the remaining two have no explicitly assigned resolver.
Regardless of the setting of ignoreTrivialResolveSpans
above, I always see 3 field-level graphql.resolve
spans in my exported trace; the one for __typename
is never present, but both non-default and defaulted resolved fields generate spans. My understanding was that fields for which I had not defined a resolver should not generate spans if ignoreTrivialResolveSpans
is set true.
Has anyone managed to use this flag with Apollo Server v4 to suppress default resolve spans? Could calling makeExecutableSchema
be adding “non-default” wrappers to my resolver functions and effectively rendering this flag useless?
(note that setting the depth
option of GraphQLInstrumentation to 0
does work, but I would prefer a solution where it was possible to generate spans for “interesting” resolvers)