From 8d4208a5a0dbb85261461a5d71deb9f32bc25c42 Mon Sep 17 00:00:00 2001 From: s1gr1d Date: Fri, 13 Dec 2024 11:20:17 +0100 Subject: [PATCH 1/2] feat(graphql): Document `useOperationNameForRootSpan` --- .../common/configuration/integrations/graphql.mdx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/platforms/javascript/common/configuration/integrations/graphql.mdx b/docs/platforms/javascript/common/configuration/integrations/graphql.mdx index 38183a260664b7..c1f0ac192446c4 100644 --- a/docs/platforms/javascript/common/configuration/integrations/graphql.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/graphql.mdx @@ -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)`. +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. From 0efdaff05e2ee7a1f7a929866685df77c5340a15 Mon Sep 17 00:00:00 2001 From: Sigrid Huemer <32902192+s1gr1d@users.noreply.github.com> Date: Fri, 20 Dec 2024 15:36:00 +0100 Subject: [PATCH 2/2] Update docs/platforms/javascript/common/configuration/integrations/graphql.mdx Co-authored-by: Alex Krawiec --- .../javascript/common/configuration/integrations/graphql.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/platforms/javascript/common/configuration/integrations/graphql.mdx b/docs/platforms/javascript/common/configuration/integrations/graphql.mdx index c1f0ac192446c4..8c2c3d31e08f9b 100644 --- a/docs/platforms/javascript/common/configuration/integrations/graphql.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/graphql.mdx @@ -67,7 +67,7 @@ _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)`. +the operation names. Instead of generic span names like `POST /graphql`, span names will be more descriptive, such as `POST /graphql (query MyQuery)`. 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.