mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-14 17:44:06 -08:00
Allow labelmap action
This commit is contained in:
parent
90f594c9fb
commit
9bc4779be2
|
@ -687,7 +687,7 @@ func (a *RelabelAction) UnmarshalYAML(unmarshal func(interface{}) error) error {
|
|||
return err
|
||||
}
|
||||
switch act := RelabelAction(strings.ToLower(s)); act {
|
||||
case RelabelReplace, RelabelKeep, RelabelDrop, RelabelHashMod:
|
||||
case RelabelReplace, RelabelKeep, RelabelDrop, RelabelHashMod, RelabelLabelMap:
|
||||
*a = act
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -143,6 +143,11 @@ var expectedConf = &Config{
|
|||
Separator: ";",
|
||||
Action: RelabelKeep,
|
||||
},
|
||||
{
|
||||
Regex: MustNewRegexp("1"),
|
||||
Separator: ";",
|
||||
Action: RelabelLabelMap,
|
||||
},
|
||||
},
|
||||
MetricRelabelConfigs: []*RelabelConfig{
|
||||
{
|
||||
|
|
2
config/testdata/conf.good.yml
vendored
2
config/testdata/conf.good.yml
vendored
|
@ -80,6 +80,8 @@ scrape_configs:
|
|||
- source_labels: [__tmp_hash]
|
||||
regex: 1
|
||||
action: keep
|
||||
- action: labelmap
|
||||
regex: 1
|
||||
|
||||
metric_relabel_configs:
|
||||
- source_labels: [__name__]
|
||||
|
|
Loading…
Reference in a new issue