github.com/yankunsam/loki/v2@v2.6.3-0.20220817130409-389df5235c27/pkg/ruler/util/relabel.go (about)

     1  package util
     2  
     3  // copy and modification of github.com/prometheus/prometheus/model/relabel/relabel.go
     4  // reason: the custom types in github.com/prometheus/prometheus/model/relabel/relabel.go are difficult to unmarshal
     5  type RelabelConfig struct {
     6  	// A list of labels from which values are taken and concatenated
     7  	// with the configured separator in order.
     8  	SourceLabels []string `yaml:"source_labels,flow,omitempty" json:"source_labels,omitempty"`
     9  	// Separator is the string between concatenated values from the source labels.
    10  	Separator string `yaml:"separator,omitempty" json:"separator,omitempty"`
    11  	// Regex against which the concatenation is matched.
    12  	Regex string `yaml:"regex,omitempty" json:"regex,omitempty"`
    13  	// Modulus to take of the hash of concatenated values from the source labels.
    14  	Modulus uint64 `yaml:"modulus,omitempty" json:"modulus,omitempty"`
    15  	// TargetLabel is the label to which the resulting string is written in a replacement.
    16  	// Regexp interpolation is allowed for the replace action.
    17  	TargetLabel string `yaml:"target_label,omitempty" json:"target_label,omitempty"`
    18  	// Replacement is the regex replacement pattern to be used.
    19  	Replacement string `yaml:"replacement,omitempty" json:"replacement,omitempty"`
    20  	// Action is the action to be performed for the relabeling.
    21  	Action string `yaml:"action,omitempty" json:"action,omitempty"`
    22  }