Class RelabelConfig
- java.lang.Object
-
- io.fabric8.openshift.api.model.monitoring.v1.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 Summary
Constructors Constructor Description RelabelConfig()No args constructor for use in serializationRelabelConfig(String action, Long modulus, String regex, String replacement, String separator, List<String> sourceLabels, String targetLabel)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RelabelConfigBuilderedit()StringgetAction()action to perform based on regex matching.Map<String,Object>getAdditionalProperties()LonggetModulus()modulus to take of the hash of the source label values.StringgetRegex()regex against which the extracted value is matched.StringgetReplacement()replacement value against which a regex replace is performed if the regular expression matches.StringgetSeparator()separator placed between concatenated source label values.List<String>getSourceLabels()sourceLabels select values from existing labels.StringgetTargetLabel()targetLabel to which the resulting value is written in a 'Replace' action.voidsetAction(String action)action to perform based on regex matching.voidsetAdditionalProperties(Map<String,Object> additionalProperties)voidsetAdditionalProperty(String name, Object value)voidsetModulus(Long modulus)modulus to take of the hash of the source label values.voidsetRegex(String regex)regex against which the extracted value is matched.voidsetReplacement(String replacement)replacement value against which a regex replace is performed if the regular expression matches.voidsetSeparator(String separator)separator placed between concatenated source label values.voidsetSourceLabels(List<String> sourceLabels)sourceLabels select values from existing labels.voidsetTargetLabel(String targetLabel)targetLabel to which the resulting value is written in a 'Replace' action.RelabelConfigBuildertoBuilder()
-
-
-
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.
-
edit
public RelabelConfigBuilder edit()
- Specified by:
editin interfaceio.fabric8.kubernetes.api.builder.Editable<RelabelConfigBuilder>
-
toBuilder
public RelabelConfigBuilder toBuilder()
-
-