Relabel: Document whole label set is dropped

From the documentation and current tests, it wasn't immediately clear to
me whether the `target` being dropped as the result of a 'drop' action
was a label key-value pair or the entire labelset.

Add a test that documents this behaviour.

Documentation: https://prometheus.io/docs/operating/configuration/
This commit is contained in:
Matt Bostock 2016-06-07 17:13:30 +01:00
parent 8ec10ae7a5
commit 329a00e44f

View File

@ -102,6 +102,20 @@ func TestRelabel(t *testing.T) {
},
output: nil,
},
{
input: model.LabelSet{
"a": "foo",
"b": "bar",
},
relabel: []*config.RelabelConfig{
{
SourceLabels: model.LabelNames{"a"},
Regex: config.MustNewRegexp(".*o.*"),
Action: config.RelabelDrop,
},
},
output: nil,
},
{
input: model.LabelSet{
"a": "abc",