Skip to content

Latest commit

 

History

History
106 lines (76 loc) · 2.43 KB

File metadata and controls

106 lines (76 loc) · 2.43 KB
title Prometheus Setup
description Configure Prometheus to scrape and store metrics from your Aztec node's OpenTelemetry Collector.

Overview

Prometheus scrapes and stores the metrics exposed by the OTEL collector, providing a time-series database for querying and analysis.

Prerequisites

Setup Steps

Step 1: Create Prometheus Configuration

Create a prometheus.yml file:

global:
  scrape_interval: 15s
  evaluation_interval: 15s

scrape_configs:
  - job_name: 'aztec-node'
    static_configs:
      - targets: ['otel-collector:8889']
        labels:
          instance: 'aztec-node-1'

If you're running multiple nodes, adjust the instance label to uniquely identify each node.

Step 2: Add Prometheus to Docker Compose

Add Prometheus to your docker-compose.yml:

services:
  # ... existing services (otel-collector, etc.) ...

  prometheus:
    image: prom/prometheus:latest
    container_name: aztec-prometheus
    ports:
      - 9090:9090
    volumes:
      - ./prometheus.yml:/etc/prometheus/prometheus.yml
      - prometheus-data:/prometheus
    command:
      - '--config.file=/etc/prometheus/prometheus.yml'
      - '--storage.tsdb.path=/prometheus'
      - '--storage.tsdb.retention.time=30d'
    networks:
      - aztec
    restart: always

volumes:
  prometheus-data:

Step 3: Start Prometheus

docker compose up -d

Step 4: Verify Prometheus

Access Prometheus UI at http://localhost:9090 and verify:

  1. Go to Status → Targets to check that the aztec-node target is up
  2. Go to Graph and query a metric (e.g., aztec_archiver_block_height)

Using Prometheus

Query Metrics

Use the Prometheus UI to explore and query metrics:

  1. Navigate to http://localhost:9090/graph
  2. Enter a metric name in the query box (use autocomplete to discover available metrics)
  3. Click Execute to see the results
  4. Switch between Table and Graph views

Example Queries

# Current block height
aztec_archiver_block_height

# Blocks synced over time window
increase(aztec_archiver_block_height[5m])

# Memory usage
process_resident_memory_bytes

# CPU usage rate
rate(process_cpu_seconds_total[5m])

Next Steps