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: v13.2.2~49^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0bdb58b0a53168490802f7d9fef867a11d0624de;p=ceph.git prometheus: Set the response header for cached response Signed-off-by: Boris Ranto (cherry picked from commit 9130ab40b3dc375fda7277146c350a97d7f73f16) --- diff --git a/src/pybind/mgr/prometheus/module.py b/src/pybind/mgr/prometheus/module.py index e016a990a135..ad5838b382d0 100644 --- a/src/pybind/mgr/prometheus/module.py +++ b/src/pybind/mgr/prometheus/module.py @@ -672,6 +672,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():