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

[sdk-trace] make `resource` private in `BasicTracerProvider`

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

Description

resource is currently public and incorrectly allows users to modify resource attributes by setting (provider.resource.attributes["some"] = "value") on the fly even though the resource should be immutable.

This can have unintended side-effects on the exported telemetry and should therefore be avoided.

This issue is considered done when

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

pichlermarc avatar Jun 14 '24 09:06 pichlermarc