Documentation
¶
Overview ¶
Package coalesce folds correlated Alertmanager incidents into a single investigation, suppressing the redundant per-alert investigations a storm would otherwise spawn. In-memory, mutex-guarded, clock injected for tests.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Constituents ¶ added in v0.9.0
func Constituents(batch []investigate.Request) []string
Constituents returns the DISTINCT constituent identities of a coalesced batch OTHER than the representative's (batch[0]) own, for surfacing in the seed as the storm's blast radius. Each entry prefers the workload ref ("ns/name" or "ns"), falling back to the alert title when the alert carries no workload. Order is stable (first-seen) and the list is capped at maxConstituents. Returns nil for a singleton batch (nothing beyond the representative to surface).
func Summarize ¶
func Summarize(reqs []investigate.Request) string
Summarize renders a one-line digest of a coalesced batch for the seed prompt.
Types ¶
type Coalescer ¶
type Coalescer struct {
Metrics *telemetry.Metrics // optional; nil-safe OTel counters
// contains filtered or unexported fields
}
Coalescer buffers correlated incidents and flushes one investigation per key.
func New ¶
func New(cfg Config, out func([]investigate.Request)) *Coalescer
New builds a Coalescer. out is called with each flushed batch.
func (*Coalescer) Add ¶
func (c *Coalescer) Add(r investigate.Request)
Add ingests one incident: critical → flush now; within cooldown → suppress; else buffer (flushing when MaxBatch is reached).
func (*Coalescer) Enqueue ¶ added in v0.2.0
func (c *Coalescer) Enqueue(r investigate.Request)
Enqueue satisfies investigate.Enqueuer by folding the request through the coalescer, so a source pipeline can route admitted Requests through coalescing.