Implement Monlet MVP stack and UI updates

This commit is contained in:
Stanislav Rossovskii
2026-05-27 10:01:59 +04:00
parent dcea096327
commit edc51e9c59
145 changed files with 15618 additions and 248 deletions

View File

@@ -0,0 +1,54 @@
from prometheus_client import CollectorRegistry, Counter, Gauge, Histogram, generate_latest
from prometheus_client.exposition import CONTENT_TYPE_LATEST
REGISTRY = CollectorRegistry()
heartbeats_total = Counter(
"monlet_server_heartbeats_total",
"Total heartbeats received.",
["result"],
registry=REGISTRY,
)
events_total = Counter(
"monlet_server_events_total",
"Total events ingested.",
["result"],
registry=REGISTRY,
)
incidents_opened_total = Counter(
"monlet_server_incidents_opened_total",
"Total incidents opened.",
registry=REGISTRY,
)
incidents_resolved_total = Counter(
"monlet_server_incidents_resolved_total",
"Total incidents resolved.",
registry=REGISTRY,
)
agents_gauge = Gauge(
"monlet_server_agents",
"Agents by status.",
["status"],
registry=REGISTRY,
)
open_incidents_gauge = Gauge(
"monlet_server_open_incidents",
"Number of open incidents.",
registry=REGISTRY,
)
notifications_total = Counter(
"monlet_server_notifications_total",
"Notification delivery attempts by notifier and result.",
["notifier", "result"],
registry=REGISTRY,
)
request_duration = Histogram(
"monlet_server_request_duration_seconds",
"Request duration seconds.",
["path"],
registry=REGISTRY,
)
def render() -> tuple[bytes, str]:
return generate_latest(REGISTRY), CONTENT_TYPE_LATEST