Documentation ¶
Index ¶
- Constants
- func GenerateRuleFileContent(groups []monitoringv1.RuleGroup) string
- func GetLabels(opts Options) map[string]string
- func GetRequiredLabels() map[string]string
- func MakeRulesConfigMaps(ruleFiles map[string]string) ([]corev1.ConfigMap, error)
- func NewRulerService(opts Options) *corev1.Service
- func NewRulerStatefulSet(opts Options) *appsv1.StatefulSet
- type Endpoint
- type Options
Constants ¶
const ( // Name is the name of the Thanos Ruler component. Name = "thanos-ruler" // ComponentName is the name of the Thanos Ruler component. ComponentName = "rule-evaluation-engine" GRPCPort = 10901 GRPCPortName = "grpc" HTTPPort = 9090 HTTPPortName = "http" )
Variables ¶
This section is empty.
Functions ¶
func GenerateRuleFileContent ¶
func GenerateRuleFileContent(groups []monitoringv1.RuleGroup) string
Convert PrometheusRule groups to YAML format
func GetRequiredLabels ¶
GetRequiredLabels returns a map of labels that can be used to look up thanos ruler resources. These labels are guaranteed to be present on all resources created by this package.
func MakeRulesConfigMaps ¶
makeRulesConfigMaps takes a rule files and returns a list of Kubernetes ConfigMaps to be later on mounted into the Thanos Ruler instance. If the total size of rule files exceeds the Kubernetes ConfigMap limit, they are split up via the simple first-fit [1] bin packing algorithm. In the future this can be replaced by a more sophisticated algorithm, but for now simplicity should be sufficient. [1] https://en.wikipedia.org/wiki/Bin_packing_problem#First-fit_algorithm
func NewRulerService ¶
func NewRulerStatefulSet ¶
func NewRulerStatefulSet(opts Options) *appsv1.StatefulSet
Types ¶
type Endpoint ¶
Endpoint represents a single QueryAPI DNS formatted address. TODO(saswatamcode): Add validation.
type Options ¶
type Options struct { manifests.Options Endpoints []Endpoint RuleFiles []corev1.ConfigMapKeySelector ObjStoreSecret corev1.SecretKeySelector Retention manifests.Duration AlertmanagerURL string ExternalLabels map[string]string AlertLabelDrop []string StorageSize resource.Quantity EvaluationInterval manifests.Duration }
Options for Thanos Ruler