Correct instructions in the README for running prometheus on Medalla

This commit is contained in:
Zahary Karadjov 2020-08-05 15:51:55 +03:00 committed by zah
parent b427c7249f
commit 4b8ebb5d71
3 changed files with 16 additions and 2 deletions

View File

@ -170,6 +170,11 @@ testnet0 testnet1: | beacon_node
$(GOERLI_TESTNETS_PARAMS) $(NODE_PARAMS) $(GOERLI_TESTNETS_PARAMS) $(NODE_PARAMS)
medalla: | beacon_node medalla: | beacon_node
scripts/make_prometheus_config.sh \
--nodes 1 \
--base-metrics-port $$(($(BASE_METRICS_PORT) + $(NODE_ID))) \
--config-file "build/data/shared_medalla_$(NODE_ID)/prometheus.yml"
build/beacon_node \ build/beacon_node \
--network=medalla \ --network=medalla \
--log-level="$(LOG_LEVEL)" \ --log-level="$(LOG_LEVEL)" \
@ -180,6 +185,12 @@ medalla: | beacon_node
medalla-vc: | beacon_node validator_client medalla-vc: | beacon_node validator_client
# if launching a VC as well - send the BN looking nowhere for validators/secrets # if launching a VC as well - send the BN looking nowhere for validators/secrets
mkdir build/data/shared_medalla_$(NODE_ID)/empty_dummy_folder -p mkdir build/data/shared_medalla_$(NODE_ID)/empty_dummy_folder -p
scripts/make_prometheus_config.sh \
--nodes 1 \
--base-metrics-port $$(($(BASE_METRICS_PORT) + $(NODE_ID))) \
--config-file "build/data/shared_medalla_$(NODE_ID)/prometheus.yml"
build/beacon_node \ build/beacon_node \
--network=medalla \ --network=medalla \
--log-level="$(LOG_LEVEL)" \ --log-level="$(LOG_LEVEL)" \
@ -188,7 +199,9 @@ medalla-vc: | beacon_node validator_client
--validators-dir=build/data/shared_medalla_$(NODE_ID)/empty_dummy_folder \ --validators-dir=build/data/shared_medalla_$(NODE_ID)/empty_dummy_folder \
--secrets-dir=build/data/shared_medalla_$(NODE_ID)/empty_dummy_folder \ --secrets-dir=build/data/shared_medalla_$(NODE_ID)/empty_dummy_folder \
$(GOERLI_TESTNETS_PARAMS) $(NODE_PARAMS) & $(GOERLI_TESTNETS_PARAMS) $(NODE_PARAMS) &
sleep 4 sleep 4
build/validator_client \ build/validator_client \
--log-level="$(LOG_LEVEL)" \ --log-level="$(LOG_LEVEL)" \
--log-file=build/data/shared_medalla_$(NODE_ID)/nbc_vc_$$(date +"%Y%m%d%H%M%S").log \ --log-file=build/data/shared_medalla_$(NODE_ID)/nbc_vc_$$(date +"%Y%m%d%H%M%S").log \

View File

@ -148,7 +148,8 @@ make NIMFLAGS="-d:insecure" medalla
You can now see the raw metrics on http://127.0.0.1:8008/metrics but they're not very useful like this, so let's feed them to a Prometheus instance: You can now see the raw metrics on http://127.0.0.1:8008/metrics but they're not very useful like this, so let's feed them to a Prometheus instance:
```bash ```bash
prometheus --config.file=build/data/shared_medalla_0/prometheus.yml cd build/data/shared_medalla_0
prometheus --config.file=./prometheus.yml --storage.tsdb.path=./prometheus
# when starting multiple nodes at the same time, just use the config file from the one with the highest ID # when starting multiple nodes at the same time, just use the config file from the one with the highest ID
``` ```

View File

@ -99,7 +99,7 @@ if [[ "$USE_PROMETHEUS" == "yes" ]]; then
mkdir -p "${METRICS_DIR}/data" mkdir -p "${METRICS_DIR}/data"
# TODO: Prometheus is not shut down properly on tmux kill-session # TODO: Prometheus is not shut down properly on tmux kill-session
killall prometheus &>/dev/null || true killall prometheus &>/dev/null || true
PROMETHEUS_FLAGS="--config.file=./prometheus.yml --storage.tsdb.path=./data" PROMETHEUS_FLAGS="--config.file=./prometheus.yml --storage.tsdb.path=./prometheus"
$TMUX_CMD new-window -d -t $TMUX_SESSION_NAME -n "$PROMETHEUS_CMD" "cd '$METRICS_DIR' && $PROMETHEUS_CMD $PROMETHEUS_FLAGS" $TMUX_CMD new-window -d -t $TMUX_SESSION_NAME -n "$PROMETHEUS_CMD" "cd '$METRICS_DIR' && $PROMETHEUS_CMD $PROMETHEUS_FLAGS"
else else
echo NOTICE: $PROMETHEUS_CMD will be started automatically only with USE_TMUX=yes echo NOTICE: $PROMETHEUS_CMD will be started automatically only with USE_TMUX=yes