diff --git a/comp/otelcol/collector/impl-pipeline/pipeline.go b/comp/otelcol/collector/impl-pipeline/pipeline.go index a0f72266efb8a..e3e2d89e2f87f 100644 --- a/comp/otelcol/collector/impl-pipeline/pipeline.go +++ b/comp/otelcol/collector/impl-pipeline/pipeline.go @@ -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 } diff --git a/pkg/config/setup/config.go b/pkg/config/setup/config.go index 1fef714a5b6a1..688dfac521ec6 100644 --- a/pkg/config/setup/config.go +++ b/pkg/config/setup/config.go @@ -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)