-
Notifications
You must be signed in to change notification settings - Fork 819
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disallow new Span()
#3597
Comments
Note: To do this, we can make |
We may also be able to convert uses of |
Couple of questions:
|
Hmm, though questions. I think the underlying goal should maybe rather be: don't export the There's nothing wrong with keeping the When going this route, the answer to the questions would be:
yes, leaving it is no problem
Yes, wherever this fulfills the goals of the interface. An API span is not readable. That's so that users don't use attributes they added to a span in their business logic to convey information, which makes a registered Otel SDK required for their app to function, but business logic should not be impacted, whether you have an OTel SDK registered or not. In some SDK interfaces, the Span is readable on purpose though. |
@pichlermarc I think this one can be closed. |
Currently it is possible to call
new Span()
. We should make the constructor private to disallow this.Current test usages:
new span
in contrib tests: https://github.com/open-telemetry/opentelemetry-js-contrib/blob/main/plugins/node/opentelemetry-instrumentation-dns/test/functionals/utils.test.ts#L150new Span
in JS testsSpan
in testsnew Span
in tests? @dyladan will look into thisPossible additional goals:
The text was updated successfully, but these errors were encountered: