From 9130ab40b3dc375fda7277146c350a97d7f73f16 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 --- 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 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(): -- 2.39.5