Open lorenyu opened 1 year ago
Sample function that was used in AWS:
def is_load_balancer_health_check(request):
"""Test if the request comes from a load balancer."""
return request.path == "/v1/status" and request.headers.get("User-Agent", "").startswith(
"ELB-HealthChecker/"
)
To avoid cluttering the logs, consider removing access logs for the health check endpoint when they are coming from AWS
Implementation note
one possible way to filter is to check if request path is healthcheck and check if user agent starts with
ELB-HealthChecker/