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 (*Manager) MarshalIndentJSON ¶
MarshalIndentJSON renders the manager as indented JSON.
func (*Manager) MarshalJSON ¶
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 ¶
ContactPoints defines the contact points that can receive alerts.
func DefaultContactPoint ¶
DefaultContactPoint sets the default contact point to be used when no specific routing policy applies.
func DefaultGroupBys ¶ added in v0.21.10
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.
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.