]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
prometheus: Make the cache timeout configurable
authorBoris Ranto <branto@redhat.com>
Wed, 11 Jul 2018 22:55:18 +0000 (00:55 +0200)
committerBoris Ranto <branto@redhat.com>
Tue, 24 Jul 2018 19:40:59 +0000 (21:40 +0200)
Signed-off-by: Boris Ranto <branto@redhat.com>
(cherry picked from commit 84241a29535f060bb403738e46c5a0a7caf72159)

src/pybind/mgr/prometheus/module.py

index 04595c25bbb5190dc0f55e387e00b84fefd99cc8..3da275e4f6e04c4063cc189de78ea57cfc67f090 100644 (file)
@@ -343,6 +343,7 @@ class Module(MgrModule):
     OPTIONS = [
             {'name': 'server_addr'},
             {'name': 'server_port'},
+            {'name': 'scrape_interval'},
     ]
 
     def __init__(self, *args, **kwargs):
@@ -701,6 +702,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(