From 0bdb58b0a53168490802f7d9fef867a11d0624de Mon Sep 17 00:00:00 2001 From: Boris Ranto Date: Tue, 17 Jul 2018 16:39:38 +0200 Subject: [PATCH] prometheus: Set the response header for cached response Signed-off-by: Boris Ranto (cherry picked from commit 9130ab40b3dc375fda7277146c350a97d7f73f16) --- src/pybind/mgr/prometheus/module.py | 1 + 1 file changed, 1 insertion(+) 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(): -- 2.47.3