From 329a00e44f0846ee04e2bc146e167a9334d231b7 Mon Sep 17 00:00:00 2001 From: Matt Bostock Date: Tue, 7 Jun 2016 17:13:30 +0100 Subject: [PATCH] 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/ --- retrieval/relabel_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/retrieval/relabel_test.go b/retrieval/relabel_test.go index 633b83b4e..ad86c644d 100644 --- a/retrieval/relabel_test.go +++ b/retrieval/relabel_test.go @@ -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",