@@ -27,7 +27,7 @@ const constants = require('../tracing/constants');
27
27
* @property {boolean } [disableW3cTraceCorrelation]
28
28
* @property {KafkaTracingOptions } [kafka]
29
29
* @property {boolean } [allowRootExitSpan]
30
- * @property {Object } [ignoreEndpoints]
30
+ * @property {Object.<string, Array.<string>> } [ignoreEndpoints]
31
31
*/
32
32
33
33
/**
@@ -62,11 +62,6 @@ const constants = require('../tracing/constants');
62
62
* @property {number } [timeBetweenHealthcheckCalls]
63
63
*/
64
64
65
- /**
66
- * @typedef {Object } IgnoreEndpoints
67
- * @property {Object.<string, Array.<string>> } [endpoints]
68
- */
69
-
70
65
/**
71
66
* @typedef {Object } AgentConfig
72
67
* @property {AgentTracingConfig } [tracing]
@@ -231,7 +226,7 @@ function normalizeTracingConfig(config) {
231
226
normalizeDisableW3cTraceCorrelation ( config ) ;
232
227
normalizeTracingKafka ( config ) ;
233
228
normalizeAllowRootExitSpan ( config ) ;
234
- normalizeIgnoredEndpoints ( config ) ;
229
+ normalizeIgnoreEndpoints ( config ) ;
235
230
}
236
231
237
232
/**
@@ -691,15 +686,15 @@ function normalizeSingleValue(configValue, defaultValue, configPath, envVarKey)
691
686
/**
692
687
* @param {InstanaConfig } config
693
688
*/
694
- function normalizeIgnoredEndpoints ( config ) {
695
- if ( ! config . tracing . ignoreEndpoints ) {
689
+ function normalizeIgnoreEndpoints ( config ) {
690
+ if ( ! config . tracing ? .ignoreEndpoints ) {
696
691
config . tracing . ignoreEndpoints = { } ;
697
692
}
698
693
699
694
for ( const [ service , methods ] of Object . entries ( config . tracing . ignoreEndpoints ) ) {
700
695
const normalizedService = service . toLowerCase ( ) ;
701
696
if ( ! Array . isArray ( methods ) ) {
702
- console . warn (
697
+ logger . warn (
703
698
`Invalid configuration for ${ normalizedService } : ignoredEndpoints.${ normalizedService } is not an array, the value will be ignored: ${ JSON . stringify (
704
699
methods
705
700
) } `
@@ -708,7 +703,7 @@ function normalizeIgnoredEndpoints(config) {
708
703
config . tracing . ignoreEndpoints [ normalizedService ] = [ ] ;
709
704
} else {
710
705
// @ts -ignore
711
- config . tracing . ignoreEndpoints [ normalizedService ] = methods . map ( method => method . toLowerCase ( ) ) ;
706
+ config . tracing . ignoreEndpoints [ normalizedService ] = methods . map ( method => method ? .toLowerCase ( ) ) ;
712
707
}
713
708
}
714
709
}
0 commit comments