Merge "Don't log metrics HTTP data"

This commit is contained in:
Zuul 2019-08-22 21:54:37 +00:00 committed by Gerrit Code Review
commit 0dbfdcb2e6
3 changed files with 5 additions and 4 deletions

View File

@ -27,6 +27,7 @@ from armada.handlers.tiller import Tiller
CONF = cfg.CONF
HEALTH_PATH = 'health'
METRICS_PATH = 'metrics'
class BaseResource(object):

View File

@ -18,7 +18,7 @@ from uuid import UUID
from oslo_config import cfg
from oslo_log import log as logging
from armada.api import HEALTH_PATH
from armada.api import HEALTH_PATH, METRICS_PATH
CONF = cfg.CONF
@ -107,7 +107,7 @@ class LoggingMiddleware(object):
hdr_exclude = re.compile('x-.*', re.IGNORECASE)
# don't log anything for health checks
path_exclude = re.compile('.*/{}$'.format(HEALTH_PATH))
path_exclude = re.compile('.*/({}|{})$'.format(HEALTH_PATH, METRICS_PATH))
def exclude_path(self, req):
return LoggingMiddleware.path_exclude.match(req.path)

View File

@ -18,7 +18,7 @@ from oslo_policy import policy
from oslo_log import log as logging
from armada import conf
from armada.api import ArmadaRequest, HEALTH_PATH
from armada.api import ArmadaRequest, HEALTH_PATH, METRICS_PATH
from armada.api.controller.armada import Apply
from armada.api.middleware import AuthMiddleware
from armada.api.middleware import ContextMiddleware
@ -69,7 +69,7 @@ def create(enable_middleware=CONF.middleware):
('tests', TestReleasesManifestController()),
('test/{release}', TestReleasesReleaseNameController()),
('validatedesign', Validate()),
('metrics', Metrics()),
(METRICS_PATH, Metrics()),
]
for route, service in url_routes_v1: