Skip to content
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

Lighter-weight no-op API packaging #3311

Open
kcirone opened this issue Aug 10, 2021 · 7 comments
Open

Lighter-weight no-op API packaging #3311

kcirone opened this issue Aug 10, 2021 · 7 comments
Labels
Discussion Issue or PR that needs/is extended discussion. stale

Comments

@kcirone
Copy link

kcirone commented Aug 10, 2021

There is currently no easy way to get the basic OpenTelemetry constructs - tracer, span, context - without uptaking the whole API tree including diag logging, etc. For implementations where No-Op is the default but conditional, it would be beneficial to have a lighter-weight API structure that minimizes footprint.

@kcirone kcirone closed this as completed Aug 12, 2021
@kcirone kcirone reopened this Aug 12, 2021
@kcirone
Copy link
Author

kcirone commented Aug 12, 2021

Sorry closed accidentally.

@dyladan
Copy link
Member

dyladan commented Aug 27, 2021

Curious what your usecase is or what you would expect to see here. Are you asking for the API and the Noop components to be separate packages? Are you using any sort of minification or tree shaking in your build?

@vmarchaud vmarchaud added the Discussion Issue or PR that needs/is extended discussion. label Aug 29, 2021
@kcirone
Copy link
Author

kcirone commented Aug 30, 2021 via email

@dyladan
Copy link
Member

dyladan commented Aug 30, 2021

Hmm. this is quite a large change and I can't think of a way to easily do it in a backwards compatible way. Off the tp of my head I can't think of anything aside from the diag classes which are not directly needed by the external API interface. Even the diag is required in order to debug the API as there is no other good way to get visibility into issues with the initial API setup process.

@AlexGS74
Copy link

AlexGS74 commented May 9, 2022

This would be hugely beneficial for unit testing the instrumented code in apps that have the SDK connected and loaded. With NoOps made public that would be easy to use NoopTracer etc in case if this is a test context. Or it tries to post the spans nobody needs to the backends. Usually it fails with cryptic errors instead failing totally correct tests cases.

@dyladan
Copy link
Member

dyladan commented Oct 10, 2022

@AlexGS74 I think the original request is actually the opposite of what you're saying. You are asking for the no-ops to be made public, where the original request is to provide an API which doesn't include the no-ops.

@kcirone I'm transferring this to the main repo since the API is moved there now, but I'm not sure if this is a possible request. The specification states that the API MUST no-op if a method is called when there is no SDK registered. If we provide an API with no no-op behavior and no SDK is registered, we break specification. Not sure if there is any way around that or if I misunderstood the request?

@dyladan dyladan transferred this issue from open-telemetry/opentelemetry-js-api Oct 10, 2022
Copy link

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days.

@github-actions github-actions bot added the stale label Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Discussion Issue or PR that needs/is extended discussion. stale
Projects
None yet
Development

No branches or pull requests

4 participants