Skip to content

Commit

Permalink
prometheus: Set the response header for cached response
Browse files Browse the repository at this point in the history
Signed-off-by: Boris Ranto <branto@redhat.com>
  • Loading branch information
b-ranto committed Jul 17, 2018
1 parent 83565c3 commit 9130ab4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/pybind/mgr/prometheus/module.py
Expand Up @@ -640,6 +640,7 @@ def metrics(self):
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():
Expand Down

0 comments on commit 9130ab4

Please sign in to comment.