From 4b8ebb5d7143761803b6dd1ee658cf266e2c4a98 Mon Sep 17 00:00:00 2001 From: Zahary Karadjov Date: Wed, 5 Aug 2020 15:51:55 +0300 Subject: [PATCH] Correct instructions in the README for running prometheus on Medalla --- Makefile | 13 +++++++++++++ README.md | 3 ++- tests/simulation/start.sh | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 0a300ac03..711d1749d 100644 --- a/Makefile +++ b/Makefile @@ -170,6 +170,11 @@ testnet0 testnet1: | beacon_node $(GOERLI_TESTNETS_PARAMS) $(NODE_PARAMS) 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 \ --network=medalla \ --log-level="$(LOG_LEVEL)" \ @@ -180,6 +185,12 @@ medalla: | beacon_node medalla-vc: | beacon_node validator_client # 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 + + 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 \ --network=medalla \ --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 \ --secrets-dir=build/data/shared_medalla_$(NODE_ID)/empty_dummy_folder \ $(GOERLI_TESTNETS_PARAMS) $(NODE_PARAMS) & + sleep 4 + build/validator_client \ --log-level="$(LOG_LEVEL)" \ --log-file=build/data/shared_medalla_$(NODE_ID)/nbc_vc_$$(date +"%Y%m%d%H%M%S").log \ diff --git a/README.md b/README.md index 102f90658..fbd035186 100644 --- a/README.md +++ b/README.md @@ -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: ```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 ``` diff --git a/tests/simulation/start.sh b/tests/simulation/start.sh index 94b3c2dc4..48b0cd1e3 100755 --- a/tests/simulation/start.sh +++ b/tests/simulation/start.sh @@ -99,7 +99,7 @@ if [[ "$USE_PROMETHEUS" == "yes" ]]; then mkdir -p "${METRICS_DIR}/data" # TODO: Prometheus is not shut down properly on tmux kill-session 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" else echo NOTICE: $PROMETHEUS_CMD will be started automatically only with USE_TMUX=yes