mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-01 15:46:07 -05:00
Add a local_statsd configuration to PaaS manifest template
Running `statsd_exporter` alongside the app process allows us to get StatsD metrics pushed by workers to Prometheus. This requires adding a route to the worker instances and binding the RE prometheus discovery service. So this approach won't work for API and admin since they already have `gunicorn` bound to the `$PORT`. Since we're not ready to switch all apps to Prometheus metrics at once and we don't currently have a way to push statsd metrics to multiple destination we're using a configuration setting in the manifest template to switch individual workers in specific environments. `local_statsd` contains a list of environments where the app should use local `statsd_exporter` for pushing statsd metrics instead of HostedGraphite.
This commit is contained in:
@@ -9,8 +9,8 @@
|
|||||||
|
|
||||||
'notify-delivery-celery-beat': {'memory': '128M'},
|
'notify-delivery-celery-beat': {'memory': '128M'},
|
||||||
'notify-delivery-worker-database': {},
|
'notify-delivery-worker-database': {},
|
||||||
'notify-delivery-worker-research': {},
|
'notify-delivery-worker-research': {'local_statsd': ['preview', 'staging']},
|
||||||
'notify-delivery-worker-sender': {'disk_quota': '2G', 'memory': '3G'},
|
'notify-delivery-worker-sender': {'disk_quota': '2G', 'memory': '3G', 'local_statsd': ['preview', 'staging']},
|
||||||
'notify-delivery-worker-periodic': {},
|
'notify-delivery-worker-periodic': {},
|
||||||
'notify-delivery-worker-priority': {},
|
'notify-delivery-worker-priority': {},
|
||||||
'notify-delivery-worker': {},
|
'notify-delivery-worker': {},
|
||||||
@@ -37,6 +37,10 @@ applications:
|
|||||||
{%- for route in app['routes'][environment] %}
|
{%- for route in app['routes'][environment] %}
|
||||||
- route: {{ route }}
|
- route: {{ route }}
|
||||||
{%- endfor -%}
|
{%- endfor -%}
|
||||||
|
{%- elif environment in app.get('local_statsd', []) -%}
|
||||||
|
health-check-type: none
|
||||||
|
routes:
|
||||||
|
- route: {{ CF_APP }}-{{ environment }}.cloudapps.digital
|
||||||
{%- else -%}
|
{%- else -%}
|
||||||
health-check-type: none
|
health-check-type: none
|
||||||
no-route: true
|
no-route: true
|
||||||
@@ -45,6 +49,7 @@ applications:
|
|||||||
services:
|
services:
|
||||||
- notify-db
|
- notify-db
|
||||||
- logit-ssl-syslog-drain
|
- logit-ssl-syslog-drain
|
||||||
|
{% if environment in app.get('local_statsd', []) %}- notify-prometheus{% endif %}
|
||||||
|
|
||||||
env:
|
env:
|
||||||
NOTIFY_APP_NAME: {{ app.get('NOTIFY_APP_NAME', CF_APP.replace('notify-', '')) }}
|
NOTIFY_APP_NAME: {{ app.get('NOTIFY_APP_NAME', CF_APP.replace('notify-', '')) }}
|
||||||
@@ -70,7 +75,13 @@ applications:
|
|||||||
AWS_ACCESS_KEY_ID: '{{ AWS_ACCESS_KEY_ID }}'
|
AWS_ACCESS_KEY_ID: '{{ AWS_ACCESS_KEY_ID }}'
|
||||||
AWS_SECRET_ACCESS_KEY: '{{ AWS_SECRET_ACCESS_KEY }}'
|
AWS_SECRET_ACCESS_KEY: '{{ AWS_SECRET_ACCESS_KEY }}'
|
||||||
|
|
||||||
|
{% if environment in app.get('local_statsd', []) %}
|
||||||
|
STATSD_HOST: "localhost"
|
||||||
|
STATSD_PREFIX: ""
|
||||||
|
{% else %}
|
||||||
|
STATSD_HOST: "statsd.hostedgraphite.com"
|
||||||
STATSD_PREFIX: '{{ STATSD_PREFIX }}'
|
STATSD_PREFIX: '{{ STATSD_PREFIX }}'
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
ZENDESK_API_KEY: '{{ ZENDESK_API_KEY }}'
|
ZENDESK_API_KEY: '{{ ZENDESK_API_KEY }}'
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user