marker

package
v0.35.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 9, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithContext

func WithContext(ctx context.Context, m AlertMarker) context.Context

WithContext returns a copy of ctx carrying the given AlertMarker. Inhibitor and Silencer extract it from the context to write per-group alert status.

Types

type AlertMarker

type AlertMarker interface {
	// SetInhibited sets the inhibitedBy for the given fingerprint.
	// If inhibitedBy is empty, it clears the inhibitedBy.
	SetInhibited(fingerprint model.Fingerprint, inhibitedBy []string)

	// SetSilenced sets the silencedBy for the given fingerprint.
	// If silencedBy is empty, it clears the silencedBy.
	SetSilenced(fingerprint model.Fingerprint, silencedBy []string)

	// Status returns the AlertStatus for the given fingerprint.
	// If the fingerprint is not found, it returns an unknown status.
	Status(fingerprint model.Fingerprint) alert.AlertStatus

	// Delete removes markers for the given fingerprints.
	Delete(fingerprints ...model.Fingerprint)
}

AlertMarker tracks per-alert silenced/inhibited status within a single aggregation group. Each aggregation group owns its own instance. All methods are goroutine-safe.

func FromContext

func FromContext(ctx context.Context) (AlertMarker, bool)

FromContext extracts the AlertMarker from ctx. If no marker is present, it returns (nil, false).

func NewAlertMarker

func NewAlertMarker() AlertMarker

NewAlertMarker returns a new AlertMarker backed by an in-memory map.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL