Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(graphql): Document useOperationNameForRootSpan #12124

Merged
merged 2 commits into from
Dec 30, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,15 @@ _Type: `boolean`_
If spans for the execution of the default resolver on object properties should not be created. Default is `true`.

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.

### `useOperationNameForRootSpan`

_Type: `boolean`_

By default, this option is `true`.

With this setting enabled, the GraphQL instrumentation dynamically updates the name of the `http.server` root span by appending
the operation names. Instead of generic span names like `POST /graphql`, spans will be more descriptive, such as `POST /graphql (query MyQuery)`.
s1gr1d marked this conversation as resolved.
Show resolved Hide resolved
For requests containing multiple operations, the span names will aggregate operation names, for example `POST /graphql (query Query1, query Query2)`

Set the option to `false` to preserve the default `http.server` span name without this additional context.
Loading