Skip to content

aztec-scan/aztecmonitor

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Aztec Monitor

A Prometheus-based monitoring tool for Aztec Sequencer nodes.

Features

This tool monitors multiple Aztec nodes and exports the following metrics:

  • aztec_node_status: Health status of Aztec node (1=healthy, 0=unhealthy)
  • aztec_latest_number: Latest block number on Aztec L2
  • aztec_proven_number: Latest proven block number on Aztec L2
  • aztec_finalized_number: Latest finalized block number on Aztec L2
  • address_l1_balance: L1 ETH balance of the monitored address
  • aztec_p2p_status: P2P TCP port connectivity status (1=connected, 0=disconnected)

All metrics include the following labels:

  • host_name: Name of the monitored host
  • host_ip: IP address of the monitored host
  • node_version: Version of the Aztec node
  • l1_chain_id: L1 chain ID
  • address: Monitored Ethereum address

Installation

# Clone the repository
git clone https://github.com/ronnynth/aztecmonitor.git
cd aztecmonitor

# Download dependencies
go mod download

# Build the binary
go build -o aztecmonitor

Configuration

Create a config.yaml file based on the example:

server:
  http_port: 3008    # Port for metrics and health endpoints
  pprof_port: 6068   # Port for pprof debugging

aztec:
  - host_ip: "127.0.0.1"
    host_name: "aztec-node-01"
    rpc_port: 8080
    tcp_port: 40400
    address: "0x1234567890123456789012345678901234567890"
    l1_chain_rpc: "https://eth-sepolia.g.alchemy.com/v2/YOUR_API_KEY"
    check_second: 30
  
  - host_ip: "192.168.1.100"
    host_name: "aztec-node-02"
    rpc_port: 8080
    tcp_port: 40400
    address: "0xabcdefabcdefabcdefabcdefabcdefabcdefabcd"
    l1_chain_rpc: "https://eth-sepolia.g.alchemy.com/v2/YOUR_API_KEY"
    check_second: 30

Configuration Fields

Server Configuration

  • http_port: Port for metrics and health endpoints (default: 3008)
  • pprof_port: Port for pprof debugging endpoint (default: 6068)

Aztec Node Configuration

  • host_ip: IP address of the Aztec node
  • host_name: Friendly name for the node (used in metrics labels)
  • rpc_port: JSON-RPC port of the Aztec node (default: 8080)
  • tcp_port: P2P TCP port to check connectivity (default: 40400)
  • address: Ethereum address to monitor L1 balance
  • l1_chain_rpc: L1 Ethereum RPC endpoint for balance checks
  • check_second: Check interval in seconds (default: 30)

Usage

# Run with custom config file
./aztecmonitor -conf /path/to/config.yaml

# Enable verbose logging
./aztecmonitor -logtostderr=true -v=5

Metrics Endpoint

The metrics are exposed on port 3008 at the /metrics endpoint:

http://localhost:3008/metrics

Add Prometheus Config

scrape_configs:
  - job_name: 'aztec-nodes'
    static_configs:
      - targets: ['localhost:3008']
    scrape_interval: 30s
    metrics_path: /metrics

Grafana Dashboard

Import the included grafana-dashboard.json to visualize the metrics in Grafana. nodes

API Endpoints Used

The monitor uses the following Aztec node API endpoints:

  1. node_getNodeInfo: Retrieves node version and L1 chain ID
  2. node_isReady: Checks if the node is ready and healthy
  3. node_getL2Tips: Gets latest, proven, and finalized block numbers
  4. eth_getBalance: Queries L1 balance (via L1 RPC endpoint)

Health Check

A health check endpoint is available at:

http://localhost:3008/health

Debugging

For debugging, a pprof server is available at:

http://localhost:6068/debug/pprof/

Requirements

  • Go 1.23.6 or later
  • Access to Aztec node RPC endpoints
  • Access to L1 Ethereum RPC endpoint (for balance monitoring)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%