From a5b09436f09072253d6a9e3e86f1797171e0129f Mon Sep 17 00:00:00 2001 From: Julien Riou Date: Fri, 26 Mar 2021 08:12:08 +0100 Subject: [PATCH] [telegraf] Add pool statistics for Flexpool Signed-off-by: Julien Riou --- .../{flexpool.conf => flexpool-miner.conf} | 7 --- telegraf/flexpool-pool.conf | 61 +++++++++++++++++++ 2 files changed, 61 insertions(+), 7 deletions(-) rename telegraf/{flexpool.conf => flexpool-miner.conf} (89%) create mode 100644 telegraf/flexpool-pool.conf diff --git a/telegraf/flexpool.conf b/telegraf/flexpool-miner.conf similarity index 89% rename from telegraf/flexpool.conf rename to telegraf/flexpool-miner.conf index 6e1958f..8393a8f 100644 --- a/telegraf/flexpool.conf +++ b/telegraf/flexpool-miner.conf @@ -1,10 +1,3 @@ -[[inputs.http]] - name_override = "flexpool_pool_block_count" - urls = ["https://flexpool.io/api/v1/pool/blockCount"] - data_format = "json" - tagexclude = ["url"] - json_query = "result" - [[inputs.http]] name_override = "flexpool_balance" urls = ["https://flexpool.io/api/v1/miner/${MINER_ADDRESS}/balance"] diff --git a/telegraf/flexpool-pool.conf b/telegraf/flexpool-pool.conf new file mode 100644 index 0000000..75f31ba --- /dev/null +++ b/telegraf/flexpool-pool.conf @@ -0,0 +1,61 @@ +[[inputs.http]] + name_override = "flexpool_pool_block_count" + urls = ["https://flexpool.io/api/v1/pool/blockCount"] + data_format = "json" + tagexclude = ["url"] + json_query = "result" + +[[inputs.http]] + name_override = "flexpool_pool_block_count" + urls = ["https://flexpool.io/api/v1/pool/blockCount"] + data_format = "json" + tagexclude = ["url"] + json_query = "result" + +[[inputs.http]] + name_override = "flexpool_pool_blocks" + urls = [ + "https://flexpool.io/api/v1/pool/blocks/?page=0", + "https://flexpool.io/api/v1/pool/blocks/?page=1", + "https://flexpool.io/api/v1/pool/blocks/?page=2", + "https://flexpool.io/api/v1/pool/blocks/?page=3", + "https://flexpool.io/api/v1/pool/blocks/?page=4" + ] + data_format = "json" + tagexclude = ["url"] + json_query = "result.data" + json_time_format = "unix" + json_time_key = "timestamp" + tag_keys = ["miner"] + +[[inputs.http]] + name_override = "flexpool_pool_hashrate" + urls = ["https://flexpool.io/api/v1/pool/hashrate"] + data_format = "json" + tagexclude = ["url"] + json_query = "result" + +[[inputs.http]] + name_override = "flexpool_pool_miners_online" + urls = ["https://flexpool.io/api/v1/pool/minersOnline"] + data_format = "json" + tagexclude = ["url"] + +[[inputs.http]] + name_override = "flexpool_pool_workers_online" + urls = ["https://flexpool.io/api/v1/pool/workersOnline"] + data_format = "json" + tagexclude = ["url"] + +[[inputs.http]] + name_override = "flexpool_pool_average_luck_round_time" + urls = ["https://flexpool.io/api/v1/pool/avgLuckRoundtime"] + data_format = "json" + tagexclude = ["url"] + json_query = "result" + +[[inputs.http]] + name_override = "flexpool_pool_current_luck" + urls = ["https://flexpool.io/api/v1/pool/currentLuck"] + data_format = "json" + tagexclude = ["url"]