Documentation
¶
Index ¶
- type Labeler
- func (l *Labeler) EnforceNamespaceLabel(rule *monitoringv1.PrometheusRule) error
- func (l *Labeler) GetEnforcedNamespaceLabel() string
- func (l *Labeler) GetRelabelingConfigs(monitorTypeMeta metav1.TypeMeta, monitorObjectMeta metav1.ObjectMeta, ...) []monitoringv1.RelabelConfig
- func (l *Labeler) IsExcluded(prometheusTypeMeta metav1.TypeMeta, prometheusObjectMeta metav1.ObjectMeta) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Labeler ¶
type Labeler struct {
// contains filtered or unexported fields
}
Labeler enables to enforce adding namespace labels to PrometheusRules and to metrics used in them.
func New ¶
func New(enforcedNsLabel string, excludeConfig []monitoringv1.ObjectReference, prometheusRuleLabeler bool) *Labeler
New - creates new Labeler enforcedNsLabel - label name to be enforced for namespace excludeConfig - list of ObjectReference to be excluded while enforcing adding namespace label prometheusRuleLabeler - whether this should apply for Prometheus or Thanos rules.
func (*Labeler) EnforceNamespaceLabel ¶
func (l *Labeler) EnforceNamespaceLabel(rule *monitoringv1.PrometheusRule) error
EnforceNamespaceLabel - adds(or modifies) namespace label to promRule labels with specified namespace and also adds namespace label to all the metrics used in promRule.
func (*Labeler) GetEnforcedNamespaceLabel ¶
func (*Labeler) GetRelabelingConfigs ¶
func (l *Labeler) GetRelabelingConfigs(monitorTypeMeta metav1.TypeMeta, monitorObjectMeta metav1.ObjectMeta, rc []monitoringv1.RelabelConfig) []monitoringv1.RelabelConfig
GetRelabelingConfigs - append the namespace enforcement relabeling rule.
func (*Labeler) IsExcluded ¶
func (l *Labeler) IsExcluded(prometheusTypeMeta metav1.TypeMeta, prometheusObjectMeta metav1.ObjectMeta) bool
IsExcluded returns true if the specified object is excluded from namespace enforcement, false otherwise.