opentelemetry-collector
opentelemetry-collector copied to clipboard
Restructure packages from current "service" package
trafficstars
This is a proposal to restructure current large "service" package with multiple dependencies, and too many features to match the configuration "service" part:
- [ ] Will create a package under "service" directory for every config service subcomponent (telemetry, pipelines, extensions). These packages will follow the format:
Configstruct for configuration, similar to all other components.- Will not use a "Factory" since I don't think we want necessary to allow this to be pluginable, but will offer an API like
New(context.Context, Settings)orBuild(context.Context, Settings).
- [ ] Telemetry initialization logic will be moved into this package
service/telemetry.gofile. - [ ] The current
servicepackage will become the package that implements the current service part of the config. Which means also will implement the "Host" interface. This package will have aConfigwhich will represent the current "service::" configuration. - [ ] Create a new "collector" package and move the current "Collector", "windows.SvcHandler", "Command", "ConfigProvider" structs and related constructors/helpers.
- Things related to
flagswill also be moved there.
- Things related to
- [ ]
service/featuregatewill be moved as a top directoryfeaturegate.
Advantages:
- Better match of the features/structure with the configuration structure.
- Allow external parties to use a "sub-component" of the collector (telemetry, extensions, etc.). This will fix https://github.com/open-telemetry/opentelemetry-collector/issues/4970