signalfx/splunk-otel-js

Deduplicate instrumentations given to startTracing

seemk opened this issue · 0 comments

seemk commented

When using the advanced options with a custom instrumentation list, instrumentations (HttpInstrumentation here) might be passed to OTel SDK twice:

startTracing({
  instrumentations: [...getInstrumentations(), new HttpInstrumentation()]
})

While both HttpInstrumentations are configured, only 1 hook exists (from the instrumentation which appears later in the array). However I'm not sure if it is defined behaviour by OpenTelemetry JS. We could deduplicate the instrumentations by name and only pass 1 instrumentation of each to the SDK.