From: Boris Ranto Date: Tue, 17 Jul 2018 14:39:38 +0000 (+0200) Subject: prometheus: Set the response header for cached response X-Git-Tag: v14.0.1~849^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F22732%2Fhead;p=ceph.git prometheus: Set the response header for cached response Signed-off-by: Boris Ranto --- diff --git a/src/pybind/mgr/prometheus/module.py b/src/pybind/mgr/prometheus/module.py index f0982b17ec1..ed7a337dcdd 100644 --- a/src/pybind/mgr/prometheus/module.py +++ b/src/pybind/mgr/prometheus/module.py @@ -640,6 +640,7 @@ class Module(MgrModule): def _metrics(self, instance): # Return cached data if available and collected before the cache times out if instance.collect_cache and time.time() - instance.collect_time < instance.collect_timeout: + cherrypy.response.headers['Content-Type'] = 'text/plain' return instance.collect_cache if instance.have_mon_connection():