From 95c302723bab7957ea28875493b80e8866611cd5 Mon Sep 17 00:00:00 2001 From: darshanime Date: Fri, 25 Jun 2021 00:02:23 +0530 Subject: [PATCH] Ask querier for sorted series in /federate Signed-off-by: darshanime --- web/federate.go | 2 +- web/federate_test.go | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/web/federate.go b/web/federate.go index 7319b34e8..f97579ad4 100644 --- a/web/federate.go +++ b/web/federate.go @@ -95,7 +95,7 @@ func (h *Handler) federation(w http.ResponseWriter, req *http.Request) { var sets []storage.SeriesSet for _, mset := range matcherSets { - s := q.Select(false, hints, mset...) + s := q.Select(true, hints, mset...) sets = append(sets, s) } diff --git a/web/federate_test.go b/web/federate_test.go index b7f42b908..35a02bb44 100644 --- a/web/federate_test.go +++ b/web/federate_test.go @@ -113,6 +113,14 @@ test_metric1{foo="bar",instance="i"} 10000 6000000 test_metric1{foo="boo",instance="i"} 1 6000000 # TYPE test_metric2 untyped test_metric2{foo="boo",instance="i"} 1 6000000 +`, + }, + "two matchers with overlap": { + params: "match[]={__name__=~'test_metric1'}&match[]={foo='bar'}", + code: 200, + body: `# TYPE test_metric1 untyped +test_metric1{foo="bar",instance="i"} 10000 6000000 +test_metric1{foo="boo",instance="i"} 1 6000000 `, }, "everything": {