Documentation
¶
Overview ¶
Copyright 2020 The prometheus-operator Authors
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
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.PrometheusRuleExcludeConfig, prometheusRuleLabeler bool) *Labeler
New - creates new Labeler enforcedNsLabel - label name to be enforced for namespace excludeConfig - list of namespace + PrometheusRule names to be excluded while enforcing adding namespace label
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