]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
prometheus: Set the response header for cached response 23215/head
authorBoris Ranto <branto@redhat.com>
Tue, 17 Jul 2018 14:39:38 +0000 (16:39 +0200)
committerBoris Ranto <branto@redhat.com>
Tue, 24 Jul 2018 19:42:06 +0000 (21:42 +0200)
Signed-off-by: Boris Ranto <branto@redhat.com>
(cherry picked from commit 9130ab40b3dc375fda7277146c350a97d7f73f16)

src/pybind/mgr/prometheus/module.py

index e016a990a1355d49000cba03f2e4e547fa543f8a..ad5838b382d0b30d783536421d4645776de21540 100644 (file)
@@ -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():