Skip to content

Commit 43222f2

Browse files
robhowleyRob Howley
andauthored
feat: Add health endpoint to py server (#3202)
feat: add health endpoint to py server Signed-off-by: Rob Howley <[email protected]> Signed-off-by: Rob Howley <[email protected]> Co-authored-by: Rob Howley <[email protected]>
1 parent cdf0faf commit 43222f2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

sdk/python/feast/feature_server.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import pandas as pd
66
import uvicorn
7-
from fastapi import FastAPI, HTTPException, Request
7+
from fastapi import FastAPI, HTTPException, Request, Response, status
88
from fastapi.logger import logger
99
from fastapi.params import Depends
1010
from google.protobuf.json_format import MessageToDict, Parse
@@ -124,6 +124,10 @@ def write_to_online_store(body=Depends(get_body)):
124124
# Raise HTTPException to return the error message to the client
125125
raise HTTPException(status_code=500, detail=str(e))
126126

127+
@app.get("/health")
128+
def health():
129+
return Response(status_code=status.HTTP_200_OK)
130+
127131
return app
128132

129133

0 commit comments

Comments
 (0)