Skip to content

Commit

Permalink
[loadbalancingexporter] Set the default otlp port 4317 in factory and…
Browse files Browse the repository at this point in the history
… unit test (#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

#31371

#31381


**Link to tracking Issue:** 
otel-collector-contrib: [issue
31426](#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)
  • Loading branch information
atmask authored Feb 28, 2024
1 parent 76f52c5 commit cea1de2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion exporter/loadbalancingexporter/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func NewFactory() exporter.Factory {
func createDefaultConfig() component.Config {
otlpFactory := otlpexporter.NewFactory()
otlpDefaultCfg := otlpFactory.CreateDefaultConfig().(*otlpexporter.Config)
otlpDefaultCfg.Endpoint = "placeholder"
otlpDefaultCfg.Endpoint = "placeholder:4317"

return &Config{
Protocol: Protocol{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ exporters:
loadbalancing:
protocol:
otlp:
endpoint: should-be-replaced
endpoint: should-be-replaced:4317

resolver:
static:
Expand Down

0 comments on commit cea1de2

Please sign in to comment.