Commit 72e0a76b authored by Anbang Wen's avatar Anbang Wen Committed by Vladimír Čunát

modules/http: run prometheus collector on leader only

Metrics are collected and merged in http.prometheus, no need to be run
on every worker.
parent fb5991a8
...@@ -13,6 +13,11 @@ Module API changes ...@@ -13,6 +13,11 @@ Module API changes
- kr_request::qsource.tcp renamed to ::qsource.flags.tcp - kr_request::qsource.tcp renamed to ::qsource.flags.tcp
- kr_request::has_tls renamed to ::qsource.flags.tls - kr_request::has_tls renamed to ::qsource.flags.tls
Bugfixes
--------
- http module: only run prometheus in parent process if using --forks=N,
as the submodule collects metrics from all sub-processes as well.
Knot Resolver 3.1.0 (2018-11-02) Knot Resolver 3.1.0 (2018-11-02)
================================ ================================
......
...@@ -366,7 +366,10 @@ end ...@@ -366,7 +366,10 @@ end
-- @function Init module -- @function Init module
function M.init() 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 end
-- @function Cleanup module -- @function Cleanup module
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment