diff --git a/main.py b/main.py index 00ab622..54c363b 100644 --- a/main.py +++ b/main.py @@ -11,7 +11,7 @@ import io import boto3 from datetime import datetime - +from prometheus_fastapi_instrumentator import Instrumentator def upload_to_s3(file_content, filename): s3 = boto3.client('s3') @@ -136,4 +136,7 @@ async def batch_predict(file: UploadFile = File(...)): if __name__== "__main__": - uvicorn.run(app, host="0.0.0.0",port=8005) \ No newline at end of file + uvicorn.run(app, host="0.0.0.0",port=8005) + + +Instrumentator().instrument(app).expose(app) \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index d4f90f2..d002b36 100644 --- a/requirements.txt +++ b/requirements.txt @@ -12,4 +12,5 @@ gunicorn==21.2.0 hyperopt==0.2.7 mlflow==2.13.2 xgboost==2.0.3 -python-multipart==0.0.9 \ No newline at end of file +python-multipart==0.0.9 +prometheus_fastapi_instrumentator