diff --git a/aurweb/prometheus.py b/aurweb/prometheus.py index 0a3dd173..a64f6b27 100644 --- a/aurweb/prometheus.py +++ b/aurweb/prometheus.py @@ -79,7 +79,7 @@ def http_requests_total() -> Callable[[Info], None]: method = scope.get("method") path = get_matching_route_path(base_scope, scope.get("router").routes) - status = str(info.response.status_code)[:1] + "xx" + status = str(int(info.response.status_code))[:1] + "xx" metric.labels(method=method, path=path, status=status).inc() diff --git a/aurweb/routers/packages.py b/aurweb/routers/packages.py index c574ec18..bcc0be56 100644 --- a/aurweb/routers/packages.py +++ b/aurweb/routers/packages.py @@ -269,7 +269,7 @@ async def package_base(request: Request, name: str) -> Response: # If this is not a split package, redirect to /packages/{name}. if pkgbase.packages.count() == 1: return RedirectResponse(f"/packages/{name}", - status_code=HTTPStatus.SEE_OTHER) + status_code=int(HTTPStatus.SEE_OTHER)) # Add our base information. context = await make_single_context(request, pkgbase)