A Prometheus metrics exporter for Ethereum execution & consensus nodes
Ethereum client implementations expose extensive Prometheus metrics however there is minimal standardization around the metrics structure. This makes observability across multiple clients a painful experience. This exporter hopes to help alleviate this problem by creating a client-agnostic set of metrics that operators can run without any additional configuration to dashboards or alerting.
To provide these client-agnostic metrics the exporter relies entirely on these well-defined APIs:
- Execution clients
- Consensus clients
Naturally this means that the exporter is limited to metrics that are exposed by these APIs.
A tool to export the state of ethereum nodes
Usage:
ethereum-metrics-exporter [flags]
Flags:
--config string config file (default is $HOME/.ethereum-metrics-exporter.yaml)
--consensus-url string (optional) URL to the consensus node
--disk-usage-interval string (optional) interval for disk usage metrics collection (e.g. 1h, 5m, 30s)
--execution-modules strings (optional) execution modules that are enabled on the node
--execution-url string (optional) URL to the execution node
-h, --help help for ethereum-metrics-exporter
--metrics-port int Port to serve Prometheus metrics on (default 9090)
--monitored-directories strings (optional) directories to monitor for disk usage
-t, --toggle Help message for toggle
Available as a docker image at ethpandaops/ethereum-metrics-exporter
latest
- distroless, multiarchdebian-latest
- debian, multiarch$version
- distroless, multiarch, pinned to a release (i.e. 0.4.0)$version-debian
- debian, multiarch, pinned to a release (i.e. 0.4.0-debian)
Quick start
docker run -d -it --name ethereum-metrics-exporter -p 9090:9090 -it ethpandaops/ethereum-metrics-exporter --consensus-url=http://localhost:5052 --execution-url=http://localhost:8545
With a config file
docker run -d -it --name ethereum-metrics-exporter -v $HOST_DIR_CHANGE_ME/config.yaml:/opt/exporter/config.yaml -p 9090:9090 -it ethpandaops/ethereum-metrics-exporter --config /opt/exporter/config.yaml
helm repo add ethereum-helm-charts https://ethpandaops.github.io/ethereum-helm-charts
helm install ethereum-metrics-exporter ethereum-helm-charts/ethereum-metrics-exporter -f your_values.yaml
Downloading a release Available here
Building yourself (requires Go)
- Clone the repo
git clone https://github.com/ethpandaops/ethereum-metrics-exporter.git
- Change directories
cd ./ethereum-metrics-exporter
- Build the binary
make build
- Run the exporter
./build/ethereum-metrics-exporter
This project includes a Makefile to simplify common development tasks. Here are the available commands:
Note: To run the full stack, you need to have kurtosis installed.
# This starts up a kurtosis devnet with a beacon node and an execution nodes
# It will then also start the exporter and expose the metrics of the first beacon and execution node on port 9090
make devnet-run
# Build for current platform
make build
# Build for Linux amd64
make build-linux
# Build for all platforms (using goreleaser)
make build-all
# Install to $GOPATH/bin
make install
# Run tests with race detection and coverage
make test
# Run short tests only
make test-short
# Generate coverage report
make coverage
# Run linting
make lint
# Run linting with auto-fix
make lint-fix
# Run go vet
make vet
# Format code
make fmt
# Download dependencies
make deps
# Tidy dependencies
make tidy
# Verify dependencies
make verify
# Create a release (requires proper git tags and GitHub token)
make release
# Create a snapshot release for testing
make release-snapshot
# Build Docker image
make docker-build
# Push Docker image
make docker-push
# Run the application directly
make run
# Clean build artifacts
make clean
# Check if required tools are installed
make check-tools
# Display help for all commands
make help
Before developing, ensure you have the following tools installed:
- Go 1.22+ (check with
go version
) - golangci-lint (
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
) - goreleaser (see installation guide)
- Docker (for building container images)
Contributions are greatly appreciated! Pull requests will be reviewed and merged promptly if you're interested in improving the exporter!
- Fork the project
- Create your feature branch:
git checkout -b feat/new-metric-profit
- Commit your changes:
git commit -m 'feat(profit): Export new metric: profit
- Push to the branch:
-
git push origin feat/new-metric-profit
- Open a pull request
Sam - @samcmau