Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert breaking prometheus changes to gunicorn_conf.py #26911

Merged
merged 1 commit into from
Mar 19, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions deployment/gunicorn/gunicorn_conf.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import glob
import os

preload_app = True
worker_class = 'gevent'
keepalive = 60
Expand All @@ -21,15 +18,3 @@ def post_fork(server, worker):
# see: https://github.com/benoitc/gunicorn/issues/527#issuecomment-19601046
from django.urls import resolve
resolve('/')


def on_starting(server):
"""Wipe the metrics from previous processes"""
path = os.environ.get('prometheus_multiproc_dir')
for f in glob.glob(os.path.join(path, '*.db')):
os.remove(f)


def child_exit(server, worker):
from prometheus_client import multiprocess
multiprocess.mark_process_dead(worker.pid)