Add GDSMetrics package

As per instructions https://github.com/alphagov/gds_metrics_python

The celery workers don't have an HTTP endpoint so no point in trying to
get prometheus to scrape them.
This commit is contained in:
David McDonald
2020-04-20 15:59:47 +01:00
parent c0343324c4
commit 1ff52bbaad
6 changed files with 22 additions and 4 deletions

View File

@@ -6,7 +6,11 @@ def test_all_routes_have_authentication(client):
blueprint_names = set(client.application.blueprints.keys())
assert blueprint_names == before_req_funcs
routes_blueprint_names = set([x.split('.')[0] for x in client.application.view_functions.keys()])
# The static route is always available by default for a Flask app to serve anything in the static folder.
routes_blueprint_names = set(
[x.split('.')[0] for x in client.application.view_functions.keys() if x.split('.')[0] != 'static'])
routes_blueprint_names.remove('static')
# The metrics route is not protected by auth as it's available to be scraped by Prometheus
routes_blueprint_names.remove('metrics')
assert sorted(blueprint_names) == sorted(routes_blueprint_names)