Use SERVICE_HOST for url

... so that the endpoint is properly constructed in IPv6-only env.

Change-Id: Ie5040fa59ed5bda3e2eff5562d2446ab38bb98e5
Signed-off-by: Takashi Kajinami <kajinamit@oss.nttdata.com>
This commit is contained in:
Takashi Kajinami
2026-01-25 02:05:41 +09:00
parent d9b1d03e24
commit cf2d127fef
4 changed files with 8 additions and 8 deletions

View File

@@ -84,9 +84,9 @@ function wait_for_data {
sleep 60
}
function check_data_node_exporter {
if curl -s --head --request GET "http://$HOST_IP:$NODE_EXPORTER_PORT/metrics" | grep "200 OK" > /dev/null; then
if curl -s --head --request GET "http://$SERVICE_HOST:$NODE_EXPORTER_PORT/metrics" | grep "200 OK" > /dev/null; then
echo "#### Metrics data ####"
curl "http://$HOST_IP:$NODE_EXPORTER_PORT/metrics"
curl "http://$SERVICE_HOST:$NODE_EXPORTER_PORT/metrics"
else
die $LINENO "Couldn't get data from node_exporter"
fi

View File

@@ -74,13 +74,13 @@ function wait_for_data {
}
function check_data_openstack_exporter {
if curl -s --head --request GET "http://$HOST_IP:$OPENSTACK_EXPORTER_PORT/metrics" | grep "200 OK" > /dev/null; then
if curl -s --head --request GET "http://$SERVICE_HOST:$OPENSTACK_EXPORTER_PORT/metrics" | grep "200 OK" > /dev/null; then
echo "#### Metrics data ####"
curl "http://$HOST_IP:$OPENSTACK_EXPORTER_PORT/metrics"
curl "http://$SERVICE_HOST:$OPENSTACK_EXPORTER_PORT/metrics"
else
die $LINENO "Couldn't get data from openstack_exporter"
fi
}
# Restore xtrace
$_XTRACE_OPENSTACK_EXPORTER
$_XTRACE_OPENSTACK_EXPORTER

View File

@@ -70,9 +70,9 @@ function wait_for_podman_data {
}
function check_data_podman_exporter {
if curl -s --head --request GET "http://$HOST_IP:$PODMAN_EXPORTER_PORT/metrics" | grep "200 OK" > /dev/null; then
if curl -s --head --request GET "http://$SERVICE_HOST:$PODMAN_EXPORTER_PORT/metrics" | grep "200 OK" > /dev/null; then
echo "#### Metrics data ####"
curl "http://$HOST_IP:$PODMAN_EXPORTER_PORT/metrics"
curl "http://$SERVICE_HOST:$PODMAN_EXPORTER_PORT/metrics"
else
die $LINENO "Couldn't get data from podman_exporter"
fi

View File

@@ -141,7 +141,7 @@ function wait_for_data {
}
function check_data_prometheus {
local url="http://$HOST_IP:$PROMETHEUS_PORT/api/v1/label/__name__/values"
local url="http://$SERVICE_HOST:$PROMETHEUS_PORT/api/v1/label/__name__/values"
if curl -s --head --request GET "$url" | grep "200 OK" > /dev/null; then
echo "#### List of metrics names ####"