Skip to content

Commit

Permalink
[receiver/nginx] Use NewDefaultClientConfig instead of manually creat…
Browse files Browse the repository at this point in the history
…ing struct (#35452)

**Description:** <Describe what has changed.>
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
Similar to
open-telemetry/opentelemetry-collector#11273.
This PR makes usage of the `NewDefaultClientConfig` instead of manually
creating the `confighttp.ClientConfig` struct as part of
#35457.

**Link to tracking Issue:** <Issue number if applicable>
#35457

**Testing:** <Describe what testing was performed and which tests were
added.>

**Documentation:** <Describe the documentation added.>

---------

Signed-off-by: ChrsMark <[email protected]>
  • Loading branch information
ChrsMark authored Oct 9, 2024
1 parent 19ddd21 commit 27aa54b
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions receiver/nginxreceiver/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,13 @@ func createDefaultConfig() component.Config {
cfg := scraperhelper.NewDefaultControllerConfig()
cfg.CollectionInterval = 10 * time.Second

clientConfig := confighttp.NewDefaultClientConfig()
clientConfig.Endpoint = "http://localhost:80/status"
clientConfig.Timeout = 10 * time.Second

return &Config{
ControllerConfig: cfg,
ClientConfig: confighttp.ClientConfig{
Endpoint: "http://localhost:80/status",
Timeout: 10 * time.Second,
},
ControllerConfig: cfg,
ClientConfig: clientConfig,
MetricsBuilderConfig: metadata.DefaultMetricsBuilderConfig(),
}
}
Expand Down

0 comments on commit 27aa54b

Please sign in to comment.