I have recently created a python API using the FastAPI framework and got it running fine in my AWS ECS Service. I have set up a /health endpoint for health checks by ALB. The Entrypoint for my ECS container is this command
ENTRYPOINT ["app/start.sh"]
and this is what I have in my start.sh
uvicorn main:app --host 0.0.0.0
The problem I have is that my ECS logs are filled with 200 OKs when ALB hits /health endpoint. It is very frustrating that I can hardly find my API logs and Cloudwatch is filled with /health endpoint logs. Is there a way that I can avoid health endpoint logs?
@app.get("/health", response_class=PlainTextResponse)
def healthcheck():
return "200"
