File size: 2,469 Bytes
049d0ed
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# SmartClass Prometheus Configuration
global:
  scrape_interval: 15s
  evaluation_interval: 15s
  scrape_timeout: 10s

# Alert rules
rule_files:
  - /etc/prometheus/rules/smartclass_alerts.yml

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

  # ─── SmartClass API Server ──────────────────────────────────────────
  - job_name: "smartclass-api"
    metrics_path: /metrics
    static_configs:
      - targets: ["api:8000"]
        labels:
          service: "api"
          environment: "production"
    scrape_interval: 10s

  # ─── SmartClass Edge Nodes ──────────────────────────────────────────
  - job_name: "smartclass-edge"
    metrics_path: /metrics
    static_configs:
      # Local test edge node
      - targets: ["edge:9100"]
        labels:
          service: "edge"
          section: "test"
          environment: "development"

      # Production edge nodes (add as deployed)
      # - targets: ["192.168.1.101:9100"]
      #   labels:
      #     service: "edge"
      #     section: "AIML-3-A"
      #     location: "room-301"
      #     environment: "production"
      # - targets: ["192.168.1.102:9100"]
      #   labels:
      #     service: "edge"
      #     section: "AIML-3-B"
      #     location: "room-302"
      #     environment: "production"

    scrape_interval: 10s
    # Relabel to add node hostname
    relabel_configs:
      - source_labels: [__address__]
        target_label: instance
        regex: "(.+):.*"
        replacement: "$1"

  # ─── Redis Exporter (optional) ──────────────────────────────────────
  # Uncomment if you add redis-exporter service
  # - job_name: "redis"
  #   static_configs:
  #     - targets: ["redis-exporter:9121"]

  # ─── PostgreSQL Exporter (optional) ─────────────────────────────────
  # Uncomment if you add postgres-exporter service
  # - job_name: "postgres"
  #   static_configs:
  #     - targets: ["postgres-exporter:9187"]