Skip to content

Commit

Permalink
interop-devnet: add grafana/loki/promtrail (ethereum-optimism#12773)
Browse files Browse the repository at this point in the history
* interop-devnet: add grafana/loki/promtrail

Revival of PR ethereum-optimism#11628
to enhance local interop devnet.

Co-authored-by: Ethen Pociask <[email protected]>
Co-authored-by: Samuel Laferriere <[email protected]>

* interop-devnet: use custom grafana port

* interop-devnet: fix ports

* interop-devnet: enable op-supervisor metrics

---------

Co-authored-by: Ethen Pociask <[email protected]>
Co-authored-by: Samuel Laferriere <[email protected]>
  • Loading branch information
3 people authored Nov 1, 2024
1 parent 15c50ee commit 28da3f8
Show file tree
Hide file tree
Showing 9 changed files with 2,394 additions and 1 deletion.
43 changes: 43 additions & 0 deletions interop-devnet/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ services:
--rpc.port=8545
--rpc.enable-admin
--l2-rpcs="ws://l2-a:8546,ws://l2-b:8546"
environment:
OP_SUPERVISOR_METRICS_ENABLED: "true"

l2-a:
depends_on:
Expand Down Expand Up @@ -352,3 +354,44 @@ services:
# OP_BATCHER_DATA_AVAILABILITY_TYPE: blobs
env_file:
- "${PWD}/../.devnet-interop/env/l2/900201/op-batcher.env"

grafana:
image: grafana/grafana:11.1.0
restart: unless-stopped
env_file:
- monitoring/grafana.env
volumes:
- ./monitoring/grafana/provisioning/:/etc/grafana/provisioning/:ro
- ./monitoring/grafana/dashboards:/var/lib/grafana/dashboards
# - grafana_data:/var/lib/grafana
ports:
- 3300:3000

prometheus:
image: prom/prometheus:latest
restart: unless-stopped
volumes:
- ./monitoring/prometheus:/etc/prometheus
# - prometheus_data:/prometheus
ports:
- 3090:9090
command: --config.file=/etc/prometheus/prometheus.yml --log.level=debug

loki:
image: grafana/loki:3.1.1
restart: unless-stopped
volumes:
- ./monitoring/loki:/etc/loki
ports:
- 3200:3200
command: -config.file=/etc/loki/config.yaml

promtail:
image: grafana/promtail:3.1.1
restart: unless-stopped
volumes:
# uncomment to scrape system logs
# - /var/log:/var/log
- ./monitoring/promtail:/etc/promtail
- /var/run/docker.sock:/var/run/docker.sock # Mount Docker socket to read container logs
command: -config.file=/etc/promtail/config.yaml
9 changes: 8 additions & 1 deletion interop-devnet/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,21 @@ devnet-down:
# stops services, does not remove containers/networks
docker compose stop

devnet-metrics-up:
docker compose up -d prometheus grafana loki promtail

devnet-metrics-down:
docker compose down -d prometheus grafana loki promtail

devnet-clean:
rm -rf ../.devnet-interop
# Stops services, and removes containers/networks
docker compose down
# Now manually clean up the related images and volumes
# Note: `justfile` interprets the curly brackets. So we escape them, by wrapping it with more, as a string, like Jinja2.
docker image ls 'interop-devnet*' --format='{{ '{{.Repository}}' }}' | xargs -r docker rmi
docker volume ls --filter name=interop-devnet --format='{{ '{{.Name}}' }}' | xargs -r docker volume rm
# docker compose down needs the env files before being able to shut down, so remove the devnet config resources last
rm -rf ../.devnet-interop

devnet-logs:
docker compose logs -f
1 change: 1 addition & 0 deletions interop-devnet/monitoring/grafana.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
GF_SECURITY_ADMIN_PASSWORD=admin
Loading

0 comments on commit 28da3f8

Please sign in to comment.