Unverified Commit c44f2869 authored by lambert0312's avatar lambert0312 Committed by GitHub
Browse files

Modify metrics service endpoint (#3443)

parent 685d8980
...@@ -784,6 +784,8 @@ def add_api_key_middleware(app, api_key: str): ...@@ -784,6 +784,8 @@ def add_api_key_middleware(app, api_key: str):
return await call_next(request) return await call_next(request)
if request.url.path.startswith("/health"): if request.url.path.startswith("/health"):
return await call_next(request) return await call_next(request)
if request.url.path.startswith("/metrics"):
return await call_next(request)
if request.headers.get("Authorization") != "Bearer " + api_key: if request.headers.get("Authorization") != "Bearer " + api_key:
return ORJSONResponse(content={"error": "Unauthorized"}, status_code=401) return ORJSONResponse(content={"error": "Unauthorized"}, status_code=401)
return await call_next(request) return await call_next(request)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment