Harden production workflows and agent admission

This commit is contained in:
Stanislav Rossovskii
2026-05-28 14:19:27 +04:00
parent a2e88b4e76
commit 37b1a1d6d6
109 changed files with 4927 additions and 894 deletions

View File

@@ -28,6 +28,7 @@ type Metrics struct {
SendFailures *prometheus.CounterVec
EventsAccepted prometheus.Counter
EventsDedup prometheus.Counter
EventsDropped *prometheus.CounterVec
LastHeartbeat prometheus.Gauge
BuildInfo *prometheus.GaugeVec
}
@@ -86,6 +87,10 @@ func New() *Metrics {
Name: "monlet_agent_events_deduplicated_total",
Help: "Events the server reported as duplicates.",
})
m.EventsDropped = prometheus.NewCounterVec(prometheus.CounterOpts{
Name: "monlet_agent_events_dropped_total",
Help: "Events dropped by the agent before server acceptance, by reason (low-cardinality enum).",
}, []string{"reason"})
m.CheckStatus = prometheus.NewGaugeVec(prometheus.GaugeOpts{
Name: "monlet_agent_check_status",
Help: "Last observed status per check: 0=ok,1=warning,2=critical,3=unknown.",
@@ -123,7 +128,7 @@ func New() *Metrics {
m.CheckInterval, m.ChecksConfigured,
m.SpoolDepth, m.SpoolBytes,
m.SendAttempts, m.SendFailures,
m.EventsAccepted, m.EventsDedup,
m.EventsAccepted, m.EventsDedup, m.EventsDropped,
m.LastHeartbeat, m.BuildInfo)
return m
}