Skip to content

Commit

Permalink
[chore] refactor(sumologicexporter): use `confighttp.NewDefaultClient…
Browse files Browse the repository at this point in the history
…Config` (#31510)

Use `confighttp.NewDefaultClientConfig` instead of
`confighttp.ClientConfig{...}`.

**Link to tracking Issue:** #6641

**Testing:**

Unit tests
  • Loading branch information
andrzej-stencel committed Mar 12, 2024
1 parent 916a2fe commit 3e072d2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions exporter/sumologicexporter/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ type Config struct {

// createDefaultClientConfig returns default http client settings
func createDefaultClientConfig() confighttp.ClientConfig {
return confighttp.ClientConfig{
Timeout: defaultTimeout,
}
config := confighttp.NewDefaultClientConfig()
config.Timeout = defaultTimeout
return config
}

// LogFormatType represents log_format
Expand Down
4 changes: 3 additions & 1 deletion exporter/sumologicexporter/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ func TestCreateDefaultConfig(t *testing.T) {
GraphiteTemplate: "%{_metric_}",

ClientConfig: confighttp.ClientConfig{
Timeout: 5 * time.Second,
IdleConnTimeout: confighttp.NewDefaultClientConfig().IdleConnTimeout,
MaxIdleConns: confighttp.NewDefaultClientConfig().MaxIdleConns,
Timeout: 5 * time.Second,
},
BackOffConfig: configretry.NewDefaultBackOffConfig(),
QueueSettings: qs,
Expand Down

0 comments on commit 3e072d2

Please sign in to comment.