Skip to content

Commit

Permalink
Set specific timeout for otel flare
Browse files Browse the repository at this point in the history
  • Loading branch information
ogaca-dd committed Nov 22, 2024
1 parent bd961d3 commit dc93ea7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions comp/otelcol/collector/impl-pipeline/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,12 @@ func NewComponent(reqs Requires) (Provides, error) {
OnStart: collector.start,
OnStop: collector.stop,
})

timeoutCallback := func(flaretypes.FlareBuilder) time.Duration {
return time.Second * time.Duration(reqs.Config.GetInt("otelcollector.flare.timeout"))
}
return Provides{
Comp: collector,
FlareProvider: flaretypes.NewProvider(collector.fillFlare),
FlareProvider: flaretypes.NewProviderWithTimeout(collector.fillFlare, timeoutCallback),
StatusProvider: status.NewInformationProvider(collector),
}, nil
}
1 change: 1 addition & 0 deletions pkg/config/setup/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -876,6 +876,7 @@ func InitConfig(config pkgconfigmodel.Setup) {
config.BindEnvAndSetDefault("otelcollector.extension_timeout", 0) // in seconds, 0 for default value
config.BindEnvAndSetDefault("otelcollector.submit_dummy_metadata", false) // dev flag - to be removed
config.BindEnvAndSetDefault("otelcollector.converter.enabled", true)
config.BindEnvAndSetDefault("otelcollector.flare.timeout", 60)

// inventories
config.BindEnvAndSetDefault("inventories_enabled", true)
Expand Down

0 comments on commit dc93ea7

Please sign in to comment.