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 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.