rulespb

package
v0.0.0-...-834961c Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthRules = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowRules   = fmt.Errorf("proto: integer overflow")
)

Functions

func FromProto

func FromProto(rg *RuleGroupDesc) rulefmt.RuleGroup

FromProto generates a rulefmt RuleGroup. This function does a 1:1 mapping between the two data models.

Types

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"`
	KeepFiringFor time.Duration                                       `protobuf:"bytes,13,opt,name=keep_firing_for,json=keepFiringFor,proto3,stdduration" json:"keep_firing_for"`
	Labels        []github_com_grafana_mimir_pkg_mimirpb.LabelAdapter `protobuf:"bytes,5,rep,name=labels,proto3,customtype=github.com/grafana/mimir/pkg/mimirpb.LabelAdapter" json:"labels"`
	Annotations   []github_com_grafana_mimir_pkg_mimirpb.LabelAdapter `` /* 126-byte string literal not displayed */
}

RuleDesc is a proto representation of a Prometheus Rule

func (*RuleDesc) Descriptor

func (*RuleDesc) Descriptor() ([]byte, []int)

func (*RuleDesc) Equal

func (this *RuleDesc) Equal(that interface{}) bool

func (*RuleDesc) GetAlert

func (m *RuleDesc) GetAlert() string

func (*RuleDesc) GetExpr

func (m *RuleDesc) GetExpr() string

func (*RuleDesc) GetFor

func (m *RuleDesc) GetFor() time.Duration

func (*RuleDesc) GetKeepFiringFor

func (m *RuleDesc) GetKeepFiringFor() time.Duration

func (*RuleDesc) GetRecord

func (m *RuleDesc) GetRecord() string

func (*RuleDesc) GoString

func (this *RuleDesc) GoString() string

func (*RuleDesc) Marshal

func (m *RuleDesc) Marshal() (dAtA []byte, err error)

func (*RuleDesc) MarshalTo

func (m *RuleDesc) MarshalTo(dAtA []byte) (int, error)

func (*RuleDesc) MarshalToSizedBuffer

func (m *RuleDesc) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*RuleDesc) ProtoMessage

func (*RuleDesc) ProtoMessage()

func (*RuleDesc) Reset

func (m *RuleDesc) Reset()

func (*RuleDesc) Size

func (m *RuleDesc) Size() (n int)

func (*RuleDesc) String

func (this *RuleDesc) String() string

func (*RuleDesc) Unmarshal

func (m *RuleDesc) Unmarshal(dAtA []byte) error

func (*RuleDesc) XXX_DiscardUnknown

func (m *RuleDesc) XXX_DiscardUnknown()

func (*RuleDesc) XXX_Marshal

func (m *RuleDesc) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RuleDesc) XXX_Merge

func (m *RuleDesc) XXX_Merge(src proto.Message)

func (*RuleDesc) XXX_Size

func (m *RuleDesc) XXX_Size() int

func (*RuleDesc) XXX_Unmarshal

func (m *RuleDesc) XXX_Unmarshal(b []byte) error

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"`
	User      string        `protobuf:"bytes,6,opt,name=user,proto3" json:"user,omitempty"`
	// The options field can be used to extend Mimir Ruler functionality without
	// having to repeatedly redefine the proto description. It can also be leveraged
	// to create custom `ManagerOpts` based on rule configs which can then be passed
	// to the Prometheus Manager.
	Options       []*types.Any `protobuf:"bytes,9,rep,name=options,proto3" json:"options,omitempty"`
	SourceTenants []string     `protobuf:"bytes,10,rep,name=sourceTenants,proto3" json:"sourceTenants,omitempty"`
	// Deprecated: use queryOffset instead.
	EvaluationDelay               time.Duration `protobuf:"bytes,11,opt,name=evaluationDelay,proto3,stdduration" json:"evaluationDelay"`
	QueryOffset                   time.Duration `protobuf:"bytes,13,opt,name=queryOffset,proto3,stdduration" json:"queryOffset"`
	AlignEvaluationTimeOnInterval bool          `` /* 156-byte string literal not displayed */
}

RuleGroupDesc is a proto representation of a mimir rule group.

func ToProto

func ToProto(user string, namespace string, rl rulefmt.RuleGroup) *RuleGroupDesc

ToProto transforms a formatted prometheus rulegroup to a rule group protobuf. This function does a 1:1 mapping between the two data models.

func (*RuleGroupDesc) Descriptor

func (*RuleGroupDesc) Descriptor() ([]byte, []int)

func (*RuleGroupDesc) Equal

func (this *RuleGroupDesc) Equal(that interface{}) bool

func (*RuleGroupDesc) GetAlignEvaluationTimeOnInterval

func (m *RuleGroupDesc) GetAlignEvaluationTimeOnInterval() bool

func (*RuleGroupDesc) GetEvaluationDelay

func (m *RuleGroupDesc) GetEvaluationDelay() time.Duration

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) GetOptions

func (m *RuleGroupDesc) GetOptions() []*types.Any

func (*RuleGroupDesc) GetQueryOffset

func (m *RuleGroupDesc) GetQueryOffset() time.Duration

func (*RuleGroupDesc) GetRules

func (m *RuleGroupDesc) GetRules() []*RuleDesc

func (*RuleGroupDesc) GetSourceTenants

func (m *RuleGroupDesc) GetSourceTenants() []string

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) MarshalTo

func (m *RuleGroupDesc) MarshalTo(dAtA []byte) (int, error)

func (*RuleGroupDesc) MarshalToSizedBuffer

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][]rulefmt.RuleGroup

Formatted returns the rule group list as a set of formatted rule groups mapped by namespace

Jump to

Keyboard shortcuts

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