You've already forked RekomenciBackend
feat: instrumented backend with prometheus endpoint
This commit is contained in:
@@ -15,6 +15,7 @@ dependencies = [
|
||||
"httpx==0.28.1",
|
||||
"psycopg[binary]>=3.2.12",
|
||||
"firebase-admin>=7.1.0",
|
||||
"prometheus-fastapi-instrumentator>=7.1.0",
|
||||
]
|
||||
|
||||
[dependency-groups]
|
||||
|
||||
@@ -15,6 +15,7 @@ from dishka.integrations.fastapi import setup_dishka
|
||||
from fastapi import FastAPI
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
from firebase_admin import credentials
|
||||
from prometheus_fastapi_instrumentator import Instrumentator
|
||||
|
||||
from template_project.web_api.configuration import Configuration, load_configuration
|
||||
from template_project.web_api.ioc.make import make_ioc
|
||||
@@ -72,6 +73,7 @@ def make_asgi_application(
|
||||
app.include_router(healthcheck.router)
|
||||
app.include_router(profile.router)
|
||||
app.include_router(notification.router)
|
||||
Instrumentator().instrument(app).expose(app)
|
||||
|
||||
setup_dishka(container=ioc, app=app)
|
||||
|
||||
|
||||
@@ -975,6 +975,28 @@ wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/54/20/4d324d65cc6d9205fabedc306948156824eb9f0ee1633355a8f7ec5c66bf/pluggy-1.6.0-py3-none-any.whl", hash = "sha256:e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746", size = 20538, upload-time = "2025-05-15T12:30:06.134Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "prometheus-client"
|
||||
version = "0.23.1"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/23/53/3edb5d68ecf6b38fcbcc1ad28391117d2a322d9a1a3eff04bfdb184d8c3b/prometheus_client-0.23.1.tar.gz", hash = "sha256:6ae8f9081eaaaf153a2e959d2e6c4f4fb57b12ef76c8c7980202f1e57b48b2ce", size = 80481, upload-time = "2025-09-18T20:47:25.043Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/b8/db/14bafcb4af2139e046d03fd00dea7873e48eafe18b7d2797e73d6681f210/prometheus_client-0.23.1-py3-none-any.whl", hash = "sha256:dd1913e6e76b59cfe44e7a4b83e01afc9873c1bdfd2ed8739f1e76aeca115f99", size = 61145, upload-time = "2025-09-18T20:47:23.875Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "prometheus-fastapi-instrumentator"
|
||||
version = "7.1.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "prometheus-client" },
|
||||
{ name = "starlette" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/69/6d/24d53033cf93826aa7857699a4450c1c67e5b9c710e925b1ed2b320c04df/prometheus_fastapi_instrumentator-7.1.0.tar.gz", hash = "sha256:be7cd61eeea4e5912aeccb4261c6631b3f227d8924542d79eaf5af3f439cbe5e", size = 20220, upload-time = "2025-03-19T19:35:05.351Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/27/72/0824c18f3bc75810f55dacc2dd933f6ec829771180245ae3cc976195dec0/prometheus_fastapi_instrumentator-7.1.0-py3-none-any.whl", hash = "sha256:978130f3c0bb7b8ebcc90d35516a6fe13e02d2eb358c8f83887cdef7020c31e9", size = 19296, upload-time = "2025-03-19T19:35:04.323Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "proto-plus"
|
||||
version = "1.26.1"
|
||||
@@ -1406,6 +1428,7 @@ dependencies = [
|
||||
{ name = "fastapi" },
|
||||
{ name = "firebase-admin" },
|
||||
{ name = "httpx" },
|
||||
{ name = "prometheus-fastapi-instrumentator" },
|
||||
{ name = "psycopg", extra = ["binary"] },
|
||||
{ name = "sqlalchemy" },
|
||||
{ name = "uuid-utils" },
|
||||
@@ -1452,6 +1475,7 @@ requires-dist = [
|
||||
{ name = "fastapi", specifier = "==0.119.0" },
|
||||
{ name = "firebase-admin", specifier = ">=7.1.0" },
|
||||
{ name = "httpx", specifier = "==0.28.1" },
|
||||
{ name = "prometheus-fastapi-instrumentator", specifier = ">=7.1.0" },
|
||||
{ name = "psycopg", extras = ["binary"], specifier = ">=3.2.12" },
|
||||
{ name = "sqlalchemy", specifier = "==2.0.44" },
|
||||
{ name = "uuid-utils", specifier = "==0.11.1" },
|
||||
|
||||
Reference in New Issue
Block a user