Grafana - solidsnakedev/cardano_commands GitHub Wiki

Create Scrapre configuration

cat > prometheus.yml << EOF
global:
  scrape_interval:     15s # By default, scrape targets every 15 seconds.

  # Attach these labels to any time series or alerts when communicating with
  # external systems (federation, remote storage, Alertmanager).
  external_labels:
    monitor: 'codelab-monitor'

# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
  # The job name is added as a label job=<job_name> to any timeseries scraped from this config.
  - job_name: 'prometheus'

    static_configs:
      - targets: ['x.x.x.x:9100'] # Block producer IP Address
      - targets: ['x.x.x.x:12798'] # Block producer IP Address
        labels:
          alias: 'block-producer-node'
          type:  'cardano-node'
      - targets: ['localhost:9100']
      - targets: ['localhost:12798']
        labels:
          alias: 'relaynode1'
          type:  'cardano-node'
EOF
sudo mv prometheus.yml /etc/prometheus/prometheus.yml
⚠️ **GitHub.com Fallback** ⚠️