Skip to content

Commit

Permalink
add hostname to healthcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
yoomlam committed Jun 7, 2024
1 parent c24ba4d commit 50775d1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion 05-assistive-chatbot/chatbot_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

import logging
import os
import platform
import socket
from functools import cached_property
from io import StringIO
from typing import Dict
Expand Down Expand Up @@ -57,9 +59,10 @@ def healthcheck(request: Request):

git_sha = os.environ.get("GIT_SHA", "")
build_date = os.environ.get("BUILD_DATE", "")
hostname = f"{platform.node()} {socket.gethostname()}"

logger.info("Returning: Healthy %s %s", build_date, git_sha)
return HTMLResponse(f"Healthy {build_date} {git_sha}")
return HTMLResponse(f"Healthy {build_date} {git_sha}<br/>{hostname}")


ALLOWED_ENV_VARS = ["CHATBOT_LOG_LEVEL"]
Expand Down

0 comments on commit 50775d1

Please sign in to comment.