Merge pull request #1102 from mjibson/allow-labelmap
Allow labelmap action
This commit is contained in:
commit
ef176e5a9b
|
@ -687,7 +687,7 @@ func (a *RelabelAction) UnmarshalYAML(unmarshal func(interface{}) error) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
switch act := RelabelAction(strings.ToLower(s)); act {
|
switch act := RelabelAction(strings.ToLower(s)); act {
|
||||||
case RelabelReplace, RelabelKeep, RelabelDrop, RelabelHashMod:
|
case RelabelReplace, RelabelKeep, RelabelDrop, RelabelHashMod, RelabelLabelMap:
|
||||||
*a = act
|
*a = act
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -143,6 +143,11 @@ var expectedConf = &Config{
|
||||||
Separator: ";",
|
Separator: ";",
|
||||||
Action: RelabelKeep,
|
Action: RelabelKeep,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
Regex: MustNewRegexp("1"),
|
||||||
|
Separator: ";",
|
||||||
|
Action: RelabelLabelMap,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
MetricRelabelConfigs: []*RelabelConfig{
|
MetricRelabelConfigs: []*RelabelConfig{
|
||||||
{
|
{
|
||||||
|
|
|
@ -80,6 +80,8 @@ scrape_configs:
|
||||||
- source_labels: [__tmp_hash]
|
- source_labels: [__tmp_hash]
|
||||||
regex: 1
|
regex: 1
|
||||||
action: keep
|
action: keep
|
||||||
|
- action: labelmap
|
||||||
|
regex: 1
|
||||||
|
|
||||||
metric_relabel_configs:
|
metric_relabel_configs:
|
||||||
- source_labels: [__name__]
|
- source_labels: [__name__]
|
||||||
|
|
Loading…
Reference in New Issue