From: Boris Ranto Date: Wed, 11 Jul 2018 22:55:18 +0000 (+0200) Subject: prometheus: Make the cache timeout configurable X-Git-Tag: v14.0.1~849^2~6 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=84241a29535f060bb403738e46c5a0a7caf72159;p=ceph-ci.git prometheus: Make the cache timeout configurable Signed-off-by: Boris Ranto --- diff --git a/src/pybind/mgr/prometheus/module.py b/src/pybind/mgr/prometheus/module.py index 3b556b9f3f3..a465eaed256 100644 --- a/src/pybind/mgr/prometheus/module.py +++ b/src/pybind/mgr/prometheus/module.py @@ -311,6 +311,7 @@ class Module(MgrModule): OPTIONS = [ {'name': 'server_addr'}, {'name': 'server_port'}, + {'name': 'scrape_interval'}, ] def __init__(self, *args, **kwargs): @@ -669,6 +670,9 @@ class Module(MgrModule): else: raise cherrypy.HTTPError(503, 'No MON connection') + # Make the cache timeout for collecting configurable + self.collect_timeout = self.get_localized_config('scrape_interval', 5.0) + server_addr = self.get_localized_config('server_addr', DEFAULT_ADDR) server_port = self.get_localized_config('server_port', DEFAULT_PORT) self.log.info(