File tree Expand file tree Collapse file tree
metapackages/auto-instrumentations-node/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -135,12 +135,7 @@ export type InstrumentationConfigMap = {
135135export function getNodeAutoInstrumentations (
136136 inputConfigs : InstrumentationConfigMap = { }
137137) : Instrumentation [ ] {
138- for ( const name of Object . keys ( inputConfigs ) ) {
139- if ( ! Object . prototype . hasOwnProperty . call ( InstrumentationMap , name ) ) {
140- diag . error ( `Provided instrumentation name "${ name } " not found` ) ;
141- continue ;
142- }
143- }
138+ checkManuallyProvidedInstrumentationNames ( Object . keys ( inputConfigs ) ) ;
144139
145140 const instrumentations : Instrumentation [ ] = [ ] ;
146141
@@ -167,6 +162,16 @@ export function getNodeAutoInstrumentations(
167162 return instrumentations ;
168163}
169164
165+ function checkManuallyProvidedInstrumentationNames (
166+ manuallyProvidedInstrumentationNames : string [ ]
167+ ) {
168+ for ( const name of manuallyProvidedInstrumentationNames ) {
169+ if ( ! Object . prototype . hasOwnProperty . call ( InstrumentationMap , name ) ) {
170+ diag . error ( `Provided instrumentation name "${ name } " not found` ) ;
171+ }
172+ }
173+ }
174+
170175export function getResourceDetectorsFromEnv ( ) : Array < Detector | DetectorSync > {
171176 const resourceDetectors = new Map <
172177 string ,
You can’t perform that action at this time.
0 commit comments