Features: Prometheus addons

This commit is contained in:
Egor Pavlovich Gorbunov 2025-06-05 16:02:32 +03:00
parent 4163606f0c
commit e800bbab15
6 changed files with 6 additions and 6 deletions

View file

@ -11,7 +11,7 @@ from core.views import CustomGraphQLView, CustomRedocView, CustomSwaggerView, fa
from evibes.settings import SPECTACULAR_PLATFORM_SETTINGS
urlpatterns = [
path('', include('django_prometheus.urls')),
path('prometheus/', include('django_prometheus.urls')),
path(r"graphql/", csrf_exempt(CustomGraphQLView.as_view(graphiql=True, schema=schema))),
path(
r"docs/",

View file

@ -8,7 +8,7 @@ from evibes.settings import SPECTACULAR_B2B_SETTINGS
urlpatterns = [
# path(r'graphql/', csrf_exempt(CustomGraphQLView.as_view(graphiql=True, schema=schema))),
path('', include('django_prometheus.urls')),
path('prometheus/', include('django_prometheus.urls')),
path(
r"docs/",
SpectacularAPIView.as_view(urlconf="evibes.b2b_urls", custom_settings=SPECTACULAR_B2B_SETTINGS),

View file

@ -113,6 +113,7 @@ MIDDLEWARE = [
"evibes.middleware.CustomLocaleMiddleware",
"django_hosts.middleware.HostsResponseMiddleware",
"djangorestframework_camel_case.middleware.CamelCaseMiddleWare",
"django_prometheus.middleware.PrometheusAfterMiddleware"
]
TEMPLATES = [
@ -290,7 +291,6 @@ if getenv("SENTRY_DSN"):
from sentry_sdk.integrations.redis import RedisIntegration
ignore_errors = [
"flower.views.error.NotFoundErrorHandler",
"django.http.response.Http404",
"django.core.exceptions.PermissionDenied",
"django.core.exceptions.BadRequest",

View file

@ -4,7 +4,7 @@ from evibes.settings.base import REDIS_PASSWORD, getenv
CACHES = {
"default": {
"BACKEND": "django_redis.cache.RedisCache",
"BACKEND": "django_prometheus.cache.backends.redis",
"LOCATION": getenv("CELERY_BROKER_URL", f"redis://:{REDIS_PASSWORD}@redis:6379/0"),
"OPTIONS": {
"CLIENT_CLASS": "django_redis.client.DefaultClient",

View file

@ -2,7 +2,7 @@ from evibes.settings.base import * # noqa: F403
DATABASES = {
"default": {
"ENGINE": "django.contrib.gis.db.backends.postgis",
"ENGINE": "django_prometheus.db.backends.postgis",
"NAME": getenv("POSTGRES_DB"), # noqa: F405
"USER": getenv("POSTGRES_USER"), # noqa: F405
"PASSWORD": getenv("POSTGRES_PASSWORD"), # noqa: F405

View file

@ -14,7 +14,7 @@ six = "1.17.0"
cryptography = "44.0.3"
redis = "6.0.0"
httpx = "0.28.1"
celery = { extras = ["flower"], version = "5.5.2", optional = true }
celery = { version = "5.5.2", optional = true }
pillow = "11.2.1"
south = "1.0.2"
pygraphviz = { version = "1.14", optional = true }