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