alertmanager

package
v0.21.18 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Contact

type Contact struct {
	Builder *sdk.ContactPoint
}

Contact describes a contact point.

func ContactPoint

func ContactPoint(name string, opts ...ContactPointOption) Contact

ContactPoint defines a new contact point.

type ContactPointOption

type ContactPointOption func(contactPoint *Contact)

ContactPointOption represents an option that can be used to configure a contact point.

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager represents an alert manager.

func New

func New(opts ...Option) *Manager

New creates a new alert manager.

func (*Manager) MarshalIndentJSON

func (manager *Manager) MarshalIndentJSON() ([]byte, error)

MarshalIndentJSON renders the manager as indented JSON.

func (*Manager) MarshalJSON

func (manager *Manager) MarshalJSON() ([]byte, error)

MarshalJSON implements the encoding/json.Marshaler interface.

type Option

type Option func(manager *Manager)

Option represents an option that can be used to configure an alert manager.

func ContactPoints

func ContactPoints(contactPoints ...Contact) Option

ContactPoints defines the contact points that can receive alerts.

func DefaultContactPoint

func DefaultContactPoint(contactPoint string) Option

DefaultContactPoint sets the default contact point to be used when no specific routing policy applies.

func DefaultGroupBys added in v0.21.10

func DefaultGroupBys(labels ...string) Option

DefaultGroupBys sets the default labels that alerts should be grouped by.

func Routing

func Routing(policies ...RoutingPolicy) Option

Routing configures the routing policies to apply on alerts.

func Templates added in v0.21.7

func Templates(templates map[string]string) Option

Templates defines templates that can be used when sending messages to contact points. See https://prometheus.io/blog/2016/03/03/custom-alertmanager-templates/

type RoutingPolicy

type RoutingPolicy struct {
	// contains filtered or unexported fields
}

RoutingPolicy represents a routing policy.

func Policy

func Policy(contactPoint string, opts ...RoutingPolicyOption) RoutingPolicy

Policy defines a routing policy that applies to the given contact point. All the options given on this policy will be combined using a logical "AND".

type RoutingPolicyOption

type RoutingPolicyOption func(policy *RoutingPolicy)

RoutingPolicyOption represents an option that can be used to configure a routing policy.

func TagEq

func TagEq(tag string, value string) RoutingPolicyOption

TagEq defines an equality ("=") constraint between the given tag and value.

func TagMatches

func TagMatches(tag string, regex string) RoutingPolicyOption

TagMatches defines a similarity ("=~") constraint between the given tag and regex.

func TagNeq

func TagNeq(tag string, value string) RoutingPolicyOption

TagNeq defines a non-equality ("!=") constraint between the given tag and value.

func TagNotMatches

func TagNotMatches(tag string, regex string) RoutingPolicyOption

TagNotMatches defines a non-similarity ("!~") constraint between the given tag and regex.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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