Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OTEL-2181] Set a specific default timeout value when getting the flare for OTEL #31388

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading