23 lines
728 B
Python
23 lines
728 B
Python
from prometheus_client import Gauge, Counter, start_http_server
|
|
|
|
# -----------------------------
|
|
# METRICS
|
|
# -----------------------------
|
|
|
|
# Node metrics
|
|
node_cpu = Gauge("fester_node_cpu", "CPU load per node", ["node"])
|
|
node_temp = Gauge("fester_node_temp", "Temperature per node", ["node"])
|
|
|
|
# Pipeline metrics
|
|
pipeline_actions = Counter("fester_pipeline_actions_total", "Total actions", ["state"])
|
|
cache_hits = Counter("fester_cache_hits_total", "Cache hits", ["target"])
|
|
|
|
# Scheduler metrics
|
|
scheduler_score = Gauge("fester_scheduler_score", "Node score", ["node", "target"])
|
|
|
|
# -----------------------------
|
|
# EXPORTER START
|
|
# -----------------------------
|
|
def start_metrics_server(port=9109):
|
|
start_http_server(port)
|