Skip to content

Commit

Permalink
[chore] Remove telemetryInitializer from CollectorSettings
Browse files Browse the repository at this point in the history
This will allow to move deprecated Collector to otelcol.

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
  • Loading branch information
bogdandrutu committed Dec 9, 2022
1 parent ad2dc45 commit 1e0ff8c
Show file tree
Hide file tree
Showing 4 changed files with 265 additions and 267 deletions.
12 changes: 4 additions & 8 deletions service/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,17 +76,16 @@ func (s State) String() string {
// Collector represents a server providing the OpenTelemetry Collector service.
// Deprecated: [v0.67.0] use otelcol.Collector
type Collector struct {
set CollectorSettings
set CollectorSettings
telemetry *telemetryInitializer

service *service
state *atomic.Int32

// shutdownChan is used to terminate the collector.
shutdownChan chan struct{}

// signalsChannel is used to receive termination signals from the OS.
signalsChannel chan os.Signal

// asyncErrorChannel is used to signal a fatal error from any component.
asyncErrorChannel chan error
}
Expand All @@ -98,12 +97,9 @@ func New(set CollectorSettings) (*Collector, error) {
return nil, errors.New("invalid nil config provider")
}

if set.telemetry == nil {
set.telemetry = newColTelemetry(featuregate.GetRegistry())
}

return &Collector{
set: set,
telemetry: newColTelemetry(featuregate.GetRegistry()),
state: atomic.NewInt32(int32(StateStarting)),
shutdownChan: make(chan struct{}),
// Per signal.Notify documentation, a size of the channel equaled with
Expand Down Expand Up @@ -150,7 +146,7 @@ func (col *Collector) setupConfigurationComponents(ctx context.Context) error {
Config: cfg,
AsyncErrorChannel: col.asyncErrorChannel,
LoggingOptions: col.set.LoggingOptions,
telemetry: col.set.telemetry,
telemetry: col.telemetry,
})
if err != nil {
return err
Expand Down
Loading

0 comments on commit 1e0ff8c

Please sign in to comment.