opentelemetry-collector icon indicating copy to clipboard operation
opentelemetry-collector copied to clipboard

Restructure packages from current "service" package

Open bogdandrutu opened this issue 3 years ago • 0 comments
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:
    • Config struct 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) or Build(context.Context, Settings).
  • [ ] Telemetry initialization logic will be moved into this package service/telemetry.go file.
  • [ ] The current service package 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 a Config which 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 flags will also be moved there.
  • [ ] service/featuregate will be moved as a top directory featuregate.

Advantages:

  1. Better match of the features/structure with the configuration structure.
  2. 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

bogdandrutu avatar Jun 21 '22 14:06 bogdandrutu