File tree 1 file changed +13
-1
lines changed
packages/node/src/integrations/tracing
1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,8 @@ const INTEGRATION_NAME = 'Graphql';
40
40
export const instrumentGraphql = generateInstrumentOnce < GraphqlOptions > (
41
41
INTEGRATION_NAME ,
42
42
( _options : GraphqlOptions = { } ) => {
43
+ // We set default values here, which are used in the case that this is preloaded
44
+ // In that case, no options are passed in, and we want to use the defaults
43
45
const options = {
44
46
ignoreResolveSpans : true ,
45
47
ignoreTrivialResolveSpans : true ,
@@ -85,10 +87,20 @@ export const instrumentGraphql = generateInstrumentOnce<GraphqlOptions>(
85
87
} ,
86
88
) ;
87
89
88
- const _graphqlIntegration = ( ( options : GraphqlOptions = { } ) => {
90
+ const _graphqlIntegration = ( ( _options : GraphqlOptions = { } ) => {
89
91
return {
90
92
name : INTEGRATION_NAME ,
91
93
setupOnce ( ) {
94
+ // We set defaults here, too, because otherwise we'd update the instrumentation config
95
+ // to the config without defaults, as `generateInstrumentOnce` automatically calls `setConfig(options)`
96
+ // when being called the second time
97
+ const options = {
98
+ ignoreResolveSpans : true ,
99
+ ignoreTrivialResolveSpans : true ,
100
+ useOperationNameForRootSpan : true ,
101
+ ..._options ,
102
+ } ;
103
+
92
104
instrumentGraphql ( options ) ;
93
105
} ,
94
106
} ;
You can’t perform that action at this time.
0 commit comments