From 6cf21d3c2f0030ef7517c8a18367cfa49c8d130f Mon Sep 17 00:00:00 2001 From: dabue <53054094+dabue@users.noreply.github.com> Date: Thu, 28 May 2020 23:41:59 +0800 Subject: [PATCH] bugfix(prometheus): the `overhead` should use milliseconds. #1615 (#1616) Fix #1615 --- apisix/plugins/prometheus/exporter.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apisix/plugins/prometheus/exporter.lua b/apisix/plugins/prometheus/exporter.lua index de72910c2a07..2c0b6fc618ab 100644 --- a/apisix/plugins/prometheus/exporter.lua +++ b/apisix/plugins/prometheus/exporter.lua @@ -110,7 +110,7 @@ function _M.log(conf, ctx) local overhead = latency if ctx.var.upstream_response_time then - overhead = overhead - tonumber(ctx.var.upstream_response_time) + overhead = overhead - tonumber(ctx.var.upstream_response_time) * 1000 end metrics.overhead:observe(overhead, gen_arr("request", service_id, balancer_ip))