mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-15 01:32:20 -05:00
We moved from sending statsd metrics to hosted graphite to sending to one that is running on the paas. Therefore we no longer need to send statsd metrics to a particular prefix at the statsd app as it is only receiving statsd metrics from our apps (not other users like would have been the case with HostedGraphite). This should change no behaviour as the only place the environment variable was being used was in the gunicorn config and it was an empty string which is the default behaviour anyway as per: https://docs.gunicorn.org/en/stable/settings.html#statsd-prefix
31 lines
766 B
Python
31 lines
766 B
Python
import os
|
|
import sys
|
|
import traceback
|
|
import gunicorn
|
|
|
|
workers = 4
|
|
worker_class = "eventlet"
|
|
worker_connections = 256
|
|
errorlog = "/home/vcap/logs/gunicorn_error.log"
|
|
bind = "0.0.0.0:{}".format(os.getenv("PORT"))
|
|
statsd_host = "{}:8125".format(os.getenv("STATSD_HOST"))
|
|
gunicorn.SERVER_SOFTWARE = 'None'
|
|
|
|
|
|
def on_starting(server):
|
|
server.log.info("Starting Notifications API")
|
|
|
|
|
|
def worker_abort(worker):
|
|
worker.log.info("worker received ABORT {}".format(worker.pid))
|
|
for threadId, stack in sys._current_frames().items():
|
|
worker.log.error(''.join(traceback.format_stack(stack)))
|
|
|
|
|
|
def on_exit(server):
|
|
server.log.info("Stopping Notifications API")
|
|
|
|
|
|
def worker_int(worker):
|
|
worker.log.info("worker: received SIGINT {}".format(worker.pid))
|