Anya Core Monitoring Guide

Table of Contents

[AIR-3][AIS-3][BPC-3][RES-3]

Overview

The Anya Core monitoring stack provides comprehensive observability for your node with the following components:

  • Prometheus: Metrics collection and storage
  • Grafana: Visualization and dashboards
  • Alertmanager: Alert management and routing
  • Node Exporter: System metrics
  • cAdvisor: Container metrics
  • Loki: Log aggregation
  • Promtail: Log collection

Getting Started

Prerequisites

  • Docker and Docker Compose installed
  • Minimum 2GB RAM (4GB recommended)
  • 10GB free disk space for metrics storage

Installation

Monitoring can be installed in two ways:

  1. During Initial Installation

bash ./scripts/install/main_installer.sh --with-monitoring

  1. Adding to Existing Installation

bash cd /path/to/anya-core ./monitoring/start-monitoring.sh

Accessing the Dashboards

Grafana

  • URL: http://localhost:3000
  • Default Credentials:
  • Username: admin
  • Password: admin123 (change on first login)

Prometheus

Alertmanager

Configuration

Email Notifications

To configure email notifications, edit the .env file in the monitoring directory:

# Monitoring/.env
SMTP_FROM=botshelomokoka@gmail.com
SMTP_SMARTHOST=smtp.gmail.com:587
SMTP_AUTH_USERNAME=botshelomokoka@gmail.com
SMTP_AUTH_PASSWORD=your-gmail-app-password
SMTP_HELO=gmail.com

# Alert Recipients
ALERT_EMAIL_RECIPIENT=botshelomokoka@gmail.com
MAINNET_ALERT_RECIPIENT=mainnet-alerts@anyacore.org

Note: For Gmail, you'll need to generate an App Password if 2FA is enabled.

Alert Rules

Alert rules are defined in monitoring/prometheus/alerts/. The default rules include:

  • Node down
  • High CPU usage
  • High memory usage
  • Disk space warnings
  • Service restarts

Dashboards

Available Dashboards

  1. Anya Core Overview
  2. Node status
  3. Sync status
  4. Network connections
  5. Resource usage

  6. Bitcoin Node

  7. Block height
  8. Mempool size
  9. Peer connections
  10. RPC metrics

  11. System

  12. CPU/Memory/Disk usage
  13. Network I/O
  14. Container metrics

Troubleshooting

Common Issues

  1. Grafana Login Issues
  2. Default credentials: admin/admin123
  3. Reset password: docker-compose -f monitoring/docker-compose.yml exec grafana grafana-cli admin reset-admin-password newpassword

  4. Prometheus Targets Down

  5. Check if services are running: docker ps
  6. View logs: docker-compose -f monitoring/docker-compose.yml logs prometheus

  7. Email Notifications Not Working

  8. Verify SMTP settings in .env
  9. Check Alertmanager logs: docker-compose -f monitoring/docker-compose.yml logs alertmanager

Backup and Restore

Backup Monitoring Data

# Create backup directory
mkdir -p /backup/monitoring

# Backup Prometheus data
docker run --rm -v monitoring_prometheus_data:/source -v /backup/monitoring:/backup alpine tar czf /backup/prometheus-$(date +%Y%m%d).tar.gz -C /source .

# Backup Grafana data
docker run --rm -v monitoring_grafana_data:/source -v /backup/monitoring:/backup alpine tar czf /backup/grafana-$(date +%Y%m%d).tar.gz -C /source .

Restore Monitoring Data

# Stop monitoring services
cd monitoring
docker-compose down

# Restore Prometheus data
docker run --rm -v monitoring_prometheus_data:/target -v /backup/monitoring:/backup alpine sh -c "rm -rf /target/* && tar xzf /backup/prometheus-20230521.tar.gz -C /target"

# Restore Grafana data
docker run --rm -v monitoring_grafana_data:/target -v /backup/monitoring:/backup alpine sh -c "rm -rf /target/* && tar xzf /backup/grafana-20230521.tar.gz -C /target"

# Start services
docker-compose up -d

Security Considerations

  1. Change Default Credentials
  2. Change Grafana admin password immediately
  3. Use strong passwords for all services

  4. Network Security

  5. Restrict access to monitoring ports (3000, 9090, 9093)
  6. Use a reverse proxy with HTTPS
  7. Enable authentication for all services

  8. Data Retention

  9. Configure retention policies in Prometheus
  10. Monitor disk usage for metrics storage

Support

For assistance with monitoring:

See Also