Skip to content

AP 547: Add other healthchecks to Geodata#71

Merged
yzhoubk merged 15 commits into
mainfrom
AP-547
Jan 27, 2026
Merged

AP 547: Add other healthchecks to Geodata#71
yzhoubk merged 15 commits into
mainfrom
AP-547

Conversation

@yzhoubk

@yzhoubk yzhoubk commented Jan 15, 2026

Copy link
Copy Markdown
Contributor

Add http head check to geoservers and spatial servers

@yzhoubk yzhoubk requested a review from anarchivist January 15, 2026 00:48
@yzhoubk yzhoubk self-assigned this Jan 15, 2026

@anarchivist anarchivist left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this is a good start but I'd like to see this check be closer in alignment to how OkComputer::Check defines its API. I have some questions about whether some of the classes and methods are necessary. Let me know if you'd like to discuss this further!

Comment thread lib/check_server.rb Outdated
Comment thread lib/check_server.rb Outdated
Comment thread lib/check_server.rb Outdated
Comment thread lib/http_client.rb Outdated
Comment thread lib/http_head_check.rb Outdated
Comment thread lib/http_client.rb Outdated
Comment thread lib/http_client.rb Outdated
Comment thread lib/http_head_check.rb
Comment thread lib/check_server.rb Outdated
Comment thread lib/check_server.rb Outdated
Comment thread lib/http_head_check.rb Outdated
Comment thread lib/check_server.rb Outdated
@yzhoubk

yzhoubk commented Jan 16, 2026

Copy link
Copy Markdown
Contributor Author

@anarchivist I did the updates accordingly, could you please take a look? Thanks

@anarchivist anarchivist left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good - I think the one other thing I would add are RSpec tests for EndpointUrl and GeoDataHealthCheck::HttpHeadCheck. Then I think this is ready to go!

@yzhoubk

yzhoubk commented Jan 24, 2026

Copy link
Copy Markdown
Contributor Author

@anarchivist I've pushed the update, please take a look when you have time. Thanks

@anarchivist anarchivist left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Almost there. One minor change/clarification; one request for clarification on how the secret file is supposed to work.

Comment thread lib/http_head_check.rb
@@ -0,0 +1,54 @@
module GeoDataHealthCheck
class HttpHeadCheck < OkComputer::Check
ConnectionFailed = Class.new(StandardError)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why is this necessary? Could we just do the following instead?

Suggested change
ConnectionFailed = Class.new(StandardError)
ConnectionFailed = OkComputer::HttpCheck::ConnectionFailed

Alternately, you could omit this line here and modify #perform_request to use the class from OkComputer directly.

Comment thread lib/endpoint_url.rb Outdated
private

def get_url(server_name)
secret_file = Rails.configuration.x.servers[server_name]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

How is this secret file deployed and what is it supposed to contain? Is there a reason we wouldn't do this with a Docker secret instead? (cc @danschmidt5189)

@anarchivist anarchivist Jan 26, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@yzhoubk and i discussed this, and we agreed that we did not have to reuse the existing Docker secret as used by GINGR. The healthchecks do not require authentication. Instead, we should be passing in the values of the complete destination from three environment variables that are settable from the stack file. Example names for each of these could be GEODATA_GEOSERVER_PUBLIC_HEALTHCHECK_URLGEODATA_GEOSERVER_SECURE_HEALTHCHECK_URL, and GEODATA_SPATIAL_HEALTHCHECK_URL.

the advantage of this is that this greatly simplifies the setup code here.

@yzhoubk yzhoubk changed the title Ap 547: Add other healthchecks to Geodata AP 547: Add other healthchecks to Geodata Jan 27, 2026
@yzhoubk yzhoubk merged commit 8240cc6 into main Jan 27, 2026
5 checks passed
@yzhoubk yzhoubk deleted the AP-547 branch January 27, 2026 18:09
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.

2 participants