From: Vsevolod Stakhov Date: Fri, 22 Dec 2017 18:24:39 +0000 (+0000) Subject: [Fix] Fix clickhouse exporter X-Git-Tag: 1.7.0~323 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=0daddc29cab716e143d0c037b122774b67bff720;p=rspamd.git [Fix] Fix clickhouse exporter --- diff --git a/src/plugins/lua/clickhouse.lua b/src/plugins/lua/clickhouse.lua index 84a479b46..aae6f20b7 100644 --- a/src/plugins/lua/clickhouse.lua +++ b/src/plugins/lua/clickhouse.lua @@ -250,12 +250,12 @@ end local function clickhouse_send_data(task) local upstream = settings.upstream:get_upstream_round_robin() - local ip_addr = tostring(upstream:get_addr()) + local ip_addr = upstream:get_addr():to_string(true) local function http_cb(err_message, code, _, _) if code ~= 200 or err_message then - rspamd_logger.errx(task, "cannot send data to clickhouse server %s: %s:%s", - ip_addr, code, err_message) + rspamd_logger.errx(task, "cannot send data to clickhouse server %s: %s", + ip_addr, err_message) upstream:fail() else rspamd_logger.infox(task, "sent %s rows to clickhouse server %s", @@ -688,12 +688,12 @@ if opts then rspamd_config:add_on_load(function(cfg, ev_base, worker) -- XXX: need to call this script for all upstreams local upstream = settings.upstream:get_upstream_round_robin() - local ip_addr = tostring(upstream:get_addr()) + local ip_addr = upstream:get_addr():to_string(true) local function http_cb(err_message, code, _, _) if code ~= 200 or err_message then - rspamd_logger.errx(rspamd_config, "cannot create table in clickhouse server %s: %s:%s", - ip_addr, code, err_message) + rspamd_logger.errx(rspamd_config, "cannot create table in clickhouse server %s: %s", + ip_addr, err_message) upstream:fail() else upstream:ok()