Skip to content

Commit

Permalink
fix: metrics header (#103)
Browse files Browse the repository at this point in the history
Co-authored-by: leoguillaume <[email protected]>
  • Loading branch information
leoguillaume and leoguillaumegouv authored Dec 5, 2024
1 parent 190665b commit a1cc34f
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions app/helpers/_metricsmiddleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ async def dispatch(self, request: Request, call_next) -> Response:
body = body.decode(encoding="utf-8")
model = json.loads(body).get("model") if body else None

user_id = AuthenticationClient._api_key_to_user_id(input=authorization.split(sep=" ")[1])

if authorization and authorization.startswith("Bearer "):
user_id = AuthenticationClient._api_key_to_user_id(input=authorization.split(sep=" ")[1])
self.http_requests_by_user.labels(user=user_id, endpoint=endpoint[3:], model=model).inc()
Expand Down

0 comments on commit a1cc34f

Please sign in to comment.