From: Anbang Wen Date: Tue, 10 Jul 2018 08:02:59 +0000 (-0700) Subject: http: run prometheus metrics collector on leader only X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a058a4159596eaee3ef6529103f72fd4995490c7;p=thirdparty%2Fknot-resolver.git http: run prometheus metrics collector on leader only Metrics are collected and merged in http.prometheus, no need to be run on every worker. --- diff --git a/modules/http/http.lua b/modules/http/http.lua index e4baf8fdd..a81935997 100644 --- a/modules/http/http.lua +++ b/modules/http/http.lua @@ -366,7 +366,10 @@ end -- @function Init module function M.init() - worker.coroutine(prometheus.init) + -- collect and merge metrics only on leader + if worker.id == 0 then + worker.coroutine(prometheus.init) + end end -- @function Cleanup module