← back to Watches

monitoring/prometheus/prometheus.yml

82 lines

global:
  scrape_interval: 15s
  evaluation_interval: 15s
  external_labels:
    cluster: 'omega-watches-production'
    environment: 'production'

# Alertmanager configuration
alerting:
  alertmanagers:
    - static_configs:
        - targets:
            - alertmanager:9093

# Load rules once and periodically evaluate them
rule_files:
  - "/etc/prometheus/alerts.yml"

# Scrape configurations
scrape_configs:
  # ============================================================================
  # Prometheus self-monitoring
  # ============================================================================
  - job_name: 'prometheus'
    static_configs:
      - targets: ['localhost:9090']

  # ============================================================================
  # Node Exporter - System metrics
  # ============================================================================
  - job_name: 'node-exporter'
    static_configs:
      - targets: ['node-exporter:9100']
        labels:
          instance: 'omega-watches-server'

  # ============================================================================
  # Omega Watches Application
  # ============================================================================
  - job_name: 'omega-watches'
    metrics_path: '/api/metrics'
    static_configs:
      - targets: ['45.61.58.125:7500']
        labels:
          app: 'omega-watches'
          environment: 'production'

  # ============================================================================
  # Redis Metrics
  # ============================================================================
  - job_name: 'redis'
    static_configs:
      - targets: ['redis-exporter:9121']

  # ============================================================================
  # Nginx Metrics (if nginx-prometheus-exporter is running)
  # ============================================================================
  - job_name: 'nginx'
    static_configs:
      - targets: ['45.61.58.125:7516']
    metrics_path: '/metrics'

  # ============================================================================
  # Blackbox Exporter - Endpoint monitoring
  # ============================================================================
  - job_name: 'blackbox'
    metrics_path: /probe
    params:
      module: [http_2xx]
    static_configs:
      - targets:
          - http://45.61.58.125:7500
          - http://45.61.58.125:7500/api/health
          - http://45.61.58.125:7500/api/watches
    relabel_configs:
      - source_labels: [__address__]
        target_label: __param_target
      - source_labels: [__param_target]
        target_label: instance
      - target_label: __address__
        replacement: blackbox-exporter:9115