Closed Bug 1322612 Opened 9 years ago Closed 9 years ago

Add a lightweight endpoint for the ELB healthcheck

Categories

(Socorro :: Webapp, task)

task
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: miles, Unassigned)

References

Details

I've realized that using the health check endpoint for the load balancer health check is unwise. This will cause otherwise healthy webapp instances to be removed from the ELB when backend services experience issues. Cloudops' Dockerflow (https://github.com/mozilla-services/Dockerflow/) uses __heartbeat__, __lbheartbeat__, and __version__ as standard endpoints. __lbheartbeat__ is a simple "always return 200" endpoint that the webapp should implement for the ELB health check. __heartbeat__ should check backend services and report failures, and will be used for monitoring. I've gone ahead and manually changed the ELB back to a TCP:80 health check. This is not what we want long-term, because it simply checks whether nginx is listening, but is better (/facepalm) than having the webapp potentially going down when backend services are down.
When you load https://crash-stats.mozilla.com/monitoring/healthcheck/?elb=true it does not touch backend services. If you load https://crash-stats.mozilla.com/monitoring/healthcheck/ (without the `?elb=true`) then it talks to memcached, postgres, ES and middleware. So if elastic search is experiencing some temporary blood-coughing, https://crash-stats.mozilla.com/monitoring/healthcheck/?elb=true will return 200 OK.
Hmm... I checked. If you load https://crash-stats.mozilla.com/monitoring/healthcheck/?elb=true it actually touches postgres (over Django's ORM). What it does is `SELECT (1) AS "a" FROM "status_statusmessage" WHERE "status_statusmessage"."enabled" = true LIMIT 1`.
See Also: → 1322615
I think I would make changes to the webapp to implement the specific endpoints required. Reusing or renaming existing things sounds fine, but I think we want to end up with the same endpoints that ops uses for other apps and have those endpoints behave in the same way.
Blocks: 1322631
This is reasonably fixed by 1322615. The standard dockerflow endpoints are not in place, but the healthcheck endpoint is usable. Should this be marked fixed?
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.