From 3db323ce253eb3b2ddabcb804baaa3480ec84abb Mon Sep 17 00:00:00 2001 From: Julien Riou Date: Mon, 29 Mar 2021 17:23:09 +0200 Subject: [PATCH] [telegraf] Add etherscan input Signed-off-by: Julien Riou --- docker/environment.example | 1 + telegraf/etherscan.conf | 11 +++++++++++ 2 files changed, 12 insertions(+) create mode 100644 telegraf/etherscan.conf diff --git a/docker/environment.example b/docker/environment.example index af4bc55..11494f6 100644 --- a/docker/environment.example +++ b/docker/environment.example @@ -1,5 +1,6 @@ MINER_ADDRESS= HIVEOS_TOKEN= +ETHERSCAN_TOKEN= GF_SECURITY_ADMIN_USER=admin GF_SECURITY_ADMIN_PASSWORD= GF_USERS_DEFAULT_THEME=light diff --git a/telegraf/etherscan.conf b/telegraf/etherscan.conf new file mode 100644 index 0000000..1b53519 --- /dev/null +++ b/telegraf/etherscan.conf @@ -0,0 +1,11 @@ +[[inputs.http]] + name_override = "etherscan_gastracker_gasoracle" + urls = ["https://api.etherscan.io/api?module=gastracker&action=gasoracle&apikey=${ETHERSCAN_TOKEN}"] + data_format = "json" + tagexclude = ["url"] + json_query = "result" + json_string_fields = ["SafeGasPrice", "ProposeGasPrice", "FastGasPrice"] + +[[processors.converter]] + [processors.converter.fields] + integer = ["SafeGasPrice", "ProposeGasPrice", "FastGasPrice"]