Skip to content

Commit

Permalink
adding instrumentator in fastapi
Browse files Browse the repository at this point in the history
  • Loading branch information
Chandru-21 committed Jun 28, 2024
1 parent 80b3114 commit 1b1f118
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 5 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -136,4 +136,7 @@ async def batch_predict(file: UploadFile = File(...)):


if __name__== "__main__":
uvicorn.run(app, host="0.0.0.0",port=8005)
uvicorn.run(app, host="0.0.0.0",port=8005)


Instrumentator().instrument(app).expose(app)
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
python-multipart==0.0.9
prometheus_fastapi_instrumentator

0 comments on commit 1b1f118

Please sign in to comment.