opentelemetry-js icon indicating copy to clipboard operation
opentelemetry-js copied to clipboard

[sdk-trace] make `activeSpanProcessor` private

Open pichlermarc opened this issue 1 year ago • 3 comments
trafficstars

Description

activeSpanProcessor is currently public and that allows users to modify the span processor by setting it on the fly even though the should be done via addSpanProcesssor() or - ideally - only via the constructor as the user is not supposed to hold on to the SDK instance of the TracerProvider after the initialization phase, as this can have unintended side-effects on the exported telemetry and should therefore be avoided.

This issue is considered done when

  • [x] the activeSpanProcessor property at https://github.com/open-telemetry/opentelemetry-js/blob/47444f2a4c13a80f3328ffafc5b4c8db9e9a0886/packages/opentelemetry-sdk-trace-base/src/BasicTracerProvider.ts#L73 has been marked private or protected
  • [ ] it has been verified that activeSpanProcessor is not public in any other way for the BasicTracerProvider
  • [ ] it has been verified that activeSpanProcessor is not public in any other way for the WebTracerProvider
  • [ ] it has been verified that activeSpanProcessor is not public in any other way for the NodeTracerProvider

pichlermarc avatar Jun 14 '24 09:06 pichlermarc