refactor: updated edge probing

This commit is contained in:
Valentin Doreau 2024-04-05 15:25:28 +02:00
parent 566651131d
commit 2ef9444bc6
Signed by: vdoreau
GPG key ID: F3E456CF9A14098B

View file

@ -41,9 +41,10 @@ get_edge_state () {
location=$1
edge=$2
instance="edge$edge-$(echo "$location" | cut -d. -f1).transfer.recycled.cloud"
instance="edge$edge.$location.recycled.cloud"
job="blackbox-external-icmpv6"
result=$(query $EXTERNAL_PROMETHEUS_ADDR \
"probe_success{instance=\"$instance\"}")
"probe_success{instance=\"$instance\", job=\"$job\"}")
get_state "$result"
}
@ -84,8 +85,8 @@ for location in $LOCATIONS; do
canary_v6=$(get_canary_state "$location" 6)
canary_v4=$(get_canary_state "$location" 4)
edge1_transfer=$(get_edge_state "$location" 1)
edge2_transfer=$(get_edge_state "$location" 2)
edge1=$(get_edge_state "$location" 1)
edge2=$(get_edge_state "$location" 2)
cat <<- EOF
<div class="location">
@ -96,8 +97,8 @@ for location in $LOCATIONS; do
<div class="col-6">
<h3>Routers</h3>
<ul>
<li>edge1 <span class="$edge1_transfer">$edge1_transfer</span></li>
<li>edge2 <span class="$edge2_transfer">$edge2_transfer</span></li>
<li>edge1 <span class="$edge1">$edge1</span></li>
<li>edge2 <span class="$edge2">$edge2</span></li>
</ul>
</div>
<div class="col-6">