Class RelabelConfig

  • All Implemented Interfaces:
    io.fabric8.kubernetes.api.builder.Editable<RelabelConfigBuilder>, io.fabric8.kubernetes.api.model.KubernetesResource, Serializable

    @Generated("io.fabric8.kubernetes.schema.generator.model.ModelGenerator")
    public class RelabelConfig
    extends Object
    implements io.fabric8.kubernetes.api.builder.Editable<RelabelConfigBuilder>, io.fabric8.kubernetes.api.model.KubernetesResource
    RelabelConfig allows dynamic rewriting of label sets for alerts. See Prometheus documentation: - https://prometheus.io/docs/prometheus/latest/configuration/configuration/#alert_relabel_configs - https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config
    See Also:
    Serialized Form
    • Constructor Detail

      • RelabelConfig

        public RelabelConfig()
        No args constructor for use in serialization
    • Method Detail

      • getAction

        public String getAction()
        action to perform based on regex matching. Must be one of: 'Replace', 'Keep', 'Drop', 'HashMod', 'LabelMap', 'LabelDrop', or 'LabelKeep'. Default is: 'Replace'
      • setAction

        public void setAction​(String action)
        action to perform based on regex matching. Must be one of: 'Replace', 'Keep', 'Drop', 'HashMod', 'LabelMap', 'LabelDrop', or 'LabelKeep'. Default is: 'Replace'
      • getModulus

        public Long getModulus()
        modulus to take of the hash of the source label values. This can be combined with the 'HashMod' action to set 'target_label' to the 'modulus' of a hash of the concatenated 'source_labels'. This is only valid if sourceLabels is not empty and action is not 'LabelKeep' or 'LabelDrop'.
      • setModulus

        public void setModulus​(Long modulus)
        modulus to take of the hash of the source label values. This can be combined with the 'HashMod' action to set 'target_label' to the 'modulus' of a hash of the concatenated 'source_labels'. This is only valid if sourceLabels is not empty and action is not 'LabelKeep' or 'LabelDrop'.
      • getRegex

        public String getRegex()
        regex against which the extracted value is matched. Default is: '(.*)' regex is required for all actions except 'HashMod'
      • setRegex

        public void setRegex​(String regex)
        regex against which the extracted value is matched. Default is: '(.*)' regex is required for all actions except 'HashMod'
      • getReplacement

        public String getReplacement()
        replacement value against which a regex replace is performed if the regular expression matches. This is required if the action is 'Replace' or 'LabelMap' and forbidden for actions 'LabelKeep' and 'LabelDrop'. Regex capture groups are available. Default is: '$1'
      • setReplacement

        public void setReplacement​(String replacement)
        replacement value against which a regex replace is performed if the regular expression matches. This is required if the action is 'Replace' or 'LabelMap' and forbidden for actions 'LabelKeep' and 'LabelDrop'. Regex capture groups are available. Default is: '$1'
      • getSeparator

        public String getSeparator()
        separator placed between concatenated source label values. When omitted, Prometheus will use its default value of ';'.
      • setSeparator

        public void setSeparator​(String separator)
        separator placed between concatenated source label values. When omitted, Prometheus will use its default value of ';'.
      • getSourceLabels

        public List<String> getSourceLabels()
        sourceLabels select values from existing labels. Their content is concatenated using the configured separator and matched against the configured regular expression for the 'Replace', 'Keep', and 'Drop' actions. Not allowed for actions 'LabelKeep' and 'LabelDrop'.
      • setSourceLabels

        public void setSourceLabels​(List<String> sourceLabels)
        sourceLabels select values from existing labels. Their content is concatenated using the configured separator and matched against the configured regular expression for the 'Replace', 'Keep', and 'Drop' actions. Not allowed for actions 'LabelKeep' and 'LabelDrop'.
      • getTargetLabel

        public String getTargetLabel()
        targetLabel to which the resulting value is written in a 'Replace' action. It is required for 'Replace' and 'HashMod' actions and forbidden for actions 'LabelKeep' and 'LabelDrop'. Regex capture groups are available.
      • setTargetLabel

        public void setTargetLabel​(String targetLabel)
        targetLabel to which the resulting value is written in a 'Replace' action. It is required for 'Replace' and 'HashMod' actions and forbidden for actions 'LabelKeep' and 'LabelDrop'. Regex capture groups are available.
      • getAdditionalProperties

        public Map<String,​Object> getAdditionalProperties()
      • setAdditionalProperty

        public void setAdditionalProperty​(String name,
                                          Object value)
      • setAdditionalProperties

        public void setAdditionalProperties​(Map<String,​Object> additionalProperties)