]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
modules/http: some metrics are treated as gauges
authorMarek Vavrusa <marek@vavrusa.com>
Fri, 24 Jun 2016 23:23:56 +0000 (16:23 -0700)
committerMarek Vavrusa <marek@vavrusa.com>
Wed, 6 Jul 2016 06:33:38 +0000 (23:33 -0700)
modules/http/prometheus.lua

index 90d95442b9f713f4dac638a240c876a56f108f3e..c7378fed8e8ae858e0a80df65842209af8a31fa1 100644 (file)
@@ -1,6 +1,11 @@
 local cqueues = require('cqueues')
 local snapshots, snapshots_count = {}, 120
 
+-- Gauge metrics
+local gauges = {
+       ['worker.concurrent'] = true,
+}
+
 -- Load dependent modules
 if not stats then modules.load('stats') end
 
@@ -23,7 +28,11 @@ local function snapshot_start(h, ws)
                -- Get current snapshot
                local cur, stats_dt = getstats(), {}
                for k,v in pairs(cur) do
-                       stats_dt[k] = v - (prev[k] or 0)
+                       if gauges[k] then
+                               stats_dt[k] = v
+                       else
+                               stats_dt[k] = v - (prev[k] or 0)
+                       end
                        is_empty = is_empty and stats_dt[k] == 0
                end
                prev = cur