]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
prometheus: Set the response header for cached response
authorBoris Ranto <branto@redhat.com>
Tue, 17 Jul 2018 14:39:38 +0000 (16:39 +0200)
committerBoris Ranto <branto@redhat.com>
Tue, 17 Jul 2018 20:29:00 +0000 (22:29 +0200)
Signed-off-by: Boris Ranto <branto@redhat.com>
src/pybind/mgr/prometheus/module.py

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