diff --git a/scripts/metrics-write-datapoint.sh b/scripts/metrics-write-datapoint.sh index 215d69a17..083ff4655 100755 --- a/scripts/metrics-write-datapoint.sh +++ b/scripts/metrics-write-datapoint.sh @@ -15,6 +15,12 @@ if [[ -z $INFLUX_DATABASE || -z $INFLUX_USERNAME || -z $INFLUX_PASSWORD ]]; then exit 0 fi -echo "https://metrics.solana.com:8086/write?db=${INFLUX_DATABASE}&u=${INFLUX_USERNAME}&p=${INFLUX_PASSWORD}" \ +host="https://metrics.solana.com:8086" + +if [[ -n $INFLUX_HOST ]]; then + host="$INFLUX_HOST" +fi + +echo "${host}/write?db=${INFLUX_DATABASE}&u=${INFLUX_USERNAME}&p=${INFLUX_PASSWORD}" \ | xargs curl --max-time 5 -XPOST --data-binary "$point" exit 0