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

chore: log if metrics_endpoint but no feature flag #5279

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from

Conversation

hstove
Copy link
Contributor

@hstove hstove commented Oct 5, 2024

When calling start_server_monitoring_metrics, there is an inverse feature flag (not(features = "monitoring_prom")) and log if you've set metrics_endpoint but don't have --feature monitoring_prom. This is helpful in the case that you're trying to setup monitoring, and added the config field, but didn't add the feature flag.

This log wasn't getting shown because start_server_monitoring_metrics was itself behind a feature flag, so the log never showed up. This PR changes this to always call start_server_monitoring_metrics - it's still a no-op (with just the log mentioned) if the feature flag isn't provided.

@hstove hstove requested a review from a team as a code owner October 5, 2024 18:59
obycode
obycode previously approved these changes Oct 5, 2024
Copy link
Contributor

@obycode obycode left a comment

Choose a reason for hiding this comment

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

Lgtm

@hstove
Copy link
Contributor Author

hstove commented Oct 5, 2024

Nice, now that @wileyj updated the test runner to use the monitoring_prom flag, we actually caught a failed assertion in a test. Seems small, I'll fix it in this PR.

kantai
kantai previously approved these changes Oct 7, 2024
jcnelson
jcnelson previously approved these changes Oct 7, 2024
obycode
obycode previously approved these changes Oct 7, 2024
@hstove hstove dismissed stale reviews from obycode and jcnelson via 576fd41 October 7, 2024 21:47
@hstove hstove requested review from obycode and kantai October 9, 2024 13:45
@hstove hstove mentioned this pull request Oct 9, 2024
obycode
obycode previously approved these changes Oct 17, 2024
Copy link
Contributor

@obycode obycode left a comment

Choose a reason for hiding this comment

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

LGTM!

jferrant
jferrant previously approved these changes Oct 21, 2024
@jferrant jferrant self-requested a review October 21, 2024 15:52
@jferrant
Copy link
Collaborator

simple_neon_integration test seems to be broken and I think by this...it is complaining I think about a metrics response not existing as expected.

@@ -1500,19 +1500,16 @@ fn simple_neon_integration() {
// query for prometheus metrics
#[cfg(feature = "monitoring_prom")]
{
wait_for(10, || {
Copy link
Member

Choose a reason for hiding this comment

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

Pretty sure this wait_for was there for a reason. Maybe it's because the thread that runs the metrics hasn't started by the time this function is called?

Copy link
Member

Choose a reason for hiding this comment

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

This applies to all the other wait_fors below, as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I don't remember my exact thought process, but Jacinta recently had added the wait_fors when fixing these in a different PR. I may have just removed them from a bad merge. I've added them back.

It's not that the metrics server hasn't started, but the metric itself isn't updated until somewhere down the relayer stack, and I believe that's why the metric isn't updated "immediately".

@hstove hstove dismissed stale reviews from jferrant and obycode via 404d0be October 22, 2024 17:40
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.

5 participants