From 2c58b7845ab24834a7914ac719698685cd468a19 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Vavru=C5=A1a?= Date: Mon, 7 Aug 2017 22:00:32 -0700 Subject: [PATCH] modules/http: fix compatibility with the Prometheus text format The Prometheus text format requires histogram parameters to be quoted, and the result to end with an empty newline characted. --- modules/http/prometheus.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/http/prometheus.lua b/modules/http/prometheus.lua index 3831b3d29..ad9d20e60 100644 --- a/modules/http/prometheus.lua +++ b/modules/http/prometheus.lua @@ -133,11 +133,11 @@ local function serve_prometheus() -- as a timeout (3000ms) for metrics purposes count = count + e[2] sum = sum + e[2] * (math.min(tonumber(e[1]), 3000.0)) - table.insert(render, string.format('latency_bucket{le=%s} %f', e[1], count)) + table.insert(render, string.format('latency_bucket{le="%s"} %f', e[1], count)) end table.insert(render, string.format('latency_count %f', count)) table.insert(render, string.format('latency_sum %f', sum)) - return table.concat(render, '\n') + return table.concat(render, '\n') .. '\n' end -- Export endpoints -- 2.47.2