Skip to content

Commit

Permalink
feat: add monitoring(grafana, prometheus, ethbalance) for localnet te…
Browse files Browse the repository at this point in the history
…sting (#1498)

* add monitoring and blockscout for localnet testing

* remove blockscout from this PR, update readme with grafana access instructions

* add eth tss automation

* update changelog.md

* delete static addresses.txt file

* update github changelog check workflow

* update github changelog check workflow

* add github head repo full name

* switch to using pull request base and head for changelog diff

* fix typo

* update ethbalance image to be start of zetachain-exporter

* change labeler workflow to run on pull_request_target instead of pull_request

---------

Co-authored-by: Peter Lee <[email protected]>
Co-authored-by: morde08 <[email protected]>
Co-authored-by: Charlie <[email protected]>
Co-authored-by: Lucas Bertrand <[email protected]>
  • Loading branch information
5 people authored Jan 10, 2024
1 parent 89475e5 commit 0fe3dc5
Show file tree
Hide file tree
Showing 18 changed files with 3,136 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/change-log-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-changelog') }}
run: |
git fetch origin ${{ github.base_ref }}
CHANGELOG_DIFF=$(git diff origin/${{ github.base_ref }} origin/${{ github.head_ref }} -- changelog.md)
CHANGELOG_DIFF=$(git diff ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} -- changelog.md)
echo "${CHANGELOG_DIFF}"
if [ -z "$CHANGELOG_DIFF" ]; then
echo "ERROR: No changes detected in CHANGELOG.md. Please update the changelog."
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "Pull Request Labeler"
on:
pull_request:
pull_request_target:
types:
- opened
- edited
Expand Down
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,11 @@ localnet/ganache/storage
localnet/zetachain-monorepo
/standalone-network/authz/tx.json
/zetanode.log

# Blockscout Files
contrib/localnet/blockscout/services/blockscout-db-data/*
contrib/localnet/blockscout/services/logs/*
contrib/localnet/blockscout/services/redis-data/*
contrib/localnet/blockscout/services/stats-db-data/*
contrib/localnet/grafana/addresses.txt
contrib/localnet/addresses.txt
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,19 @@ stateful-upgrade-source:
stop-stateful-upgrade:
cd contrib/localnet/ && $(DOCKER) compose -f docker-compose-stateful.yml down --remove-orphans

###############################################################################
### Monitoring ###
###############################################################################

start-monitoring:
@echo "Starting monitoring services"
cd contrib/localnet/grafana/ && ./get-tss-address.sh
cd contrib/localnet/ && $(DOCKER) compose -f docker-compose-monitoring.yml up -d

stop-monitoring:
@echo "Stopping monitoring services"
cd contrib/localnet/ && $(DOCKER) compose -f docker-compose-monitoring.yml down

###############################################################################
### GoReleaser ###
###############################################################################
Expand Down
2 changes: 1 addition & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* ChainNoncesAll :Changed from `/zeta-chain/observer/chainNonces` to `/zeta-chain/observer/chainNonces` . It returns all the chain nonces for all chains. This returns the current nonce of the TSS address for all chains.

### Features

* [1498](https://github.com/zeta-chain/node/pull/1498) - Add monitoring(grafana, prometheus, ethbalance) for localnet testing
* [1395](https://github.com/zeta-chain/node/pull/1395) - Add state variable to track aborted zeta amount
* [1410](https://github.com/zeta-chain/node/pull/1410) - `snapshots` commands
* enable zetaclients to use dynamic gas price on zetachain - enables >0 min_gas_price in feemarket module
Expand Down
24 changes: 24 additions & 0 deletions contrib/localnet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,30 @@ which does the following docker compose command:
# in zeta-node/contrib/localnet/orchestrator
$ docker compose down --remove-orphans
```
### Run monitoring setup
Before starting the monitoring setup, make sure the Zetacore API is up at http://localhost:1317.
You can also add any additional ETH addresses to monitor in zeta-node/contrib/localnet/grafana/addresses.txt file
```bash
# in zeta-node/
make start-monitoring
```
which does the following docker compose command:
```bash
# in zeta-node/contrib/localnet/
$ docker compose -f docker-compose-monitoring.yml up -d
```
### Grafana credentials and dashboards
The Grafana default credentials are admin:admin. The dashboards are located at http://localhost:3000.
### Stop monitoring setup
```bash
# in zeta-node/
make stop-monitoring
```
which does the following docker compose command:
```bash
# in zeta-node/contrib/localnet/
$ docker compose -f docker-compose-monitoring.yml down --remove-orphans
```

## Useful data

Expand Down
47 changes: 47 additions & 0 deletions contrib/localnet/docker-compose-monitoring.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
version: '3'

services:
grafana:
image: grafana/grafana:latest
container_name: grafana
hostname: grafana
volumes:
- ./grafana/datasource.yaml:/etc/grafana/provisioning/datasources/datasource.yaml
- ./grafana/dashboards/:/etc/grafana/provisioning/dashboards
ports:
- "3000:3000"
networks:
mynetwork:
ipv4_address: 172.20.0.30

prometheus:
image: prom/prometheus:latest
container_name: prometheus
hostname: prometheus
volumes:
- ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
ports:
- "9090:9090"
networks:
mynetwork:
ipv4_address: 172.20.0.31

zetachain-exporter:
image: zetachain/zetachain-exporter:latest
container_name: zetachain-exporter
hostname: zetachain-exporter
volumes:
- ./grafana/addresses.txt:/app/addresses.txt
ports:
- "9015:9015"
networks:
mynetwork:
ipv4_address: 172.20.0.32
environment:
- GETH=http://eth:8545

networks:
mynetwork:
ipam:
config:
- subnet: 172.20.0.0/24
Loading

0 comments on commit 0fe3dc5

Please sign in to comment.