diff --git a/README.md b/README.md index 6777766..6d97b42 100644 --- a/README.md +++ b/README.md @@ -26,10 +26,12 @@ Successfully tested with: ## Caveats -A short metric submission interval might cause blocking on the Nginx worker threads since the shared dictionary storing all counters has to be locked. +A short metric submission interval might cause blocking on the Nginx workers since the shared dictionary storing all counters has to be locked. Intermittent network errors while communicating with Graphite might leed to permanent loss of metric information. The communication happens in clear text and thus needs a secure separate network or other means. +If the Nginx worker elected (on Nginx startup) to run the submission loop is killed or dies no further metrics will be send until a restart. + ## Install * Install `nginx-extra` (includes Lua support) on Debian Jessie and Debian Stretch diff --git a/metrics_graphite.lua b/metrics_graphite.lua index 7f0eae7..26fc2d4 100644 --- a/metrics_graphite.lua +++ b/metrics_graphite.lua @@ -67,6 +67,7 @@ end function MetricsGraphite:worker() -- determine which worker should handle the main loop, relies on the atomicity of ngx.shared.DICT:incr -- see https://github.com/openresty/lua-nginx-module#ngxshareddict + -- caveeat: if the main loop worker dies no further metrics will be sent! if self.stats:incr("main_loop_worker", 1) ~= 1 then return end