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

Define dependency hierarchy between core modules #9491

Closed
bogdandrutu opened this issue Feb 6, 2024 · 5 comments
Closed

Define dependency hierarchy between core modules #9491

bogdandrutu opened this issue Feb 6, 2024 · 5 comments
Labels
release:required-for-ga Must be resolved before GA release

Comments

@bogdandrutu
Copy link
Member

We are about to release more packages as stable, and we need to have a clear structure of dependencies between packages. We need to document (maybe enforce) restrictions on which packages can depend on which packages (e.g. component and confmap cannot depend on config modules). Here is how I see it so far (a larger number can depend on a smaller number):

  1. featuregate
  2. pdata
  3. confmap
  4. consumer
  5. component
  6. config modules
  7. receiver, processor, exporter, connector, extension
  8. receiver, processor, exporter, connector, extension implementations like otlpexporter.
  9. service (cannot depend on 8)
  10. otelcol (cannot depend on 8)
@bogdandrutu bogdandrutu added the release:required-for-ga Must be resolved before GA release label Feb 6, 2024
@bogdandrutu
Copy link
Member Author

One unsure relationship is extension with configs since some configs wants the list of extensions to find a storage or an auth extension. Need to maybe dig dipper here.

@dmitryax
Copy link
Member

dmitryax commented Feb 13, 2024

Some config modules seem to do more than expected. For example, does func (hss *ServerConfig) ToServer(component.Host, component.TelemetrySettings, http.Handler, opts ...ToServerOption) (*http.Server, error) need to be part of confighttp? It seems like it lives there because there is no other good place for a server functionality. Maybe we can introduce more modules under pkg and clean up the config module to keep only the user config interface?

@TylerHelmuth
Copy link
Member

@dmitryax it feels pretty natural from an ergonomic perspective within our components to have a single config struct and and then be able to call ToServer on it to get back a server. This requires libraries users to need to know about less packages and results in less dependencies imports.

It seems like the alternative is to create a new package with a ToServer(config confighttp.ServerConfig, component.Host, component.TelemetrySettings, http.Handler, opts ...ToServerOption) *http.server). This is also ergonomic, but requires users to know that this other package exists to help make a server from confighttp.ServerConfig. My fear would be that ToServer make get replicated independently because users wouldnt know to use the separate package.

@mx-psi
Copy link
Member

mx-psi commented Feb 29, 2024

I am still not sure why 4 & 5 need to go before 6. It may be the case for specific config modules, but certainly not for all of them, right?

@TylerHelmuth
Copy link
Member

I've updated the list in #9375 to reflect the dependency order mentioned here. Closing as completed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:required-for-ga Must be resolved before GA release
Projects
Archived in project
Development

No branches or pull requests

4 participants