Documentation
¶
Index ¶
- Variables
- func FromProto(rg *RuleGroupDesc) legacy_rulefmt.RuleGroup
- type AlertDesc
- func (*AlertDesc) Descriptor() ([]byte, []int)
- func (this *AlertDesc) Equal(that interface{}) bool
- func (m *AlertDesc) GetActiveAt() time.Time
- func (m *AlertDesc) GetFiredAt() time.Time
- func (m *AlertDesc) GetLastSentAt() time.Time
- func (m *AlertDesc) GetResolvedAt() time.Time
- func (m *AlertDesc) GetState() string
- func (m *AlertDesc) GetValidUntil() time.Time
- func (m *AlertDesc) GetValue() float64
- func (this *AlertDesc) GoString() string
- func (m *AlertDesc) Marshal() (dAtA []byte, err error)
- func (m *AlertDesc) MarshalTo(dAtA []byte) (int, error)
- func (m *AlertDesc) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*AlertDesc) ProtoMessage()
- func (m *AlertDesc) Reset()
- func (m *AlertDesc) Size() (n int)
- func (this *AlertDesc) String() string
- func (m *AlertDesc) Unmarshal(dAtA []byte) error
- func (m *AlertDesc) XXX_DiscardUnknown()
- func (m *AlertDesc) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *AlertDesc) XXX_Merge(src proto.Message)
- func (m *AlertDesc) XXX_Size() int
- func (m *AlertDesc) XXX_Unmarshal(b []byte) error
- type ConfigRuleStore
- type RuleDesc
- func (*RuleDesc) Descriptor() ([]byte, []int)
- func (this *RuleDesc) Equal(that interface{}) bool
- func (m *RuleDesc) GetAlert() string
- func (m *RuleDesc) GetAlerts() []*AlertDesc
- func (m *RuleDesc) GetEvaluationDuration() time.Duration
- func (m *RuleDesc) GetEvaluationTimestamp() time.Time
- func (m *RuleDesc) GetExpr() string
- func (m *RuleDesc) GetFor() time.Duration
- func (m *RuleDesc) GetHealth() string
- func (m *RuleDesc) GetLastError() string
- func (m *RuleDesc) GetRecord() string
- func (m *RuleDesc) GetState() string
- func (this *RuleDesc) GoString() string
- func (m *RuleDesc) Marshal() (dAtA []byte, err error)
- func (m *RuleDesc) MarshalTo(dAtA []byte) (int, error)
- func (m *RuleDesc) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*RuleDesc) ProtoMessage()
- func (m *RuleDesc) Reset()
- func (m *RuleDesc) Size() (n int)
- func (this *RuleDesc) String() string
- func (m *RuleDesc) Unmarshal(dAtA []byte) error
- func (m *RuleDesc) XXX_DiscardUnknown()
- func (m *RuleDesc) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *RuleDesc) XXX_Merge(src proto.Message)
- func (m *RuleDesc) XXX_Size() int
- func (m *RuleDesc) XXX_Unmarshal(b []byte) error
- type RuleGroupDesc
- func (*RuleGroupDesc) Descriptor() ([]byte, []int)
- func (this *RuleGroupDesc) Equal(that interface{}) bool
- func (m *RuleGroupDesc) GetDeleted() bool
- func (m *RuleGroupDesc) GetEvaluationDuration() time.Duration
- func (m *RuleGroupDesc) GetEvaluationTimestamp() time.Time
- func (m *RuleGroupDesc) GetInterval() time.Duration
- func (m *RuleGroupDesc) GetName() string
- func (m *RuleGroupDesc) GetNamespace() string
- func (m *RuleGroupDesc) GetRules() []*RuleDesc
- func (m *RuleGroupDesc) GetUser() string
- func (this *RuleGroupDesc) GoString() string
- func (m *RuleGroupDesc) Marshal() (dAtA []byte, err error)
- func (m *RuleGroupDesc) MarshalTo(dAtA []byte) (int, error)
- func (m *RuleGroupDesc) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*RuleGroupDesc) ProtoMessage()
- func (m *RuleGroupDesc) Reset()
- func (m *RuleGroupDesc) Size() (n int)
- func (this *RuleGroupDesc) String() string
- func (m *RuleGroupDesc) Unmarshal(dAtA []byte) error
- func (m *RuleGroupDesc) XXX_DiscardUnknown()
- func (m *RuleGroupDesc) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *RuleGroupDesc) XXX_Merge(src proto.Message)
- func (m *RuleGroupDesc) XXX_Size() int
- func (m *RuleGroupDesc) XXX_Unmarshal(b []byte) error
- type RuleGroupList
- type RuleStore
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidLengthRules = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowRules = fmt.Errorf("proto: integer overflow") )
View Source
var ( // ErrGroupNotFound is returned if a rule group does not exist ErrGroupNotFound = errors.New("group does not exist") // ErrGroupNamespaceNotFound is returned if a namespace does not exist ErrGroupNamespaceNotFound = errors.New("group namespace does not exist") // ErrUserNotFound is returned if the user does not currently exist ErrUserNotFound = errors.New("no rule groups found for user") )
Functions ¶
func FromProto ¶
func FromProto(rg *RuleGroupDesc) legacy_rulefmt.RuleGroup
FromProto generates a rulefmt RuleGroup
Types ¶
type AlertDesc ¶ added in v0.7.0
type AlertDesc struct { State string `protobuf:"bytes,1,opt,name=state,proto3" json:"state,omitempty"` Labels []github_com_cortexproject_cortex_pkg_ingester_client.LabelAdapter `` /* 131-byte string literal not displayed */ Annotations []github_com_cortexproject_cortex_pkg_ingester_client.LabelAdapter `` /* 141-byte string literal not displayed */ Value float64 `protobuf:"fixed64,4,opt,name=value,proto3" json:"value,omitempty"` ActiveAt time.Time `protobuf:"bytes,5,opt,name=active_at,json=activeAt,proto3,stdtime" json:"active_at"` FiredAt time.Time `protobuf:"bytes,6,opt,name=fired_at,json=firedAt,proto3,stdtime" json:"fired_at"` ResolvedAt time.Time `protobuf:"bytes,7,opt,name=resolved_at,json=resolvedAt,proto3,stdtime" json:"resolved_at"` LastSentAt time.Time `protobuf:"bytes,8,opt,name=last_sent_at,json=lastSentAt,proto3,stdtime" json:"last_sent_at"` ValidUntil time.Time `protobuf:"bytes,9,opt,name=valid_until,json=validUntil,proto3,stdtime" json:"valid_until"` }
func (*AlertDesc) Descriptor ¶ added in v0.7.0
func (*AlertDesc) GetActiveAt ¶ added in v0.7.0
func (*AlertDesc) GetFiredAt ¶ added in v0.7.0
func (*AlertDesc) GetLastSentAt ¶ added in v0.7.0
func (*AlertDesc) GetResolvedAt ¶ added in v0.7.0
func (*AlertDesc) GetValidUntil ¶ added in v0.7.0
func (*AlertDesc) MarshalToSizedBuffer ¶ added in v0.7.0
func (*AlertDesc) ProtoMessage ¶ added in v0.7.0
func (*AlertDesc) ProtoMessage()
func (*AlertDesc) XXX_DiscardUnknown ¶ added in v0.7.0
func (m *AlertDesc) XXX_DiscardUnknown()
func (*AlertDesc) XXX_Marshal ¶ added in v0.7.0
func (*AlertDesc) XXX_Unmarshal ¶ added in v0.7.0
type ConfigRuleStore ¶
type ConfigRuleStore struct {
// contains filtered or unexported fields
}
ConfigRuleStore is a concrete implementation of RuleStore that sources rules from the config service
func NewConfigRuleStore ¶
func NewConfigRuleStore(c client.Client) *ConfigRuleStore
NewConfigRuleStore constructs a ConfigRuleStore
func (*ConfigRuleStore) ListAllRuleGroups ¶
func (c *ConfigRuleStore) ListAllRuleGroups(ctx context.Context) (map[string]RuleGroupList, error)
ListAllRuleGroups implements RuleStore
type RuleDesc ¶
type RuleDesc struct { Expr string `protobuf:"bytes,1,opt,name=expr,proto3" json:"expr,omitempty"` Record string `protobuf:"bytes,2,opt,name=record,proto3" json:"record,omitempty"` Alert string `protobuf:"bytes,3,opt,name=alert,proto3" json:"alert,omitempty"` For time.Duration `protobuf:"bytes,4,opt,name=for,proto3,stdduration" json:"for"` Labels []github_com_cortexproject_cortex_pkg_ingester_client.LabelAdapter `` /* 131-byte string literal not displayed */ Annotations []github_com_cortexproject_cortex_pkg_ingester_client.LabelAdapter `` /* 141-byte string literal not displayed */ State string `protobuf:"bytes,7,opt,name=state,proto3" json:"state,omitempty"` Health string `protobuf:"bytes,8,opt,name=health,proto3" json:"health,omitempty"` LastError string `protobuf:"bytes,9,opt,name=lastError,proto3" json:"lastError,omitempty"` Alerts []*AlertDesc `protobuf:"bytes,10,rep,name=alerts,proto3" json:"alerts,omitempty"` EvaluationTimestamp time.Time `protobuf:"bytes,11,opt,name=evaluationTimestamp,proto3,stdtime" json:"evaluationTimestamp"` EvaluationDuration time.Duration `protobuf:"bytes,12,opt,name=evaluationDuration,proto3,stdduration" json:"evaluationDuration"` }
RuleDesc is a proto representation of a Prometheus Rule
func (*RuleDesc) Descriptor ¶
func (*RuleDesc) GetEvaluationDuration ¶ added in v0.7.0
func (*RuleDesc) GetEvaluationTimestamp ¶ added in v0.7.0
func (*RuleDesc) GetLastError ¶ added in v0.7.0
func (*RuleDesc) MarshalToSizedBuffer ¶ added in v0.7.0
func (*RuleDesc) ProtoMessage ¶
func (*RuleDesc) ProtoMessage()
func (*RuleDesc) XXX_DiscardUnknown ¶
func (m *RuleDesc) XXX_DiscardUnknown()
func (*RuleDesc) XXX_Marshal ¶
func (*RuleDesc) XXX_Unmarshal ¶
type RuleGroupDesc ¶
type RuleGroupDesc struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` Interval time.Duration `protobuf:"bytes,3,opt,name=interval,proto3,stdduration" json:"interval"` Rules []*RuleDesc `protobuf:"bytes,4,rep,name=rules,proto3" json:"rules,omitempty"` Deleted bool `protobuf:"varint,5,opt,name=deleted,proto3" json:"deleted,omitempty"` User string `protobuf:"bytes,6,opt,name=user,proto3" json:"user,omitempty"` EvaluationTimestamp time.Time `protobuf:"bytes,7,opt,name=evaluationTimestamp,proto3,stdtime" json:"evaluationTimestamp"` EvaluationDuration time.Duration `protobuf:"bytes,8,opt,name=evaluationDuration,proto3,stdduration" json:"evaluationDuration"` }
RuleGroupDesc is a proto representation of a cortex rule group
func ToProto ¶
func ToProto(user string, namespace string, rl legacy_rulefmt.RuleGroup) *RuleGroupDesc
ToProto transforms a formatted prometheus rulegroup to a rule group protobuf
func (*RuleGroupDesc) Descriptor ¶
func (*RuleGroupDesc) Descriptor() ([]byte, []int)
func (*RuleGroupDesc) Equal ¶
func (this *RuleGroupDesc) Equal(that interface{}) bool
func (*RuleGroupDesc) GetDeleted ¶
func (m *RuleGroupDesc) GetDeleted() bool
func (*RuleGroupDesc) GetEvaluationDuration ¶ added in v0.7.0
func (m *RuleGroupDesc) GetEvaluationDuration() time.Duration
func (*RuleGroupDesc) GetEvaluationTimestamp ¶ added in v0.7.0
func (m *RuleGroupDesc) GetEvaluationTimestamp() time.Time
func (*RuleGroupDesc) GetInterval ¶
func (m *RuleGroupDesc) GetInterval() time.Duration
func (*RuleGroupDesc) GetName ¶
func (m *RuleGroupDesc) GetName() string
func (*RuleGroupDesc) GetNamespace ¶
func (m *RuleGroupDesc) GetNamespace() string
func (*RuleGroupDesc) GetRules ¶
func (m *RuleGroupDesc) GetRules() []*RuleDesc
func (*RuleGroupDesc) GetUser ¶
func (m *RuleGroupDesc) GetUser() string
func (*RuleGroupDesc) GoString ¶
func (this *RuleGroupDesc) GoString() string
func (*RuleGroupDesc) Marshal ¶
func (m *RuleGroupDesc) Marshal() (dAtA []byte, err error)
func (*RuleGroupDesc) MarshalToSizedBuffer ¶ added in v0.7.0
func (m *RuleGroupDesc) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*RuleGroupDesc) ProtoMessage ¶
func (*RuleGroupDesc) ProtoMessage()
func (*RuleGroupDesc) Reset ¶
func (m *RuleGroupDesc) Reset()
func (*RuleGroupDesc) Size ¶
func (m *RuleGroupDesc) Size() (n int)
func (*RuleGroupDesc) String ¶
func (this *RuleGroupDesc) String() string
func (*RuleGroupDesc) Unmarshal ¶
func (m *RuleGroupDesc) Unmarshal(dAtA []byte) error
func (*RuleGroupDesc) XXX_DiscardUnknown ¶
func (m *RuleGroupDesc) XXX_DiscardUnknown()
func (*RuleGroupDesc) XXX_Marshal ¶
func (m *RuleGroupDesc) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*RuleGroupDesc) XXX_Merge ¶
func (m *RuleGroupDesc) XXX_Merge(src proto.Message)
func (*RuleGroupDesc) XXX_Size ¶
func (m *RuleGroupDesc) XXX_Size() int
func (*RuleGroupDesc) XXX_Unmarshal ¶
func (m *RuleGroupDesc) XXX_Unmarshal(b []byte) error
type RuleGroupList ¶
type RuleGroupList []*RuleGroupDesc
RuleGroupList contains a set of rule groups
func (RuleGroupList) Formatted ¶
func (l RuleGroupList) Formatted() map[string][]legacy_rulefmt.RuleGroup
Formatted returns the rule group list as a set of formatted rule groups mapped by namespace
Click to show internal directories.
Click to hide internal directories.