Skip to content

Commit 84e1a6b

Browse files
authored
docs(graphql-instrumentation): add documentation for ignoreResolveSpans (#1912)
1 parent 497a3c3 commit 84e1a6b

File tree

1 file changed

+9
-0
lines changed
  • plugins/node/opentelemetry-instrumentation-graphql

1 file changed

+9
-0
lines changed

plugins/node/opentelemetry-instrumentation-graphql/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ registerInstrumentations({
4343
// depth: 2,
4444
// mergeItems: true,
4545
// ignoreTrivialResolveSpans: true,
46+
// ignoreResolveSpans: true,
4647
}),
4748
],
4849
});
@@ -57,6 +58,7 @@ registerInstrumentations({
5758
| depth | number | -1 | The maximum depth of fields/resolvers to instrument. When set to 0 it will not instrument fields and resolvers. When set to -1 it will instrument all fields and resolvers. | |
5859
| allowValues | boolean | false | When set to true it will not remove attributes values from schema source. By default all values that can be sensitive are removed and replaced with "*" | |
5960
| ignoreTrivialResolveSpans | boolean | false | Don't create spans for the execution of the default resolver on object properties. |
61+
| ignoreResolveSpans | boolean | false | Don't create spans for resolvers, regardless if they are trivial or not. |
6062
| responseHook | GraphQLInstrumentationExecutionResponseHook | undefined | Hook that allows adding custom span attributes based on the data returned from "execute" GraphQL action. | |
6163

6264
## Verbosity
@@ -73,6 +75,13 @@ They are all disabled by default. User can opt in to any combination of them to
7375

7476
When a resolver function is not defined on the schema for a field, graphql will use the default resolver which just looks for a property with that name on the object. If the property is not a function, it's not very interesting to trace.
7577

78+
### ignoreResolveSpans
79+
80+
The performance overhead for complex schemas with a lot of resolvers can be high due to the large number of spans created. When ignoreResolveSpans is set to true, no spans for resolvers will be created.
81+
82+
If you are using `@apollo/server` as your graphql server, you might want to
83+
enable this option because all resolvers are [currently considered non-trivial](https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1686).
84+
7685
### depth
7786

7887
The depth is the number of nesting levels of the field, and the following is a query with a depth of 3:

0 commit comments

Comments
 (0)