#!/bin/bash

url1="https://artifacts-observability.sixthsense.rakuten.com"
timeout=10

if curl -sIf "$url1" -o /dev/null -m "$timeout"; then
  echo "Connectivity to $url1 is OK"
else
  echo "Unable to connect to $url1"
fi

url2="https://http-collector-observability.sixthsense.rakuten.com/query/health"
timeout=10

if curl -sIf "$url2" -o /dev/null -m "$timeout"; then
  echo "Connectivity to $url2 is OK"
else
  echo "Unable to connect to $url2"
fi


if nc -zv grpc-collector-observability.sixthsense.rakuten.com 443; then
  echo "gRPC connectivity to grpc-collector-observability.sixthsense.rakuten.com:443 is available"
else
  echo "gRPC connectivity to grpc-collector-observability.sixthsense.rakuten.com:443 is not available"
fi