Skip to content

Commit 8487150

Browse files
s1gr1dcoolguyzone
andauthored
feat(graphql): Document useOperationNameForRootSpan (#12124)
* feat(graphql): Document `useOperationNameForRootSpan` * Update docs/platforms/javascript/common/configuration/integrations/graphql.mdx Co-authored-by: Alex Krawiec <alex.krawiec@sentry.io> --------- Co-authored-by: Alex Krawiec <alex.krawiec@sentry.io>
1 parent 5f28814 commit 8487150

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
@@ -60,3 +60,15 @@ _Type: `boolean`_
6060
If spans for the execution of the default resolver on object properties should not be created. Default is `true`.
6161

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

0 commit comments

Comments
 (0)