Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions model-engine/model_engine_server/api/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class CustomMiddleware(BaseHTTPMiddleware):
async def dispatch(self, request: Request, call_next):
try:
LoggerTagManager.set(LoggerTagKey.REQUEST_ID, str(uuid.uuid4()))
LoggerTagManager.set(LoggerTagKey.REQUEST_SIZE, request.headers.get("content-length"))
# we intentionally exclude healthcheck routes from the concurrency limiter
if request.url.path in healthcheck_routes:
return await call_next(request)
Expand Down
1 change: 1 addition & 0 deletions model-engine/model_engine_server/core/loggers.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class LoggerTagKey(str, Enum):
REQUEST_ID = "request_id"
TEAM_ID = "team_id"
USER_ID = "user_id"
REQUEST_SIZE = "request_size"


class LoggerTagManager:
Expand Down