Skip to content
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

[opampsupervisor] Add HealthCheckPort configuration parameter #34704

Conversation

dpaasman00
Copy link
Contributor

Description:

Add a new configuration parameter to agent called health_check_port. If this is set, then the supervisor will configure the agent's healthcheck extension to use the given port. If it is unset, then we will grab a random port same as before.

Link to tracking Issue: #34643

Testing:

  • Updated config validation tests
  • Verified that healthcheck extension is configured with the correct port and works as expected

Comment on lines 132 to 135
if a.HealthCheckPort > 65535 {
return errors.New("agent::health_check_port must be a valid port number")
}

Copy link
Contributor

@BinaryFissionGames BinaryFissionGames Aug 15, 2024

Choose a reason for hiding this comment

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

Let's also check that the port is not negative

cmd/opampsupervisor/supervisor/supervisor.go Show resolved Hide resolved
@dpaasman00 dpaasman00 marked this pull request as ready for review August 15, 2024 14:42
@dpaasman00 dpaasman00 requested review from a team and BinaryFissionGames August 15, 2024 14:42
@dpaasman00 dpaasman00 force-pushed the supervisor-healthcheck-port-configurable branch from a1a5237 to 5b54cb6 Compare August 16, 2024 17:38
Copy link
Contributor

@BinaryFissionGames BinaryFissionGames left a comment

Choose a reason for hiding this comment

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

This works great for me.

@tigrannajaryan Do you have any objections to this feature in general? I know you were discussing ways to mitigate issues with the random port allocation, but I think this is a good practical solution to the problem for now.

@tigrannajaryan
Copy link
Member

This works great for me.

@tigrannajaryan Do you have any objections to this feature in general? I know you were discussing ways to mitigate issues with the random port allocation, but I think this is a good practical solution to the problem for now.

No objections.

@dpaasman00 dpaasman00 force-pushed the supervisor-healthcheck-port-configurable branch 2 times, most recently from 80eddf4 to 03dc166 Compare August 30, 2024 11:11
@dpaasman00 dpaasman00 force-pushed the supervisor-healthcheck-port-configurable branch from 03dc166 to bb67282 Compare September 3, 2024 12:56
@songy23 songy23 added the ready to merge Code review completed; ready to merge by maintainers label Sep 4, 2024
@evan-bradley evan-bradley merged commit a4393cb into open-telemetry:main Sep 5, 2024
163 checks passed
@github-actions github-actions bot added this to the next release milestone Sep 5, 2024
f7o pushed a commit to f7o/opentelemetry-collector-contrib that referenced this pull request Sep 12, 2024
…elemetry#34704)

**Description:** <Describe what has changed.>
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
Add a new configuration parameter to `agent` called `health_check_port`.
If this is set, then the supervisor will configure the agent's
healthcheck extension to use the given port. If it is unset, then we
will grab a random port same as before.

**Link to tracking Issue:** open-telemetry#34643

**Testing:** <Describe what testing was performed and which tests were
added.>
- Updated config validation tests
- Verified that healthcheck extension is configured with the correct
port and works as expected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cmd/opampsupervisor ready to merge Code review completed; ready to merge by maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants