Skip to content

Commit c568267

Browse files
committed
fix: update lock file with corrected upload-time fields
1 parent 10d6a7e commit c568267

File tree

3 files changed

+3143
-3119
lines changed

3 files changed

+3143
-3119
lines changed

backend/main.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from fastapi.routing import APIRoute
1111
from starlette.middleware.cors import CORSMiddleware
1212
from dotenv import load_dotenv
13+
from prometheus_fastapi_instrumentator import Instrumentator
1314

1415
from app.api.main import api_router
1516
from app.core.config import settings, Environment
@@ -60,7 +61,9 @@
6061

6162

6263
def custom_generate_unique_id(route: APIRoute) -> str:
63-
return f"{route.tags[0]}-{route.name}"
64+
if route.tags and len(route.tags) > 0:
65+
return f"{route.tags[0]}-{route.name}"
66+
return f"api-{route.name}"
6467

6568

6669
if settings.SENTRY_DSN and settings.ENVIRONMENT != "local":
@@ -118,6 +121,11 @@ async def identify_browser(request: Request, call_next):
118121

119122
app.include_router(api_router, prefix=settings.API_V1_STR)
120123

124+
# Setup Prometheus instrumentation
125+
Instrumentator().instrument(app).expose(
126+
app, endpoint="/metrics", include_in_schema=True
127+
)
128+
121129

122130
@click.group(context_settings={"max_content_width": 150})
123131
def cli():

backend/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ dependencies = [
6969
"socksio>=1.0.0",
7070
"dspy>=2.6.21",
7171
"litellm>=1.67.4",
72+
"prometheus-fastapi-instrumentator>=7.1.0",
7273
]
7374

7475

0 commit comments

Comments
 (0)