Skip to content

Commit

Permalink
Grafana dashboard added
Browse files Browse the repository at this point in the history
  • Loading branch information
yorickdowne committed Sep 26, 2020
1 parent 7e5790e commit d84141c
Show file tree
Hide file tree
Showing 12 changed files with 86 additions and 10 deletions.
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# eth2-docker v0.07
# eth2-docker v0.1
Unofficial and experimental docker build instructions for eth2 clients

This project builds clients from source. A similar workflow for
Expand Down Expand Up @@ -92,6 +92,21 @@ from the running container.
Once you are ready, you can send eth to the deposit contract by using
the `.eth2/validator_keys/deposit_data-TIMESTAMP.json` file at the [Medalla launchpad](https://medalla.launchpad.ethereum.org/).

## Grafana Dashboards

I'll repeat /u/SomerEsat's instructions on how to set up Grafana.
- Connect to http://YOURSERVERIP:3000/, log in as admin/admin, set a new password
- Click on the gear icon on the left, choose "Data Sources", and "Add Data Source". Use `http://prometheus:9090` as the URL, then click "Save and Test".
- Import a Dashboard. Click on the + icon on the left, choose "Import". Copy/paste JSON code from one of the client dashboard links below (click anywhere inside the page
the link gets you to, use Ctrl-a to select all and Ctrl-C to copy), click "Load", choose the "prometheus" data source you just configured, click "Import".
- For Teku, you can use the grafana.com URL instead of raw JSON.

- [Lighthouse Dashboard JSON](https://raw.githubusercontent.com/sigp/lighthouse-metrics/master/dashboards/Summary.json)
- [Prysm Dashboard JSON](https://raw.githubusercontent.com/GuillaumeMiralles/prysm-grafana-dashboard/master/less_10_validators.json)
- [Prysm Dashboard JSON for more than 10 validators](https://raw.githubusercontent.com/GuillaumeMiralles/prysm-grafana-dashboard/master/more_10_validators.json)
- [Nimbus Dashboard JSON](https://raw.githubusercontent.com/SomerEsat/ethereum-staking-guide/master/NimbusGrafana.json)
- [Teku Dashboard JSON](https://grafana.com/grafana/dashboards/12199)

## Autostart the client on boot

Docker Desktop for Windows 10 and MacOS may do this automatically, TBD.
Expand Down
7 changes: 4 additions & 3 deletions SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,10 @@ geth with `:` between the file names.
- `lh-base.yml` - Lighthouse
- `prysm-base.yml` - Prysm
- `geth.yml` - local geth eth1 chain node
- `grafana.yml` - grafana dashboard

For example, Lighthouse with local geth:
`COMPOSE_FILE=lh-base.yml:geth.yml`
For example, Lighthouse with local geth and grafana:
`COMPOSE_FILE=lh-base.yml:geth.yml:grafana.yml`

## Firewalling

Expand Down Expand Up @@ -166,4 +167,4 @@ And restart the ssh service, for Ubuntu you'd run `sudo systemctl restart ssh`.

## Continue with README file

You are now ready to build and run your eth2 client.
You are now ready to build and run your eth2 client.
7 changes: 4 additions & 3 deletions default.env
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This is vital for key import to work. You can find your UID with "echo $UID".
LOCAL_UID=1000
# Client choice: See SETUP.md for available options
COMPOSE_FILE=lh-base.yml:geth.yml
COMPOSE_FILE=lh-base.yml:geth.yml:grafana.yml
# ETH1 endpoint / chain source. This default uses the geth container
ETH1_NODE=http://geth:8545
# Graffiti to use for validator, in order to receive POAP
Expand All @@ -11,9 +11,9 @@ GRAFFITI=eth2-docker
NUMVAL=1
# Chain to use for wallet creation and initial deposit
DEPOSIT_CHAIN=medalla
# Network to use for geth. Comment out if not using the goerli testnet.
# Network to use for geth.
ETH_NETWORK=--goerli
# Testnet to use for eth2. Comment out if not using a testnet.
# Testnet to use for eth2.
TESTNET=medalla

# Ports you will forward to your staking node. Adjust here if you are
Expand All @@ -22,6 +22,7 @@ GETH_PORT=30303
LH_PORT=9000
PRYSM_PORT=13000
PRYSM_UDP_PORT=12000
GRAFANA_PORT=3000

# These variables are not likely to require adjustment
GETH_BUILD_TARGET=release/1.9
Expand Down
2 changes: 1 addition & 1 deletion eth2.0-deposit-cli/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ RUN mkdir -p /var/lib/depcli-data && chown ${USER}:${USER} /var/lib/depcli-data

WORKDIR /var/lib/depcli
USER ${USER}
RUN git clone https://github.com/ethereum/eth2.0-deposit-cli.git
RUN git clone https://github.com/ethereum/eth2.0-deposit-cli.git && cd eth2.0-deposit-cli && git config advice.detachedHead false && git fetch --all --tags && git checkout ${BUILD_TARGET}
USER root
RUN cd eth2.0-deposit-cli && pip3 install -r requirements.txt && python3 setup.py install

Expand Down
2 changes: 1 addition & 1 deletion geth/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ RUN adduser \
"${USER}"

RUN go get -d github.com/ethereum/go-ethereum
RUN cd $GOPATH/src/github.com/ethereum/go-ethereum && git checkout "${BUILD_TARGET}" && GO111MODULE=on go install -ldflags="-linkmode external -extldflags -static" ./cmd/geth
RUN cd $GOPATH/src/github.com/ethereum/go-ethereum && git config advice.detachedHead false && git fetch --all --tags && git checkout ${BUILD_TARGET} && GO111MODULE=on go install -ldflags="-linkmode external -extldflags -static" ./cmd/geth
RUN ldd $GOPATH/bin/geth 2>&1 | grep -q "Not a valid dynamic program"
RUN mkdir -p /var/lib/goethereum && chown ${USER}:${USER} /var/lib/goethereum

Expand Down
34 changes: 34 additions & 0 deletions grafana.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
version: "3"
services:
prometheus:
restart: "no"
build:
context: ./prometheus
image: prometheus
volumes:
- prom-data:/prometheus
expose:
- 9090
depends_on:
- beacon
- node-exporter
node-exporter:
restart: "no"
image: prom/node-exporter
expose:
- 9100
grafana:
restart: "no"
image: grafana/grafana
volumes:
- grafana-data:/var/lib/grafana
depends_on:
- prometheus
ports:
- ${GRAFANA_PORT}:3000/tcp
eth2:
depends_on:
- grafana
volumes:
grafana-data:
prom-data:
2 changes: 1 addition & 1 deletion lighthouse/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ARG BUILD_TARGET
RUN apt-get update && apt-get install -y git gcc g++ make cmake pkg-config libssl-dev

WORKDIR /usr/src
RUN git clone https://github.com/sigp/lighthouse.git && cd lighthouse && git checkout "${BUILD_TARGET}" && make
RUN git clone https://github.com/sigp/lighthouse.git && cd lighthouse && git config advice.detachedHead false && git fetch --all --tags && git checkout ${BUILD_TARGET} && make

# Pull all binaries into a second stage deploy debian container
FROM debian:latest
Expand Down
3 changes: 3 additions & 0 deletions prometheus/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM prom/prometheus

COPY ./prometheus.yml /etc/prometheus
Empty file added prometheus/data/lock
Empty file.
Binary file added prometheus/data/queries.active
Binary file not shown.
Empty file added prometheus/data/wal/00000000
Empty file.
22 changes: 22 additions & 0 deletions prometheus/prometheus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
global:
scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
# scrape_timeout is set to the global default (10s).
# Alertmanager configuration
alerting:
alertmanagers:
- static_configs:
- targets:
# - alertmanager:9093
# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
rule_files:
# - "first_rules.yml"
# - "second_rules.yml"
# A scrape configuration containing beacon node and node exporter
scrape_configs:
- job_name: 'nodes'
static_configs:
- targets: ['beacon:5052']
- job_name: 'node_exporter'
static_configs:
- targets: ['node-exporter:9100']

0 comments on commit d84141c

Please sign in to comment.