Skip to content

Commit ae5ecee

Browse files
authored
Revert "Backend: Integrate prometheus-django library and add django as scrape target for prometheus(#3446)" (#3510)
This reverts commit 4ac30ef.
1 parent 96c2b5e commit ae5ecee

File tree

11 files changed

+3
-49
lines changed

11 files changed

+3
-49
lines changed

.gitignore

-2
Original file line numberDiff line numberDiff line change
@@ -71,5 +71,3 @@ out/
7171
monitoring/prometheus/prometheus_db/*
7272
!monitoring/prometheus/prometheus_db/.gitkeep
7373
monitoring/grafana/grafana_db/grafana.db
74-
monitoring/prometheus/django/*
75-
!monitoring/prometheus/django/.gitkeep

docker/dev/django/uwsgi.ini

-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,3 @@ vaccum = true
88
python-autoreload = 1
99
buffer-size=32768
1010
chmod-socket = 777
11-
lazy-apps = true

docker/dev/docker.env

-2
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,3 @@ SERVICE_DNS=localhost
3535

3636
GF_SECURITY_ADMIN_USER=admin
3737
GF_SECURITY_ADMIN_PASSWORD=password
38-
39-
prometheus_multiproc_dir=/code/monitoring/prometheus/django

evalai/urls.py

-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@
9292
schema_view.with_ui("redoc", cache_timeout=0),
9393
name="schema-redoc",
9494
),
95-
url(r"^api/prometheus/", include("django_prometheus.urls")),
9695
]
9796

9897
# DJANGO-SPAGHETTI-AND-MEATBALLS URLs available during development only.

monitoring/prometheus/django/.gitkeep

Whitespace-only changes.

monitoring/prometheus/prometheus.yml

-6
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,7 @@ global:
22
scrape_interval: 30s
33
external_labels:
44
monitor: 'evalai-monitor'
5-
65
scrape_configs:
76
- job_name: 'prometheus'
87
static_configs:
98
- targets: ['localhost:9090']
10-
11-
- job_name: 'django-prometheus'
12-
metrics_path: '/api/prometheus/metrics'
13-
static_configs:
14-
- targets: ['django:8000']

requirements/common.txt

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ django==2.2.20
88
django-allauth==0.43.0
99
django-filter==2.4.0
1010
django-import-export==2.4.0
11-
django-prometheus==2.1.0
1211
djangorestframework==3.10.3
1312
djangorestframework-expiring-authtoken==0.1.4
1413
djangorestframework-simplejwt==4.6.0

settings/common.py

-2
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@
8282
INSTALLED_APPS = DEFAULT_APPS + OUR_APPS + THIRD_PARTY_APPS
8383

8484
MIDDLEWARE = [
85-
"django_prometheus.middleware.PrometheusBeforeMiddleware",
8685
"corsheaders.middleware.CorsMiddleware",
8786
"django.middleware.security.SecurityMiddleware",
8887
"django.contrib.sessions.middleware.SessionMiddleware",
@@ -91,7 +90,6 @@
9190
"django.contrib.auth.middleware.AuthenticationMiddleware",
9291
"django.contrib.messages.middleware.MessageMiddleware",
9392
"django.middleware.clickjacking.XFrameOptionsMiddleware",
94-
"django_prometheus.middleware.PrometheusAfterMiddleware",
9593
]
9694

9795
ROOT_URLCONF = "evalai.urls"

settings/custom_databases/postgres_psycopg2/base.py

-26
This file was deleted.

settings/dev.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
DATABASES = {
1313
"default": {
14-
"ENGINE": "settings.custom_databases.postgres_psycopg2",
14+
"ENGINE": "django.db.backends.postgresql_psycopg2",
1515
"NAME": os.environ.get("POSTGRES_NAME", "evalai"), # noqa: ignore=F405
1616
"USER": os.environ.get( # noqa: ignore=F405
1717
"POSTGRES_USER", "postgres"
@@ -35,7 +35,6 @@
3535

3636
# DJANGO-SPAGHETTI-AND-MEATBALLS SETTINGS
3737
INSTALLED_APPS += [ # noqa: ignore=F405
38-
"django_prometheus",
3938
"django_spaghetti",
4039
"autofixture",
4140
"debug_toolbar",

settings/prod.py

+2-6
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
DATABASES = {
2222
"default": {
23-
"ENGINE": "settings.custom_databases.postgres_psycopg2",
23+
"ENGINE": "django.db.backends.postgresql_psycopg2",
2424
"NAME": os.environ.get("RDS_DB_NAME"),
2525
"USER": os.environ.get("RDS_USERNAME"),
2626
"PASSWORD": os.environ.get("RDS_PASSWORD"),
@@ -35,11 +35,7 @@
3535

3636
MIDDLEWARE += ["middleware.metrics.DatadogMiddleware"] # noqa
3737

38-
INSTALLED_APPS += ( # noqa
39-
"storages",
40-
"raven.contrib.django.raven_compat",
41-
"django_prometheus",
42-
)
38+
INSTALLED_APPS += ("storages", "raven.contrib.django.raven_compat") # noqa
4339

4440
AWS_STORAGE_BUCKET_NAME = os.environ.get("AWS_STORAGE_BUCKET_NAME")
4541
AWS_ACCESS_KEY_ID = os.environ.get("AWS_ACCESS_KEY_ID")

0 commit comments

Comments
 (0)