From 1d3311b8647b8d9a4e89714e757b54b59980602d Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Thu, 11 Apr 2024 07:56:50 +0000 Subject: [PATCH] Update init script to enable prometheus metrics (#28) Part of https://www.notion.so/Monitoring-and-alerting-for-laconicd-86727c3b4dde4dc993d87d6e29f935fe Reviewed-on: https://git.vdb.to/cerc-io/laconic2d/pulls/28 Co-authored-by: Prathamesh Musale Co-committed-by: Prathamesh Musale --- scripts/init.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/scripts/init.sh b/scripts/init.sh index 4812bee9f..847d36bde 100755 --- a/scripts/init.sh +++ b/scripts/init.sh @@ -66,6 +66,17 @@ if [ "$1" == "clean" ] || [ ! -d "$HOME/.laconicd/data/blockstore.db" ]; then sed -i 's/create_empty_blocks = true/create_empty_blocks = false/g' $HOME/.laconicd/config/config.toml fi + # Enable telemetry (prometheus metrics: http://localhost:1317/metrics?format=prometheus) + if [[ "$OSTYPE" == "darwin"* ]]; then + sed -i '' 's/enabled = false/enabled = true/g' $HOME/.laconicd/config/app.toml + sed -i '' 's/prometheus-retention-time = 0/prometheus-retention-time = 60/g' $HOME/.laconicd/config/app.toml + sed -i '' 's/prometheus = false/prometheus = true/g' $HOME/.laconicd/config/config.toml + else + sed -i 's/enabled = false/enabled = true/g' $HOME/.laconicd/config/app.toml + sed -i 's/prometheus-retention-time = 0/prometheus-retention-time = 60/g' $HOME/.laconicd/config/app.toml + sed -i 's/prometheus = false/prometheus = true/g' $HOME/.laconicd/config/config.toml + fi + # Allocate genesis accounts (cosmos formatted addresses) laconicd genesis add-genesis-account $KEY 100000000000000000000000000photon --keyring-backend $KEYRING