Documentation ¶
Index ¶
- Variables
- func ConstructFiltersFromMap(in map[string]string) string
- func ConstructIdLabelsForRecordingRule(alertName, alertId string) map[string]string
- func ConstructRecordingRuleName(prefix, typeName string) string
- func CortexRuleIdFromUuid(id string) string
- func ParseAlertManagerWebhookPayload(annotations []gjson.Result) ([]*alertingv1.TriggerAlertsRequest, []error)
- func ParseCortexPayloadBytes(inputPayload []byte) ([]gjson.Result, error)
- func TimeDurationToPromStr(t time.Duration) string
- type MockCortexPayload
- type RuleGroupYAMLv2
Constants ¶
This section is empty.
Variables ¶
View Source
var OpniDisconnect *alertingv1.AlertCondition = &alertingv1.AlertCondition{ Name: "Disconnected Opni Agent {{ .agentId }} ", Description: "Opni agent {{ .agentId }} has been disconnected for more than {{ .timeout }}", Labels: []string{"opni", "agent", "system"}, Severity: alertingv1.OpniSeverity_Critical, AlertType: &alertingv1.AlertTypeDetails{Type: &alertingv1.AlertTypeDetails_System{}}, }
View Source
var RequiredCortexWebhookAnnotationIdentifiers = []string{"conditionId"}
Functions ¶
func ConstructFiltersFromMap ¶
func CortexRuleIdFromUuid ¶
func ParseAlertManagerWebhookPayload ¶
func ParseAlertManagerWebhookPayload(annotations []gjson.Result) ([]*alertingv1.TriggerAlertsRequest, []error)
func ParseCortexPayloadBytes ¶
func TimeDurationToPromStr ¶
Types ¶
type MockCortexPayload ¶
func NewSimpleMockAlertManagerPayloadFromAnnotations ¶
func NewSimpleMockAlertManagerPayloadFromAnnotations(ann map[string]string) *MockCortexPayload
type RuleGroupYAMLv2 ¶
type RuleGroupYAMLv2 struct { Name string `yaml:"name"` Interval prommodel.Duration `yaml:"interval,omitempty"` Rules []rulefmt.Rule `yaml:"rules"` }
Marshals to the same format a cortex rule group expects
func NewCortexAlertingRule ¶
func NewCortexAlertingRule( alertId, alertName string, opniLabels, opniAnnotations map[string]string, info alertingv1.IndexableMetric, interval *time.Duration, rule metrics.AlertRuleBuilder, ) (*RuleGroupYAMLv2, error)
Click to show internal directories.
Click to hide internal directories.