open-telemetry / opentelemetry-js

OpenTelemetry JavaScript Client
https://opentelemetry.io
Apache License 2.0
2.65k stars 765 forks source link

Disallow `new Span()` #3597

Open dyladan opened 1 year ago

dyladan commented 1 year ago

Currently it is possible to call new Span(). We should make the constructor private to disallow this.

Current test usages:

Possible additional goals:

JamieDanielson commented 1 month ago

Note: To do this, we can make Span private and for TypeScript we should be able to access with obj[“somePrivateProperty”]