Skip to content

Conversation

@ansh0014
Copy link

@ansh0014 ansh0014 commented Feb 11, 2026

[extension/jaegerremotesampling] Add validation to detect port conflicts

The jaegerremotesampling extension previously allowed HTTP and gRPC servers to be configured on the same port, which could lead to runtime port binding failures.

This change enhances the Validate() method to proactively detect port conflicts during configuration loading and fail fast with a clear, actionable error message.

Changes introduced:

  • Added port conflict validation between HTTP and gRPC servers
  • Implemented extractPort() helper function for endpoint parsing
  • Added comprehensive unit tests covering valid and conflicting configurations
  • Improved error messages for better debugging experience

All tests pass and golangci-lint reports no issues.

Fixes #45944

- Enhanced Validate() method to check for port conflicts between HTTP and gRPC servers

- Added extractPort() helper function to parse endpoint strings

- Added comprehensive unit tests for validation logic

- Validation fails fast with clear, actionable error messages

Fixes open-telemetry#45944
@ansh0014 ansh0014 requested a review from a team as a code owner February 11, 2026 08:07
@ansh0014 ansh0014 requested a review from braydonk February 11, 2026 08:07
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Feb 11, 2026

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: ansh0014 / name: Anshul Jagota (ce1f7a2)

@github-actions github-actions bot added the first-time contributor PRs made by new contributors label Feb 11, 2026
@github-actions
Copy link
Contributor

Welcome, contributor! Thank you for your contribution to opentelemetry-collector-contrib.

Important reminders:

A maintainer will review your pull request soon. Thank you for helping make OpenTelemetry better!

@ansh0014
Copy link
Author

Additional context:

The validation logic was intentionally placed inside Validate() to ensure misconfigurations are caught during startup configuration parsing rather than during server initialization.

This approach aligns with existing validation patterns in other extensions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[extension/jaegerremotesampling] Cannot disable GRPC port

3 participants