Skip to content

Commit

Permalink
wget times out faster during grafana provision (#1461)
Browse files Browse the repository at this point in the history
  • Loading branch information
yorickdowne authored Aug 3, 2023
1 parent 51d997c commit d9b8e2b
Showing 1 changed file with 26 additions and 26 deletions.
52 changes: 26 additions & 26 deletions grafana/provision-dashboards.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,33 @@ case "$CLIENT" in
# prysm_metanull
__url='https://raw.githubusercontent.com/metanull-operator/eth2-grafana/master/eth2-grafana-dashboard-single-source-beacon_node.json'
__file='/etc/grafana/provisioning/dashboards/prysm_metanull.json'
wget -qcO - "${__url}" | jq '.title = "prysm_metanull"' >"${__file}"
wget -t 3 -T 10 -qcO - "${__url}" | jq '.title = "prysm_metanull"' >"${__file}"
# prysm_less_10
__url='https://raw.githubusercontent.com/GuillaumeMiralles/prysm-grafana-dashboard/master/less_10_validators.json'
__file='/etc/grafana/provisioning/dashboards/prysm_less_10.json'
wget -qcO - "${__url}" | jq '.title = "prysm_less_10"' >"${__file}"
wget -t 3 -T 10 -qcO - "${__url}" | jq '.title = "prysm_less_10"' >"${__file}"
# prysm_more_10
__url='https://raw.githubusercontent.com/GuillaumeMiralles/prysm-grafana-dashboard/master/more_10_validators.json'
__file='/etc/grafana/provisioning/dashboards/prysm_more_10.json'
wget -qcO - "${__url}" | jq '.title = "prysm_more_10"' >"${__file}"
wget -t 3 -T 10 -qcO - "${__url}" | jq '.title = "prysm_more_10"' >"${__file}"
# prysm_ynager
__url='https://raw.githubusercontent.com/ynager/grafana-eth-staking/main/dashboard.json'
__file='/etc/grafana/provisioning/dashboards/prysm_ynager.json'
wget -qcO - "${__url}" | jq '.title = "prysm_ynager"' >"${__file}"
wget -t 3 -T 10 -qcO - "${__url}" | jq '.title = "prysm_ynager"' >"${__file}"
;;&
*lighthouse* )
# lighthouse_summary
__url='https://raw.githubusercontent.com/sigp/lighthouse-metrics/master/dashboards/Summary.json'
__file='/etc/grafana/provisioning/dashboards/lighthouse_summary.json'
wget -qcO - "${__url}" | jq '.title = "lighthouse_summary"' | jq 'walk(if . == "${DS_PROMETHEUS}" then "Prometheus" else . end)' >"${__file}"
wget -t 3 -T 10 -qcO - "${__url}" | jq '.title = "lighthouse_summary"' | jq 'walk(if . == "${DS_PROMETHEUS}" then "Prometheus" else . end)' >"${__file}"
# lighthouse_validator_client
__url='https://raw.githubusercontent.com/sigp/lighthouse-metrics/master/dashboards/ValidatorClient.json'
__file='/etc/grafana/provisioning/dashboards/lighthouse_validator_client.json'
wget -qcO - "${__url}" | jq '.title = "lighthouse_validator_client"' >"${__file}"
wget -t 3 -T 10 -qcO - "${__url}" | jq '.title = "lighthouse_validator_client"' >"${__file}"
# lighthouse_validator_monitor
__url='https://raw.githubusercontent.com/sigp/lighthouse-metrics/master/dashboards/ValidatorMonitor.json'
__file='/etc/grafana/provisioning/dashboards/lighthouse_validator_monitor.json'
wget -qcO - "${__url}" | jq '.title = "lighthouse_validator_monitor"' >"${__file}"
wget -t 3 -T 10 -qcO - "${__url}" | jq '.title = "lighthouse_validator_monitor"' >"${__file}"
# lighthouse_yoldark34
# This needs a bit more for datasource than is here
#__url='https://raw.githubusercontent.com/Yoldark34/lighthouse-staking-dashboard/main/Yoldark_ETH_staking_dashboard.json'
Expand All @@ -51,82 +51,82 @@ case "$CLIENT" in
# teku_overview
__url='https://grafana.com/api/dashboards/12199/revisions/1/download'
__file='/etc/grafana/provisioning/dashboards/teku_overview.json'
wget -qcO - "${__url}" | jq '.title = "teku_overview"' >"${__file}"
wget -t 3 -T 10 -qcO - "${__url}" | jq '.title = "teku_overview"' >"${__file}"
;;&
*nimbus* )
# nimbus_dashboard
__url='https://raw.githubusercontent.com/status-im/nimbus-eth2/master/grafana/beacon_nodes_Grafana_dashboard.json'
__file='/etc/grafana/provisioning/dashboards/nimbus_dashboard.json'
wget -qcO - "${__url}" | jq '.title = "nimbus_dashboard"' | jq 'walk(if . == "${DS_PROMETHEUS}" then "Prometheus" else . end)' >"{$__file}"
wget -t 3 -T 10 -qcO - "${__url}" | jq '.title = "nimbus_dashboard"' | jq 'walk(if . == "${DS_PROMETHEUS}" then "Prometheus" else . end)' >"{$__file}"
;;&
*lodestar* )
# lodestar summary
__url='https://raw.githubusercontent.com/ChainSafe/lodestar/stable/dashboards/lodestar_summary.json'
__file='/etc/grafana/provisioning/dashboards/lodestar_summary.json'
wget -qcO - "${__url}" | jq '.title = "lodestar_dashboard"' | jq 'walk(if . == "${DS_PROMETHEUS}" then "Prometheus" else . end)' | \
wget -t 3 -T 10 -qcO - "${__url}" | jq '.title = "lodestar_dashboard"' | jq 'walk(if . == "${DS_PROMETHEUS}" then "Prometheus" else . end)' | \
jq 'walk(if . == "prometheus_local" then "Prometheus" else . end)' >"${__file}"
;;&
*geth* )
# geth_dashboard
__url='https://gist.githubusercontent.com/karalabe/e7ca79abdec54755ceae09c08bd090cd/raw/3a400ab90f9402f2233280afd086cb9d6aac2111/dashboard.json'
__file='/etc/grafana/provisioning/dashboards/geth_dashboard.json'
wget -qcO - "${__url}" | jq '.title = "geth_dashboard"' | jq 'walk(if . == "${DS_PROMETHEUS}" then "Prometheus" else . end)' >"${__file}"
wget -t 3 -T 10 -qcO - "${__url}" | jq '.title = "geth_dashboard"' | jq 'walk(if . == "${DS_PROMETHEUS}" then "Prometheus" else . end)' >"${__file}"
;;&
*erigon* )
# erigon_dashboard
__url='https://raw.githubusercontent.com/ledgerwatch/erigon/devel/cmd/prometheus/dashboards/erigon.json'
__file='/etc/grafana/provisioning/dashboards/erigon_dashboard.json'
wget -qcO - "${__url}" | jq '.title = "erigon_dashboard"' | jq '.uid = "YbLNLr6Mz"' >"${__file}"
wget -t 3 -T 10 -qcO - "${__url}" | jq '.title = "erigon_dashboard"' | jq '.uid = "YbLNLr6Mz"' >"${__file}"
;;&
*besu* )
# besu_dashboard
__url='https://grafana.com/api/dashboards/10273/revisions/5/download'
__file='/etc/grafana/provisioning/dashboards/besu_dashboard.json'
wget -qcO - "${__url}" | jq '.title = "besu_dashboard"' | jq 'walk(if . == "${DS_PROMETHEUS}" then "Prometheus" else . end)' >"${__file}"
wget -t 3 -T 10 -qcO - "${__url}" | jq '.title = "besu_dashboard"' | jq 'walk(if . == "${DS_PROMETHEUS}" then "Prometheus" else . end)' >"${__file}"
;;&
*reth* )
# reth_dashboard
__url='https://raw.githubusercontent.com/paradigmxyz/reth/main/etc/grafana/dashboards/overview.json'
__file='/etc/grafana/provisioning/dashboards/reth_dashboard.json'
wget -qcO - "${__url}" | jq '.title = "reth_dashboard"' | jq 'walk(if . == "${DS_PROMETHEUS}" then "Prometheus" else . end)' >"${__file}"
wget -t 3 -T 10 -qcO - "${__url}" | jq '.title = "reth_dashboard"' | jq 'walk(if . == "${DS_PROMETHEUS}" then "Prometheus" else . end)' >"${__file}"
;;&
*nethermind* )
# nethermind_dashboard
__url='https://raw.githubusercontent.com/NethermindEth/metrics-infrastructure/master/grafana/dashboards/nethermind.json'
__url='https://raw.githubusercontent.com/NethermindEth/metrics-infrastructure/master/grafana/provisioning/dashboards/nethermind.json'
__file='/etc/grafana/provisioning/dashboards/nethermind_dashboard.json'
# wget -qcO - "${__url}" | jq '.templating.list[0].current |= (.selected = true) | (.isNone = true) | (.text = "None") | (.value = "") | del(.allValue, .label, .description, .error, .includeAll, .multi) | .templating.list[1] |= (.hide = 2) | (.query = "execution:6060") | (.type = "constant") | (.current |= del(.selected, .text, .value)) | del(.allValue, .label, .description, .error, .includeAll, .multi, .options, .datasource, .definition, .refresh, .regex, .sort, .tagValuesQuery, .tagsQuery, .useTags)' >"${__file}"
# wget -t 3 -T 10 -qcO - "${__url}" | jq '.templating.list[0].current |= (.selected = true) | (.isNone = true) | (.text = "None") | (.value = "") | del(.allValue, .label, .description, .error, .includeAll, .multi) | .templating.list[1] |= (.hide = 2) | (.query = "execution:6060") | (.type = "constant") | (.current |= del(.selected, .text, .value)) | del(.allValue, .label, .description, .error, .includeAll, .multi, .options, .datasource, .definition, .refresh, .regex, .sort, .tagValuesQuery, .tagsQuery, .useTags)' >"${__file}"
cp /tmp/nethermind_dashboard.json "${__file}"
;;&
*blox-ssv* )
# Blox SSV Operator Dashboard
__url='https://raw.githubusercontent.com/bloxapp/ssv/main/monitoring/grafana/dashboard_ssv_operator_performance.json'
__file='/etc/grafana/provisioning/dashboards/blox_ssv_operator_dashboard.json'
wget -qcO - "${__url}" | jq '.templating.list[0].current |= (.selected = false) | (.text = "ssv2-node") | (.value = "ssv2-node") | .templating.list[0].options = [ { "selected": true, "text": "ssv2-node", "value": "ssv2-node" } ] | .templating.list[0].query = "ssv2-node"' >"${__file}"
wget -t 3 -T 10 -qcO - "${__url}" | jq '.templating.list[0].current |= (.selected = false) | (.text = "ssv2-node") | (.value = "ssv2-node") | .templating.list[0].options = [ { "selected": true, "text": "ssv2-node", "value": "ssv2-node" } ] | .templating.list[0].query = "ssv2-node"' >"${__file}"
__url='https://raw.githubusercontent.com/bloxapp/ssv/main/monitoring/grafana/dashboard_ssv_node.json'
__file='/etc/grafana/provisioning/dashboards/blox_ssv_node_dashboard.json'
wget -qcO - "${__url}" | jq '.templating.list[0].current |= (.selected = false) | (.text = "ssv2-node") | (.value = "ssv2-node") | .templating.list[0].options = [ { "selected": true, "text": "ssv2-node", "value": "ssv2-node" } ] | .templating.list[0].query = "ssv2-node"' >"${__file}"
wget -t 3 -T 10 -qcO - "${__url}" | jq '.templating.list[0].current |= (.selected = false) | (.text = "ssv2-node") | (.value = "ssv2-node") | .templating.list[0].options = [ { "selected": true, "text": "ssv2-node", "value": "ssv2-node" } ] | .templating.list[0].query = "ssv2-node"' >"${__file}"
;;&
* )
# Home staking dashboard
__revision=$(wget -q -O - https://grafana.com/api/dashboards/17846 | jq .revision)
__revision=$(wget -t 3 -T 10 -qO - https://grafana.com/api/dashboards/17846 | jq .revision)
__url="https://grafana.com/api/dashboards/17846/revisions/${__revision}/download"
__file='/etc/grafana/provisioning/dashboards/homestaking-dashboard.json'
wget -qcO - "${__url}" | jq 'walk(if . == "${DS_PROMETHEUS}" then "Prometheus" else . end)' >"${__file}"
wget -t 3 -T 10 -qcO - "${__url}" | jq 'walk(if . == "${DS_PROMETHEUS}" then "Prometheus" else . end)' >"${__file}"
# Ethereum Metrics Exporter Dashboard
__revision=$(wget -q -O - https://grafana.com/api/dashboards/16277 | jq .revision)
__revision=$(wget -t 3 -T 10 -qO - https://grafana.com/api/dashboards/16277 | jq .revision)
__url="https://grafana.com/api/dashboards/16277/revisions/${__revision}/download"
__file='/etc/grafana/provisioning/dashboards/ethereum-metrics-exporter-single.json'
wget -qcO - "${__url}" | jq 'walk(if . == "${DS_PROMETHEUS}" then "Prometheus" else . end)' >"${__file}"
wget -t 3 -T 10 -qcO - "${__url}" | jq 'walk(if . == "${DS_PROMETHEUS}" then "Prometheus" else . end)' >"${__file}"
# cadvisor and node exporter dashboard
__revision=$(wget -q -O - https://grafana.com/api/dashboards/10619 | jq .revision)
__revision=$(wget -t 3 -T 10 -qO - https://grafana.com/api/dashboards/10619 | jq .revision)
__url="https://grafana.com/api/dashboards/10619/revisions/${__revision}/download"
__file='/etc/grafana/provisioning/dashboards/docker-host-container-overview.json'
wget -qcO - "${__url}" | jq 'walk(if . == "${DS_PROMETHEUS}" then "Prometheus" else . end)' >"${__file}"
wget -t 3 -T 10 -qcO - "${__url}" | jq 'walk(if . == "${DS_PROMETHEUS}" then "Prometheus" else . end)' >"${__file}"
# Log file dashboard (via loki)
__revision=$(wget -q -O - https://grafana.com/api/dashboards/18700 | jq .revision)
__revision=$(wget -t 3 -T 10 -qO - https://grafana.com/api/dashboards/18700 | jq .revision)
__url="https://grafana.com/api/dashboards/18700/revisions/${__revision}/download"
__file='/etc/grafana/provisioning/dashboards/eth-docker-logs.json'
wget -qcO - "${__url}" | jq 'walk(if . == "${DS_LOKI}" then "Loki" else . end)' >"${__file}"
wget -t 3 -T 10 -qcO - "${__url}" | jq 'walk(if . == "${DS_LOKI}" then "Loki" else . end)' >"${__file}"
;;
esac

Expand Down

0 comments on commit d9b8e2b

Please sign in to comment.