Skip to content

Commit 8d4208a

Browse files
committed
feat(graphql): Document useOperationNameForRootSpan
1 parent 4cbd202 commit 8d4208a

File tree

1 file changed

+12
-0
lines changed
  • docs/platforms/javascript/common/configuration/integrations

1 file changed

+12
-0
lines changed

docs/platforms/javascript/common/configuration/integrations/graphql.mdx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,15 @@ _Type: `boolean`_
5959
If spans for the execution of the default resolver on object properties should not be created. Default is `true`.
6060

6161
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. This option can reduce noise and number of spans created.
62+
63+
### `useOperationNameForRootSpan`
64+
65+
_Type: `boolean`_
66+
67+
By default, this option is `true`.
68+
69+
With this setting enabled, the GraphQL instrumentation dynamically updates the name of the `http.server` root span by appending
70+
the operation names. Instead of generic span names like `POST /graphql`, spans will be more descriptive, such as `POST /graphql (query MyQuery)`.
71+
For requests containing multiple operations, the span names will aggregate operation names, for example `POST /graphql (query Query1, query Query2)`
72+
73+
Set the option to `false` to preserve the default `http.server` span name without this additional context.

0 commit comments

Comments
 (0)