Skip to content
Open
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
19 changes: 19 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,25 @@ docker-cluster-stop:
@cd docker && DOCKER_PLATFORM=$(DOCKER_PLATFORM) USERID=$(shell id -u) GROUPID=$(shell id -g) GOCACHE=$(shell go env GOCACHE) docker compose down
.PHONY: localnet-stop

# Start 4-node cluster with Prometheus and Grafana monitoring
docker-cluster-start-monitoring: docker-cluster-stop-monitoring build-docker-node
@rm -rf $(PROJECT_HOME)/build/generated
@mkdir -p $(shell go env GOPATH)/pkg/mod
@mkdir -p $(shell go env GOCACHE)
@cd docker && \
if [ "$${DOCKER_DETACH:-}" = "true" ]; then \
DETACH_FLAG="-d"; \
else \
DETACH_FLAG=""; \
fi; \
DOCKER_PLATFORM=$(DOCKER_PLATFORM) USERID=$(shell id -u) GROUPID=$(shell id -g) GOCACHE=$(shell go env GOCACHE) NUM_ACCOUNTS=10 INVARIANT_CHECK_INTERVAL=${INVARIANT_CHECK_INTERVAL} UPGRADE_VERSION_LIST=${UPGRADE_VERSION_LIST} MOCK_BALANCES=${MOCK_BALANCES} GIGA_EXECUTOR=${GIGA_EXECUTOR} GIGA_OCC=${GIGA_OCC} RECEIPT_BACKEND=${RECEIPT_BACKEND} AUTOBAHN=${AUTOBAHN} GIGA_STORAGE=${GIGA_STORAGE} docker compose -f docker-compose.yml -f docker-compose.monitoring.yml up --no-attach grafana --no-attach prometheus $$DETACH_FLAG
Comment thread
cursor[bot] marked this conversation as resolved.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Monitoring target duplicates entire cluster-start recipe body

Low Severity

The docker-cluster-start-monitoring target copy-pastes the entire body of docker-cluster-start — cleanup steps, directory creation, detach-flag logic, and a long inline list of ~10 environment variables (INVARIANT_CHECK_INTERVAL, GIGA_EXECUTOR, AUTOBAHN, etc.). The only difference is the compose file arguments and --no-attach flags. When a new feature-flag env var is added to docker-cluster-start, it can easily be forgotten in the monitoring target, causing silent behavioral differences between the two cluster modes.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 1f70ad0. Configure here.

.PHONY: docker-cluster-start-monitoring

# Stop monitoring containers (Prometheus and Grafana) and cluster
docker-cluster-stop-monitoring:
@cd docker && DOCKER_PLATFORM=$(DOCKER_PLATFORM) USERID=$(shell id -u) GROUPID=$(shell id -g) GOCACHE=$(shell go env GOCACHE) docker compose -f docker-compose.yml -f docker-compose.monitoring.yml down
.PHONY: docker-cluster-stop-monitoring

# Run GIGA EVM integration tests with a GIGA-enabled cluster
# This starts a fresh cluster with GIGA_EXECUTOR and GIGA_OCC enabled,
# runs the EVM GIGA tests, then stops the cluster.
Expand Down
16 changes: 14 additions & 2 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,26 @@ docker exec -it [container_name] /bin/bash

## Prometheus / Grafana (monitornode)

To run local Prometheus and Grafana containers for metrics visualization:
**Cluster and monitoring together:** from the repo root you can run:

```sh
make docker-cluster-start-monitoring
```

This stops any existing compose stack, rebuilds the node image, starts the four-node local cluster, and brings up the Prometheus and Grafana containers via the monitoring compose overlay, so you do not need to run the scripts below for that flow. To tear down the cluster and monitoring containers together:

```sh
make docker-cluster-stop-monitoring
```

**Scripts only:** to start Prometheus and Grafana by themselves (for example when you are not using the make target above):

```sh
./docker/monitornode/scripts/start-prometheus.sh
./docker/monitornode/scripts/start-grafana.sh
```

Grafana UI: http://localhost:3000 (login: admin / admin). To stop:
Grafana UI: http://localhost:3000 (login: admin / admin). To stop containers started via the scripts:

```sh
./docker/monitornode/scripts/stop-prometheus.sh
Expand Down
33 changes: 33 additions & 0 deletions docker/docker-compose.monitoring.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
services:
prometheus:
container_name: sei-prometheus
image: prom/prometheus:latest
ports:
- "9099:9090"
volumes:
- ./docker_compose_monitoring/prometheus.yaml:/etc/prometheus/prometheus.yml:ro
command:
- --config.file=/etc/prometheus/prometheus.yml
- --storage.tsdb.path=/prometheus
- --web.enable-lifecycle
networks:
- localnet

grafana:
container_name: sei-grafana
image: grafana/grafana:latest
ports:
- "3000:3000"
volumes:
- ./docker_compose_monitoring/grafana-datasource.yaml:/etc/grafana/provisioning/datasources/grafana-datasource.yaml:ro
environment:
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=admin
- GF_USERS_ALLOW_SIGN_UP=false
depends_on:
- prometheus
networks:
- localnet

networks:
localnet:
8 changes: 8 additions & 0 deletions docker/docker_compose_monitoring/grafana-datasource.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: 1
datasources:
- name: Prometheus
type: prometheus
access: proxy
url: http://prometheus:9090
isDefault: true
editable: false
14 changes: 14 additions & 0 deletions docker/docker_compose_monitoring/prometheus.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
global:
scrape_interval: 15s
evaluation_interval: 15s

scrape_configs:
- job_name: 'sei-localnet'
metrics_path: '/metrics'
static_configs:
- targets:
- 'sei-node-0:26660'
- 'sei-node-1:26660'
- 'sei-node-2:26660'
- 'sei-node-3:26660'
scrape_interval: 5s
Loading