-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
exporter/loadbalancingexporter: won't start unless a Port is explicitly given #10321
Comments
I added some temporary logs to these two methods:
(I added the "adding endpoint" and "removing endpoint" logs; see below) When using:
I see that the endpoint gets added and then immediately removed:
Whereas if I start with a port explicitly defined
I get:
|
Ah I see the problem: When endpoints are resolved in
we create the endpoint-strings WITH the port ONLY if it was explicitly given:
In my test (which resolved to "127.0.0.1", without the explicit port, the endpoint string is "127.0.0.1". But in
we create the endpoint string WITH the port (if it's not already set in the previous code-snippet). This leaves us with a disparity when we get to
The Sorry if that's a bit convoluted. |
Great detective work! Would you be able to come up with a unit test demonstrating the problem, and potentially with the fix as well? |
I think this bug is what this PR is about: #10124 |
Looks like those are different problems. |
Yea maybe I'm misremembering the various items I have pending (waiting on the CLA to really make progress; sorry about that) |
Describe the bug
The documentation indicates that the default 4317 port is used for the DNS Resolver, in the case when no Port is given, however I have not been able to get it to work. Whenever I run without a port I get a warning:
and no traces are processed. It seems it SHOULD work, since the default port is added here: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/exporter/loadbalancingexporter/loadbalancer.go#L128
(and a non-default port is added here: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/exporter/loadbalancingexporter/resolver_dns.go#L144-L146 )
Steps to reproduce
Configure a dns resolver with only a hostname, then run the exporter. See example configs below.
What did you expect to see?
Normal startup, no warning.
What did you see instead?
See warning message above.
What version did you use?
0.51.0
What config did you use?
Environment
tilt (using docker-for-desktop) on a mac, as well as running from goland development environment locally on the mac.
Additional context
I noticed the default port is defined in the code, and added here: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/exporter/loadbalancingexporter/loadbalancer.go#L128
Other places where the endpoint is created (with or without port) https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/exporter/loadbalancingexporter/resolver_dns.go#L144-L146
The text was updated successfully, but these errors were encountered: