Skip to content

Commit 8aa6bec

Browse files
atmaskXinRanZhAWS
authored andcommitted
[loadbalancingexporter] Set the default otlp port 4317 in factory and unit test (open-telemetry#31425)
**Description:** As described in the otel-collector [issue 9505](open-telemetry/opentelemetry-collector#9505), the otlpexporter does not function correctly if no port is defined. To resolve this, the otlp config validation has been updated to fail fast when the endpoint within an otlp config does not have a port specified. The loadbalancingexporter config has the otlp exporter config as a dependency, however, the loadbalancing exporter does not define a port on the otlpexporter config in two places: - default config from factory - testdata contents This is currently a blocker to the contrib tests for the [PR](open-telemetry/opentelemetry-collector#9632) to resolve issue 9505 Relates to: open-telemetry/opentelemetry-collector#9523 open-telemetry#31371 open-telemetry#31381 **Link to tracking Issue:** otel-collector-contrib: [issue 31426](open-telemetry#31426) Arises from otel-collector [issue 9505](open-telemetry/opentelemetry-collector#9505) **Testing:** Used `replace` to test loadbalancingexporter changes pass tests successfully when using the otlpexporter changes from [PR](open-telemetry/opentelemetry-collector#9632)
1 parent f1b3f0c commit 8aa6bec

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

exporter/loadbalancingexporter/factory.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func NewFactory() exporter.Factory {
3232
func createDefaultConfig() component.Config {
3333
otlpFactory := otlpexporter.NewFactory()
3434
otlpDefaultCfg := otlpFactory.CreateDefaultConfig().(*otlpexporter.Config)
35-
otlpDefaultCfg.Endpoint = "placeholder"
35+
otlpDefaultCfg.Endpoint = "placeholder:4317"
3636

3737
return &Config{
3838
Protocol: Protocol{

exporter/loadbalancingexporter/testdata/test-build-exporter-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ exporters:
77
loadbalancing:
88
protocol:
99
otlp:
10-
endpoint: should-be-replaced
10+
endpoint: should-be-replaced:4317
1111

1212
resolver:
1313
static:

0 commit comments

Comments
 (0)