Disable Flask logs of metrics calls

We don't need to log every successful /metrics call on INFO level. This
commit switches the log level there to WARNING.

Change-Id: I3bc0e1c9e312381715f60a00ad8f52dbd601bb2f
This commit is contained in:
Michał Dulko 2021-06-17 17:54:49 +02:00 committed by Robin Cernin
parent fcc71cee92
commit 291821cbf6
2 changed files with 6 additions and 0 deletions

View File

@ -46,6 +46,9 @@ class CNIPrometheusExporter(object):
return flask.Response(collected_metric, mimetype='text/plain')
def run(self):
# Disable obtrusive werkzeug logs.
logging.getLogger('werkzeug').setLevel(logging.WARNING)
address = '::'
try:
LOG.info('Starting CNI Prometheus exporter')

View File

@ -66,6 +66,9 @@ class ControllerPrometheusExporter(object):
return ControllerPrometheusExporter.instance
def run(self):
# Disable obtrusive werkzeug logs.
logging.getLogger('werkzeug').setLevel(logging.WARNING)
address = '::'
try:
LOG.info('Starting Prometheus exporter')