diff --git a/metrics/scripts/enable.sh b/metrics/scripts/enable.sh old mode 100755 new mode 100644 index e6a1607d93..2989089c74 --- a/metrics/scripts/enable.sh +++ b/metrics/scripts/enable.sh @@ -1,10 +1,8 @@ -#!/usr/bin/env bash - -SOLANA_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")"/../.. || exit 1; pwd)" +# |source| this file to enable metrics in the current shell export SOLANA_METRICS_CONFIG="host=http://localhost:8086,db=testnet,u=write,p=write" # shellcheck source=scripts/configure-metrics.sh -source "$SOLANA_ROOT"/scripts/configure-metrics.sh +source "$(cd "$(dirname "${BASH_SOURCE[0]}")"/../.. || exit 1; pwd)"/scripts/configure-metrics.sh echo Local metrics enabled diff --git a/metrics/scripts/start.sh b/metrics/scripts/start.sh index 0f21b1f94a..99ee3698c4 100755 --- a/metrics/scripts/start.sh +++ b/metrics/scripts/start.sh @@ -1,13 +1,16 @@ -#!/bin/bash -ex +#!/usr/bin/env bash # # (Re)starts the local metrics # +set -e cd "$(dirname "$0")" # Stop if already running ./stop.sh +set -x + : "${INFLUXDB_IMAGE:=influxdb:1.6}" : "${GRAFANA_IMAGE:=solanalabs/grafana:stable}" : "${GRAFANA_IMAGE:=grafana/grafana:5.2.3}" @@ -48,5 +51,3 @@ docker run \ sleep 5 ./status.sh - -exit 0 diff --git a/metrics/scripts/status.sh b/metrics/scripts/status.sh index 910b46ebcd..c48b0c28a5 100755 --- a/metrics/scripts/status.sh +++ b/metrics/scripts/status.sh @@ -1,8 +1,9 @@ -#!/bin/bash -e +#!/usr/bin/env bash # -# Checks the status of lcoal metrics +# Checks the status of local metrics # +set -e cd "$(dirname "$0")" ( @@ -20,8 +21,12 @@ if ! timeout 10s curl -v --head http://localhost:3000; then exit 1 fi -echo Local metrics up and running -echo - Enable local metric collection per shell by running \'source ./enable.sh\' -echo - View dashboard at http://localhost:3000/d/local/local-monitor -exit 0 +cat <