-
Notifications
You must be signed in to change notification settings - Fork 44
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
Implement a health check for the tracker container #512
Implement a health check for the tracker container #512
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## develop #512 +/- ##
===========================================
- Coverage 84.28% 84.20% -0.08%
===========================================
Files 100 110 +10
Lines 7141 7289 +148
===========================================
+ Hits 6019 6138 +119
- Misses 1122 1151 +29 ☔ View full report in Codecov by Sentry. |
2065ff8
to
42d5c89
Compare
42d5c89
to
6355e26
Compare
6355e26
to
394623c
Compare
It'll be used by a litle script (health check) that needs to make HTTP request.
It makes a request to an HTTP endpoint to check that the service is healthy.
394623c
to
48ac64f
Compare
ebc0911
to
cc851df
Compare
New Health CHeck API, but it is not checking anything yet. You can call it at: http://localhost:1313/health_check
cc851df
to
e1a45a2
Compare
The app health check endpoint checks is the API is running healthy when is enabled.
f58df75
to
ef296f7
Compare
http://localhost:7070/health_check And call the endpoint from the general application health check endpoint: http://localhost:1313/health_check Do not call the endpoint if: - The tracker is disabled. - The tracker configuration uses port 0 only knwon after starting the socket. todo: call the enpoint also when the port is 0 in the configuration. THe service can return back to the main app the port assiged by the OS. And the app can pass that port to the global app health check handler.
80044c2
to
7421306
Compare
We will use the UDP tracker connection request to check if the UDP tracker service is healthy.
Using the `connect` UDP request. If the UDP trackers replies to a connection request we assume is healthy.
Hi @da2ce7 @mario-nt @WarmBeer this is ready for review. For the time being, it only actually checks the internal services (API, UDP and HTTP tracker) if the port defined in the configuration is not 0. It's a big effort to get the real port back after launching those services. We have some pending issues for that. We can improve this PR after refactoring those services. I think this solution is enough at least to check that containers are "ready". If you think it's a good solution I can add the missing tests at least for the part that it's easily testable. |
ACK 5e0a686 |
We need to check the three services provided by the container:
And we also need to:
Implementation
connect
request endpoint).With the default configuration, you can use the endpoint: http://localhost:1313/health_check
It will return an OK Json response:
or an Error response:
NOTICE: health checks are not executed when services use port 0 in the configuration. Service launchers must be changed to return the bound port so the health checker handler can connect.