mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-01 12:19:47 -04:00
Add GDS metrics package to admin app
Follows the code from the API
This commit is contained in:
@@ -24,6 +24,7 @@ from flask.globals import _lookup_req_object, _request_ctx_stack
|
||||
from flask_login import LoginManager, current_user
|
||||
from flask_wtf import CSRFProtect
|
||||
from flask_wtf.csrf import CSRFError
|
||||
from gds_metrics import GDSMetrics
|
||||
from govuk_frontend_jinja.flask_ext import init_govuk_frontend
|
||||
from itsdangerous import BadSignature
|
||||
from notifications_python_client.errors import HTTPError
|
||||
@@ -94,6 +95,7 @@ from app.utils import format_thousands, get_logo_cdn_domain, id_safe
|
||||
|
||||
login_manager = LoginManager()
|
||||
csrf = CSRFProtect()
|
||||
metrics = GDSMetrics()
|
||||
|
||||
|
||||
# The current service attached to the request stack.
|
||||
@@ -132,6 +134,7 @@ def create_app(application):
|
||||
# Gubbins
|
||||
csrf,
|
||||
login_manager,
|
||||
metrics,
|
||||
proxy_fix,
|
||||
request_helper,
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ class Navigation:
|
||||
def endpoints_without_navigation(self):
|
||||
return tuple(
|
||||
self._get_endpoint_with_blueprint(endpoint) for endpoint in self.exclude
|
||||
) + ('static', 'status.show_status')
|
||||
) + ('static', 'status.show_status', 'metrics')
|
||||
|
||||
def is_selected(self, navigation_item):
|
||||
if request.endpoint in self.mapping[navigation_item]:
|
||||
|
||||
@@ -4,6 +4,8 @@ import traceback
|
||||
|
||||
import gunicorn
|
||||
|
||||
from gds_metrics.gunicorn import child_exit # noqa
|
||||
|
||||
workers = 5
|
||||
worker_class = "eventlet"
|
||||
errorlog = "/home/vcap/logs/gunicorn_error.log"
|
||||
|
||||
@@ -31,6 +31,7 @@ applications:
|
||||
|
||||
services:
|
||||
- logit-ssl-syslog-drain
|
||||
- notify-prometheus
|
||||
|
||||
env:
|
||||
NOTIFY_APP_NAME: admin
|
||||
|
||||
@@ -25,3 +25,7 @@ itsdangerous==1.1.0
|
||||
|
||||
git+https://github.com/alphagov/notifications-utils.git@39.7.0#egg=notifications-utils==39.7.0
|
||||
git+https://github.com/alphagov/govuk-frontend-jinja.git@v0.5.1-alpha#egg=govuk-frontend-jinja==0.5.1-alpha
|
||||
|
||||
# gds-metrics requires prometheseus 0.2.0, override that requirement as later versions bring significant performance gains
|
||||
prometheus-client==0.8.0
|
||||
gds-metrics==0.2.0
|
||||
|
||||
@@ -28,11 +28,15 @@ itsdangerous==1.1.0
|
||||
git+https://github.com/alphagov/notifications-utils.git@39.7.0#egg=notifications-utils==39.7.0
|
||||
git+https://github.com/alphagov/govuk-frontend-jinja.git@v0.5.1-alpha#egg=govuk-frontend-jinja==0.5.1-alpha
|
||||
|
||||
# gds-metrics requires prometheseus 0.2.0, override that requirement as later versions bring significant performance gains
|
||||
prometheus-client==0.8.0
|
||||
gds-metrics==0.2.0
|
||||
|
||||
## The following requirements were added by pip freeze:
|
||||
awscli==1.18.84
|
||||
awscli==1.18.90
|
||||
bleach==3.1.4
|
||||
boto3==1.10.38
|
||||
botocore==1.17.7
|
||||
botocore==1.17.13
|
||||
cachetools==4.1.0
|
||||
certifi==2020.6.20
|
||||
chardet==3.0.4
|
||||
@@ -45,7 +49,7 @@ et-xmlfile==1.0.1
|
||||
flask-redis==0.4.0
|
||||
future==0.18.2
|
||||
greenlet==0.4.16
|
||||
idna==2.9
|
||||
idna==2.10
|
||||
jdcal==1.4.1
|
||||
Jinja2==2.11.2
|
||||
jmespath==0.10.0
|
||||
@@ -54,7 +58,7 @@ lxml==4.5.1
|
||||
MarkupSafe==1.1.1
|
||||
mistune==0.8.4
|
||||
monotonic==1.5
|
||||
openpyxl==3.0.3
|
||||
openpyxl==3.0.4
|
||||
orderedset==2.0.1
|
||||
phonenumbers==8.11.2
|
||||
pyasn1==0.4.8
|
||||
|
||||
Reference in New Issue
Block a user