From 939a532e1f832d92821d32fb8d67604a41266151 Mon Sep 17 00:00:00 2001 From: mtrempoltsev Date: Fri, 14 Sep 2018 11:17:48 +0300 Subject: [PATCH] fix prometheus true/false parsing --- rockspecs/prometheus-1.1.0.rockspec | 22 ---------------------- tarantool-metrics.lua | 6 +++++- 2 files changed, 5 insertions(+), 23 deletions(-) delete mode 100644 rockspecs/prometheus-1.1.0.rockspec diff --git a/rockspecs/prometheus-1.1.0.rockspec b/rockspecs/prometheus-1.1.0.rockspec deleted file mode 100644 index c004c0e..0000000 --- a/rockspecs/prometheus-1.1.0.rockspec +++ /dev/null @@ -1,22 +0,0 @@ -package = 'prometheus' -version = '1.1.0' -source = { - url = 'git://github.com/tarantool/prometheus.git', - tag = '1.1.0', -} -description = { - summary = 'Prometheus library to collect metrics from Tarantool', - homepage = 'https://github.com/tarantool/prometheus.git', - license = 'BSD', -} -dependencies = { - 'lua >= 5.1'; -} -build = { - type = 'builtin', - - modules = { - ['prometheus.tarantool-metrics'] = 'tarantool-metrics.lua', - ['prometheus'] = 'prometheus.lua' - } -} diff --git a/tarantool-metrics.lua b/tarantool-metrics.lua index d27c25a..80f4588 100755 --- a/tarantool-metrics.lua +++ b/tarantool-metrics.lua @@ -91,7 +91,11 @@ local function measure_tarantool_replication_lag() if idle ~= 0 then local replication_timeout = box.cfg.replication_timeout - replication_state_normal:set(idle <= replication_timeout) + if idle <= replication_timeout then + replication_state_normal:set(1) + else + replication_state_normal:set(0) + end end end