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

Consider making internal SDK components private #3598

Open
dyladan opened this issue Feb 9, 2023 · 4 comments
Open

Consider making internal SDK components private #3598

dyladan opened this issue Feb 9, 2023 · 4 comments
Labels
needs:refinement This issue needs to be refined/broken apart into sub-issues before implementation never-stale triage:accepted This feature has been accepted

Comments

@dyladan
Copy link
Member

dyladan commented Feb 9, 2023

Currently we export a lot of functions, types, objects, and classes from our core packages that we consider to be internal. This leads people to depend on these components which we do not recommend (example: https://github.com/prisma/prisma/blob/9c6e80e6fadc3068a54bc6cbff2edb218e88d345/packages/engine-core/src/tracing/createSpan.ts). As much as possible we should encourage users to use the API interfaces only.

This could be done by making them private, making the constructors private, or making all properties not included in the interface private (maybe there is some way to exclude some properties from the published types while keeping them internally?)

non-exhaustive list:

  • SDK Span and Tracer
  • SDK Meter and Metrics
  • TracerProvider (still need a way to configure it though)
  • Everything in core package

TODO:

  • evaluate use of these components in tests in both core and contrib
  • see if dd-trace is using these
  • see if honeycomb distro is using these
@dyladan dyladan added this to the OpenTelemetry SDK 2.0 milestone Feb 9, 2023
@Flarna
Copy link
Member

Flarna commented Feb 9, 2023

We could export interfaces instead classes where possible. This has the additional benefit that typescript doesn't complain about incompatible types just because private fields differ.

@github-actions
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.

@MSNev
Copy link
Contributor

MSNev commented Oct 4, 2023

related #4185

@dyladan dyladan removed the triage label Oct 4, 2023
@dyladan dyladan added triage:accepted This feature has been accepted needs:refinement This issue needs to be refined/broken apart into sub-issues before implementation labels Oct 18, 2023
@JamieDanielson
Copy link
Member

Planning for SDK 2.0...

  • SDK Span and Tracer is done.
  • SDK Meter and Metrics is already private.
  • TracerProvider will stay as-is.
  • Everything in core package is done.

Will double check on open issues to confirm this can be closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs:refinement This issue needs to be refined/broken apart into sub-issues before implementation never-stale triage:accepted This feature has been accepted
Projects
None yet
Development

No branches or pull requests

5 participants