Skip to content

Commit 5eb2caa

Browse files
authored
Merge pull request #559 from tisnik/lcore-700-logging-for-info-and-health-endpoints
LCORE-700: logging for info and health endpoints
2 parents ae0c2e6 + 92344d1 commit 5eb2caa

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

src/app/endpoints/health.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
ProviderHealthStatus,
2323
)
2424

25-
logger = logging.getLogger(__name__)
25+
logger = logging.getLogger("app.endpoints.handlers")
2626
router = APIRouter(tags=["health"])
2727

2828
auth_dependency = get_auth_dependency()
@@ -93,6 +93,8 @@ async def readiness_probe_get_method(
9393
# Used only for authorization
9494
_ = auth
9595

96+
logger.info("Response to /v1/readiness endpoint")
97+
9698
provider_statuses = await get_providers_health_statuses()
9799

98100
# Check if any provider is unhealthy (not counting not_implemented as unhealthy)
@@ -135,4 +137,6 @@ async def liveness_probe_get_method(
135137
# Used only for authorization
136138
_ = auth
137139

140+
logger.info("Response to /v1/liveness endpoint")
141+
138142
return LivenessResponse(alive=True)

src/app/endpoints/info.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from models.responses import InfoResponse
1717
from version import __version__
1818

19-
logger = logging.getLogger(__name__)
19+
logger = logging.getLogger("app.endpoints.handlers")
2020
router = APIRouter(tags=["info"])
2121

2222
auth_dependency = get_auth_dependency()
@@ -58,12 +58,17 @@ async def info_endpoint_handler(
5858
# Nothing interesting in the request
5959
_ = request
6060

61+
logger.info("Response to /v1/info endpoint")
62+
6163
try:
6264
# try to get Llama Stack client
6365
client = AsyncLlamaStackClientHolder().get_client()
6466
# retrieve version
6567
llama_stack_version_object = await client.inspect.version()
6668
llama_stack_version = llama_stack_version_object.version
69+
logger.debug("Service name: %s", configuration.configuration.name)
70+
logger.debug("Service version: %s", __version__)
71+
logger.debug("LLama Stack version: %s", llama_stack_version)
6772
return InfoResponse(
6873
name=configuration.configuration.name,
6974
service_version=__version__,

0 commit comments

Comments
 (0)