marker

package
v0.35.1 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: Apache-2.0 Imports: 5 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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