Skip to content

Commit

Permalink
[OTEL-2181] Set a specific default timeout value when getting the fla…
Browse files Browse the repository at this point in the history
…re for OTEL (#31388)
  • Loading branch information
ogaca-dd authored Nov 27, 2024
1 parent bb3031d commit 199e77a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 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 @@ -879,6 +879,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
2 changes: 0 additions & 2 deletions test/new-e2e/tests/otel/utils/config_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (
"k8s.io/apimachinery/pkg/fields"

extension "github.com/DataDog/datadog-agent/comp/otelcol/ddflareextension/def"
"github.com/DataDog/datadog-agent/pkg/util/testutil/flake"
"github.com/DataDog/datadog-agent/test/fakeintake/client/flare"
)

Expand Down Expand Up @@ -105,7 +104,6 @@ func TestOTelFlareExtensionResponse(s OTelTestSuite, providedCfg string, fullCfg

// TestOTelFlareFiles tests that the OTel Agent flares contain the expected files
func TestOTelFlareFiles(s OTelTestSuite) {
flake.Mark(s.T())
err := s.Env().FakeIntake.Client().FlushServerAndResetAggregators()
require.NoError(s.T(), err)
agent := getAgentPod(s)
Expand Down

0 comments on commit 199e77a

Please sign in to comment.