Documentation
¶
Index ¶
Constants ¶
const SecretToken = "<secret>"
Variables ¶
var SecretTokenJSON string
Functions ¶
This section is empty.
Types ¶
type InhibitRule ¶
type InhibitRule struct {
// Name is an optional name for the inhibition rule.
Name string `yaml:"name,omitempty" json:"name,omitempty"`
// SourceMatch defines a set of labels that have to equal the given
// value for source alerts. Deprecated. Remove before v1.0 release.
SourceMatch map[string]string `yaml:"source_match,omitempty" json:"source_match,omitempty"`
// SourceMatchRE defines pairs like SourceMatch but does regular expression
// matching. Deprecated. Remove before v1.0 release.
SourceMatchRE MatchRegexps `yaml:"source_match_re,omitempty" json:"source_match_re,omitempty"`
// SourceMatchers defines a set of label matchers that have to be fulfilled for source alerts.
SourceMatchers Matchers `yaml:"source_matchers,omitempty" json:"source_matchers,omitempty"`
// TargetMatch defines a set of labels that have to equal the given
// value for target alerts. Deprecated. Remove before v1.0 release.
TargetMatch map[string]string `yaml:"target_match,omitempty" json:"target_match,omitempty"`
// TargetMatchRE defines pairs like TargetMatch but does regular expression
// matching. Deprecated. Remove before v1.0 release.
TargetMatchRE MatchRegexps `yaml:"target_match_re,omitempty" json:"target_match_re,omitempty"`
// TargetMatchers defines a set of label matchers that have to be fulfilled for target alerts.
TargetMatchers Matchers `yaml:"target_matchers,omitempty" json:"target_matchers,omitempty"`
// A set of labels that must be equal between the source and target alert
// for them to be a match.
Equal []string `yaml:"equal,omitempty" json:"equal,omitempty"`
}
InhibitRule defines an inhibition rule that mutes alerts that match the target labels if an alert matching the source labels exists. Both alerts have to have a set of labels being equal.
func (*InhibitRule) UnmarshalYAML ¶
func (r *InhibitRule) UnmarshalYAML(unmarshal func(any) error) error
UnmarshalYAML implements the yaml.Unmarshaler interface for InhibitRule.
type MatchRegexps ¶
MatchRegexps represents a map of Regexp.
func (*MatchRegexps) UnmarshalYAML ¶
func (m *MatchRegexps) UnmarshalYAML(unmarshal func(any) error) error
UnmarshalYAML implements the yaml.Unmarshaler interface for MatchRegexps.
type Matchers ¶
Matchers is label.Matchers with an added UnmarshalYAML method to implement the yaml.Unmarshaler interface and MarshalYAML to implement the yaml.Marshaler interface.
func (Matchers) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface for Matchers.
func (Matchers) MarshalYAML ¶
MarshalYAML implements the yaml.Marshaler interface for Matchers.
func (*Matchers) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface for Matchers.
type NotifierConfig ¶
type NotifierConfig struct {
VSendResolved bool `yaml:"send_resolved" json:"send_resolved"`
}
NotifierConfig contains base options common across all notifier configurations.
func (*NotifierConfig) SendResolved ¶
func (nc *NotifierConfig) SendResolved() bool
type Regexp ¶
Regexp encapsulates a regexp.Regexp and makes it YAML marshalable.
func (Regexp) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface for Regexp.
func (Regexp) MarshalYAML ¶
MarshalYAML implements the yaml.Marshaler interface for Regexp.
func (*Regexp) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface for Regexp.
type SecretTemplateURL ¶
SecretTemplateURL is a Secret string that represents a URL which may contain Go template syntax. Unlike SecretURL, it allows templated values and only validates non-templated URLs at unmarshal time.
func (SecretTemplateURL) MarshalJSON ¶
func (s SecretTemplateURL) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface for SecretTemplateURL.
func (SecretTemplateURL) MarshalYAML ¶
func (s SecretTemplateURL) MarshalYAML() (any, error)
MarshalYAML implements the yaml.Marshaler interface for SecretTemplateURL.
func (*SecretTemplateURL) UnmarshalJSON ¶
func (s *SecretTemplateURL) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaler interface for SecretTemplateURL.
func (*SecretTemplateURL) UnmarshalYAML ¶
func (s *SecretTemplateURL) UnmarshalYAML(unmarshal func(any) error) error
UnmarshalYAML implements the yaml.Unmarshaler interface for SecretTemplateURL.
type SecretURL ¶
type SecretURL URL
SecretURL is a URL that must not be revealed on marshaling.
func (SecretURL) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface for SecretURL.
func (SecretURL) MarshalYAML ¶
MarshalYAML implements the yaml.Marshaler interface for SecretURL.
func (*SecretURL) UnmarshalJSON ¶
UnmarshalJSON implements the json.Marshaler interface for SecretURL.
type URL ¶
URL is a custom type that represents an HTTP or HTTPS URL and allows validation at configuration load time.
func MustParseURL ¶
func (URL) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface for URL.
func (URL) MarshalYAML ¶
MarshalYAML implements the yaml.Marshaler interface for URL.
func (*URL) UnmarshalJSON ¶
UnmarshalJSON implements the json.Marshaler interface for URL.