Skip to content

Commit 3fdf65b

Browse files
ChrsMarkjmichalek132
authored andcommitted
[receiver/nginx] Use NewDefaultClientConfig instead of manually creating struct (open-telemetry#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 open-telemetry#35457. **Link to tracking Issue:** <Issue number if applicable> open-telemetry#35457 **Testing:** <Describe what testing was performed and which tests were added.> **Documentation:** <Describe the documentation added.> --------- Signed-off-by: ChrsMark <[email protected]>
1 parent af7f7be commit 3fdf65b

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

receiver/nginxreceiver/factory.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,13 @@ func createDefaultConfig() component.Config {
2828
cfg := scraperhelper.NewDefaultControllerConfig()
2929
cfg.CollectionInterval = 10 * time.Second
3030

31+
clientConfig := confighttp.NewDefaultClientConfig()
32+
clientConfig.Endpoint = "http://localhost:80/status"
33+
clientConfig.Timeout = 10 * time.Second
34+
3135
return &Config{
32-
ControllerConfig: cfg,
33-
ClientConfig: confighttp.ClientConfig{
34-
Endpoint: "http://localhost:80/status",
35-
Timeout: 10 * time.Second,
36-
},
36+
ControllerConfig: cfg,
37+
ClientConfig: clientConfig,
3738
MetricsBuilderConfig: metadata.DefaultMetricsBuilderConfig(),
3839
}
3940
}

0 commit comments

Comments
 (0)