Skip to content

Use Random port for listener in collector ext #1751

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

Merged
merged 2 commits into from
Apr 4, 2025

Conversation

vasireddy99
Copy link
Contributor

Use Random port for listener in collector ext in order to avoid error bind: address in use

Copy link
Member

@tylerbenson tylerbenson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't fully understand how the sender knows which port to send data to, but this seems reasonable.

@serkan-ozal
Copy link
Contributor

@serkan-ozal
Copy link
Contributor

I don't fully understand how the sender knows which port to send data to, but this seems reasonable.

@tylerbenson Its active port is registered here: https://github.com/open-telemetry/opentelemetry-lambda/blob/main/collector/internal/telemetryapi/client.go#L59

and it is called by here: https://github.com/open-telemetry/opentelemetry-lambda/blob/main/collector/internal/lifecycle/manager.go#L78

@vasireddy99
Copy link
Contributor Author

vasireddy99 commented Apr 2, 2025

@serkan-ozal good point, I looked into it initially since we are not testing httprequest but only the handler, and we are also using httptest it generates a valid http request irrespective of what we have provided, so probably be okay in my opinion.

@serkan-ozal
Copy link
Contributor

Thanks for the fix @vasireddy99

@serkan-ozal serkan-ozal merged commit ea7e1bf into open-telemetry:main Apr 4, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants