Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add monitoring(grafana, prometheus, ethbalance) for localnet testing #1498

Merged
merged 20 commits into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading