20 lines
529 B
Python
20 lines
529 B
Python
from prometheus_flask_exporter.multiprocess import GunicornPrometheusMetrics
|
|
|
|
from config import env_DEBUG, env_TEMP_DIR
|
|
|
|
accesslog = "-"
|
|
access_log_format = '%({X-FORWARDED-FOR}i)s %(l)s %(t)s "%(r)s" %(s)s "%(a)s"'
|
|
workers = 4
|
|
bind = "0.0.0.0:5000"
|
|
wsgi_app = "wsgi:app"
|
|
worker_tmp_dir = env_TEMP_DIR
|
|
if env_DEBUG:
|
|
loglevel = "debug"
|
|
|
|
|
|
def when_ready(_):
|
|
GunicornPrometheusMetrics.start_http_server_when_ready(9200)
|
|
|
|
|
|
def child_exit(_, worker):
|
|
GunicornPrometheusMetrics.mark_process_dead_on_child_exit(worker.pid)
|