2018-11-11 08:19:04 -08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -e
|
2018-08-27 09:13:53 -07:00
|
|
|
#
|
|
|
|
# Send a metrics datapoint
|
|
|
|
#
|
2018-07-21 23:15:36 -07:00
|
|
|
|
|
|
|
point=$1
|
|
|
|
if [[ -z $point ]]; then
|
|
|
|
echo "Data point not specified"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Influx data point: $point"
|
|
|
|
if [[ -z $INFLUX_DATABASE || -z $INFLUX_USERNAME || -z $INFLUX_PASSWORD ]]; then
|
|
|
|
echo Influx user credentials not found
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "https://metrics.solana.com:8086/write?db=${INFLUX_DATABASE}&u=${INFLUX_USERNAME}&p=${INFLUX_PASSWORD}" \
|
2018-08-01 15:23:36 -07:00
|
|
|
| xargs curl --max-time 5 -XPOST --data-binary "$point"
|