@@ -50,7 +50,7 @@ groups:
50
50
**Span name** SHOULD be `GraphQL Document Parsing`.
51
51
52
52
This span covers the parsing phase of GraphQL request processing,
53
- where the document string is parsed into an abstract syntax tree.
53
+ where the document string is parsed into an abstract syntax tree (AST) .
54
54
attributes :
55
55
- ref : graphql.operation.type
56
56
requirement_level : required
@@ -140,6 +140,27 @@ groups:
140
140
This span covers the execution of an individual field resolver,
141
141
including both synchronous and asynchronous resolvers.
142
142
The span ends when the resolver result is available.
143
+
144
+ > **Warning**
145
+ > Creating spans for every resolver execution can result in traces with
146
+ > hundreds or thousands of spans, severely impacting performance and
147
+ > trace readability. Instrumentations MUST NOT create resolver execution
148
+ > spans by default for all resolvers.
149
+
150
+ Instrumentations SHOULD provide configuration options to control which
151
+ resolvers generate spans. Recommended strategies include:
152
+
153
+ - **Manual selection**: Allow developers to explicitly mark specific
154
+ resolvers for tracing (e.g., via annotations, decorators, or configuration)
155
+ - **Asynchronous resolvers only**: Only trace resolvers that return
156
+ promises or other asynchronous constructs
157
+ - **Depth-based filtering**: Only trace resolvers at the top N levels
158
+ of the query (e.g., top 2 levels)
159
+ - **Performance-based filtering**: Only trace resolvers that exceed
160
+ a certain execution time threshold
161
+
162
+ The selection criteria SHOULD be documented clearly for users to
163
+ understand which resolvers will generate spans.
143
164
attributes :
144
165
- ref : graphql.selection.name
145
166
requirement_level : recommended
0 commit comments