From 87bfde1eca4ddb43f18a17ce00872a3c1aca4dfe Mon Sep 17 00:00:00 2001 From: Pablo Lema Date: Tue, 7 Mar 2023 02:34:00 -0400 Subject: [PATCH] Create add_node.sh There is small syntax error please see the file. I believe this causes an issue in setup. --- add_node.sh | 1 + 1 file changed, 1 insertion(+) create mode 100644 add_node.sh diff --git a/add_node.sh b/add_node.sh new file mode 100644 index 0000000..24ff6f1 --- /dev/null +++ b/add_node.sh @@ -0,0 +1 @@ +yq -i -y '.scrape_configs[] |= (.job_name as $name | .static_configs += if $name == "prometheus" then [] else ([{targets:["'$1'" + (if $name == "node" then ":9100" elif $name == "cosmos" then ":'$2'" else ":9300" end)], labels:(if $name == "validator" then {address: "'$3'"} elif $name == "wallet" then {address: "'$4'"} elif $name == "node" then {instance: "'$5'"} else {} end)}]) end)' $HOME/cosmos_node_monitoring/prometheus/prometheus.yml