diff --git a/Makefile b/Makefile index 042d97a848..267bb658ea 100644 --- a/Makefile +++ b/Makefile @@ -324,7 +324,19 @@ GENERATE_FILES ?= true %.pb.go: %.proto ifeq ($(GENERATE_FILES),true) - protoc -I $(GOPATH)/src:./vendor/github.com/gogo/protobuf:./vendor:./$(@D):./pkg/storegateway/storepb --gogoslick_out=plugins=grpc,Mgoogle/protobuf/any.proto=github.com/gogo/protobuf/types,:./$(@D) ./$(patsubst %.pb.go,%.proto,$@) + if case "$@" in *_custom_types.pb.go) false ;; *) true ;; esac; then \ + protoc \ + -I $(GOPATH)/src \ + -I ./vendor/github.com/gogo/protobuf \ + -I ./vendor \ + -I ./$(@D) \ + -I ./pkg/storegateway/storepb \ + -I ./pkg/mimirpb \ + --gogoslick_out=plugins=grpc,Mgoogle/protobuf/any.proto=github.com/gogo/protobuf/types,:./$(@D) \ + ./$(patsubst %.pb.go,%.proto,$@); \ + else \ + echo "Skipping $@"; \ + fi else @echo "Warning: generating files has been disabled, but the following file needs to be regenerated: $@" @echo "If this is unexpected, check if the last modified timestamps on $@ and $(patsubst %.pb.go,%.proto,$@) are correct." diff --git a/pkg/blockbuilder/tsdb.go b/pkg/blockbuilder/tsdb.go index ee2d610fe7..759788bf14 100644 --- a/pkg/blockbuilder/tsdb.go +++ b/pkg/blockbuilder/tsdb.go @@ -26,6 +26,7 @@ import ( "golang.org/x/sync/errgroup" "github.com/grafana/mimir/pkg/mimirpb" + "github.com/grafana/mimir/pkg/mimirpb_custom" mimir_storage "github.com/grafana/mimir/pkg/storage" mimir_tsdb "github.com/grafana/mimir/pkg/storage/tsdb" util_log "github.com/grafana/mimir/pkg/util/log" @@ -48,11 +49,11 @@ type TSDBBuilder struct { // We use this only to identify the soft errors. var softErrProcessor = mimir_storage.NewSoftAppendErrorProcessor( - func() {}, func(int64, []mimirpb.LabelAdapter) {}, func(int64, []mimirpb.LabelAdapter) {}, - func(int64, []mimirpb.LabelAdapter) {}, func(int64, []mimirpb.LabelAdapter) {}, func(int64, []mimirpb.LabelAdapter) {}, - func() {}, func([]mimirpb.LabelAdapter) {}, func(error, int64, []mimirpb.LabelAdapter) {}, - func(error, int64, []mimirpb.LabelAdapter) {}, func(error, int64, []mimirpb.LabelAdapter) {}, func(error, int64, []mimirpb.LabelAdapter) {}, - func(error, int64, []mimirpb.LabelAdapter) {}, func(error, int64, []mimirpb.LabelAdapter) {}, + func() {}, func(int64, []mimirpb_custom.LabelAdapter) {}, func(int64, []mimirpb_custom.LabelAdapter) {}, + func(int64, []mimirpb_custom.LabelAdapter) {}, func(int64, []mimirpb_custom.LabelAdapter) {}, func(int64, []mimirpb_custom.LabelAdapter) {}, + func() {}, func([]mimirpb_custom.LabelAdapter) {}, func(error, int64, []mimirpb_custom.LabelAdapter) {}, + func(error, int64, []mimirpb_custom.LabelAdapter) {}, func(error, int64, []mimirpb_custom.LabelAdapter) {}, func(error, int64, []mimirpb_custom.LabelAdapter) {}, + func(error, int64, []mimirpb_custom.LabelAdapter) {}, func(error, int64, []mimirpb_custom.LabelAdapter) {}, ) type tsdbTenant struct { diff --git a/pkg/blockbuilder/tsdb_test.go b/pkg/blockbuilder/tsdb_test.go index 9b1ad07cfc..a81d1ee76b 100644 --- a/pkg/blockbuilder/tsdb_test.go +++ b/pkg/blockbuilder/tsdb_test.go @@ -27,6 +27,7 @@ import ( "github.com/twmb/franz-go/pkg/kgo" "github.com/grafana/mimir/pkg/mimirpb" + "github.com/grafana/mimir/pkg/mimirpb_custom" mimir_tsdb "github.com/grafana/mimir/pkg/storage/tsdb" "github.com/grafana/mimir/pkg/util/test" "github.com/grafana/mimir/pkg/util/validation" @@ -43,7 +44,7 @@ func createWriteRequest(t *testing.T, suffix string, samples []mimirpb.Sample, h } req.Timeseries = append(req.Timeseries, mimirpb.PreallocTimeseries{ TimeSeries: &mimirpb.TimeSeries{ - Labels: []mimirpb.LabelAdapter{ + Labels: []mimirpb_custom.LabelAdapter{ {Name: "foo", Value: fmt.Sprintf("%s%s", seriesValue, suffix)}, }, Samples: samples, @@ -358,7 +359,7 @@ func TestProcessingEmptyRequest(t *testing.T) { req := mimirpb.WriteRequest{} req.Timeseries = append(req.Timeseries, mimirpb.PreallocTimeseries{ TimeSeries: &mimirpb.TimeSeries{ - Labels: []mimirpb.LabelAdapter{{Name: "foo", Value: "bar"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "foo", Value: "bar"}}, Samples: []mimirpb.Sample{}, }, }) diff --git a/pkg/distributor/distributor.go b/pkg/distributor/distributor.go index 41bf16ddb4..02c90d1c94 100644 --- a/pkg/distributor/distributor.go +++ b/pkg/distributor/distributor.go @@ -50,6 +50,7 @@ import ( "github.com/grafana/mimir/pkg/cardinality" ingester_client "github.com/grafana/mimir/pkg/ingester/client" "github.com/grafana/mimir/pkg/mimirpb" + "github.com/grafana/mimir/pkg/mimirpb_custom" "github.com/grafana/mimir/pkg/querier/stats" "github.com/grafana/mimir/pkg/storage/ingest" "github.com/grafana/mimir/pkg/util" @@ -900,7 +901,7 @@ func (d *Distributor) validateSeries(nowt time.Time, ts *mimirpb.PreallocTimeser return false, nil } -func (d *Distributor) labelValuesWithNewlines(labels []mimirpb.LabelAdapter) int { +func (d *Distributor) labelValuesWithNewlines(labels []mimirpb_custom.LabelAdapter) int { count := 0 for _, l := range labels { if strings.IndexByte(l.Value, '\n') >= 0 { @@ -1807,7 +1808,7 @@ func getTokensForMetadata(userID string, metadata []*mimirpb.MetricMetadata) []u return metadataKeys } -func tokenForLabels(userID string, labels []mimirpb.LabelAdapter) uint32 { +func tokenForLabels(userID string, labels []mimirpb_custom.LabelAdapter) uint32 { return mimirpb.ShardByAllLabelAdapters(userID, labels) } diff --git a/pkg/distributor/distributor_test.go b/pkg/distributor/distributor_test.go index ff63b09baa..a86f0ce38d 100644 --- a/pkg/distributor/distributor_test.go +++ b/pkg/distributor/distributor_test.go @@ -57,6 +57,7 @@ import ( "github.com/grafana/mimir/pkg/ingester" "github.com/grafana/mimir/pkg/ingester/client" "github.com/grafana/mimir/pkg/mimirpb" + "github.com/grafana/mimir/pkg/mimirpb_custom" "github.com/grafana/mimir/pkg/querier/api" "github.com/grafana/mimir/pkg/querier/stats" "github.com/grafana/mimir/pkg/storage/chunk" @@ -1084,15 +1085,15 @@ func TestDistributor_PushQuery(t *testing.T) { } // Helper function to generate LabelAdapter slice from string pairs. -func labelAdapters(ss ...string) []mimirpb.LabelAdapter { +func labelAdapters(ss ...string) []mimirpb_custom.LabelAdapter { if len(ss)%2 != 0 { panic("invalid number of strings") } - res := make([]mimirpb.LabelAdapter, 0, len(ss)/2) + res := make([]mimirpb_custom.LabelAdapter, 0, len(ss)/2) for i := 0; i < len(ss); i += 2 { - res = append(res, mimirpb.LabelAdapter{Name: ss[i], Value: ss[i+1]}) + res = append(res, mimirpb_custom.LabelAdapter{Name: ss[i], Value: ss[i+1]}) } - slices.SortFunc(res, func(a, b mimirpb.LabelAdapter) int { return strings.Compare(a.Name, b.Name) }) + slices.SortFunc(res, func(a, b mimirpb_custom.LabelAdapter) int { return strings.Compare(a.Name, b.Name) }) return res } @@ -1100,8 +1101,8 @@ func TestDistributor_Push_LabelRemoval(t *testing.T) { ctx := user.InjectOrgID(context.Background(), "user") type testcase struct { - inputSeries []mimirpb.LabelAdapter - expectedSeries []mimirpb.LabelAdapter + inputSeries []mimirpb_custom.LabelAdapter + expectedSeries []mimirpb_custom.LabelAdapter removeReplica bool removeLabels []string } @@ -1181,8 +1182,8 @@ func TestDistributor_Push_LabelRemoval(t *testing.T) { func TestDistributor_Push_ShouldGuaranteeShardingTokenConsistencyOverTheTime(t *testing.T) { ctx := user.InjectOrgID(context.Background(), "user") tests := map[string]struct { - inputSeries []mimirpb.LabelAdapter - expectedSeries []mimirpb.LabelAdapter + inputSeries []mimirpb_custom.LabelAdapter + expectedSeries []mimirpb_custom.LabelAdapter expectedToken uint32 }{ "metric_1 with value_1": { @@ -1252,7 +1253,7 @@ func TestDistributor_Push_LabelNameValidation(t *testing.T) { ctx := user.InjectOrgID(context.Background(), "user") tests := map[string]struct { - inputLabels []mimirpb.LabelAdapter + inputLabels []mimirpb_custom.LabelAdapter skipLabelNameValidationCfg bool skipLabelNameValidationReq bool errExpected bool @@ -1770,7 +1771,7 @@ func TestDistributor_ExemplarValidation(t *testing.T) { ), expectedExemplars: []mimirpb.PreallocTimeseries{ {TimeSeries: &mimirpb.TimeSeries{ - Labels: []mimirpb.LabelAdapter{{Name: model.MetricNameLabel, Value: "test1"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: model.MetricNameLabel, Value: "test1"}}, Exemplars: []mimirpb.Exemplar{}, }}, }, @@ -1802,7 +1803,7 @@ func TestDistributor_ExemplarValidation(t *testing.T) { ), expectedExemplars: []mimirpb.PreallocTimeseries{ {TimeSeries: &mimirpb.TimeSeries{ - Labels: []mimirpb.LabelAdapter{{Name: model.MetricNameLabel, Value: "test"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: model.MetricNameLabel, Value: "test"}}, Exemplars: []mimirpb.Exemplar{}, }}, makeExemplarTimeseries([]string{model.MetricNameLabel, "test"}, 601000, 0, []string{"foo", "bar"}), @@ -1821,19 +1822,19 @@ func TestDistributor_ExemplarValidation(t *testing.T) { maxExemplarTS: math.MaxInt64, req: makeWriteRequestWith(mimirpb.PreallocTimeseries{ TimeSeries: &mimirpb.TimeSeries{ - Labels: []mimirpb.LabelAdapter{{Name: model.MetricNameLabel, Value: "test"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: model.MetricNameLabel, Value: "test"}}, Exemplars: []mimirpb.Exemplar{ - {Labels: []mimirpb.LabelAdapter{{Name: "foo", Value: "bar1"}}, TimestampMs: 1000}, - {Labels: []mimirpb.LabelAdapter{{Name: "foo", Value: "bar2"}}, TimestampMs: 601000}, + {Labels: []mimirpb_custom.LabelAdapter{{Name: "foo", Value: "bar1"}}, TimestampMs: 1000}, + {Labels: []mimirpb_custom.LabelAdapter{{Name: "foo", Value: "bar2"}}, TimestampMs: 601000}, }, }, }), expectedExemplars: []mimirpb.PreallocTimeseries{ { TimeSeries: &mimirpb.TimeSeries{ - Labels: []mimirpb.LabelAdapter{{Name: model.MetricNameLabel, Value: "test"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: model.MetricNameLabel, Value: "test"}}, Exemplars: []mimirpb.Exemplar{ - {Labels: []mimirpb.LabelAdapter{{Name: "foo", Value: "bar2"}}, TimestampMs: 601000}, + {Labels: []mimirpb_custom.LabelAdapter{{Name: "foo", Value: "bar2"}}, TimestampMs: 601000}, }, }, }, @@ -1852,19 +1853,19 @@ func TestDistributor_ExemplarValidation(t *testing.T) { maxExemplarTS: math.MaxInt64, req: makeWriteRequestWith(mimirpb.PreallocTimeseries{ TimeSeries: &mimirpb.TimeSeries{ - Labels: []mimirpb.LabelAdapter{{Name: model.MetricNameLabel, Value: "test"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: model.MetricNameLabel, Value: "test"}}, Exemplars: []mimirpb.Exemplar{ - {Labels: []mimirpb.LabelAdapter{{Name: "foo", Value: "bar1"}}, TimestampMs: 1000}, - {Labels: []mimirpb.LabelAdapter{{Name: "foo", Value: "bar2"}}, TimestampMs: 601000}, + {Labels: []mimirpb_custom.LabelAdapter{{Name: "foo", Value: "bar1"}}, TimestampMs: 1000}, + {Labels: []mimirpb_custom.LabelAdapter{{Name: "foo", Value: "bar2"}}, TimestampMs: 601000}, }, }, }), expectedExemplars: []mimirpb.PreallocTimeseries{ { TimeSeries: &mimirpb.TimeSeries{ - Labels: []mimirpb.LabelAdapter{{Name: model.MetricNameLabel, Value: "test"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: model.MetricNameLabel, Value: "test"}}, Exemplars: []mimirpb.Exemplar{ - {Labels: []mimirpb.LabelAdapter{{Name: "foo", Value: "bar2"}}, TimestampMs: 601000}, + {Labels: []mimirpb_custom.LabelAdapter{{Name: "foo", Value: "bar2"}}, TimestampMs: 601000}, }, }, }, @@ -1883,19 +1884,19 @@ func TestDistributor_ExemplarValidation(t *testing.T) { maxExemplarTS: 100000, req: makeWriteRequestWith(mimirpb.PreallocTimeseries{ TimeSeries: &mimirpb.TimeSeries{ - Labels: []mimirpb.LabelAdapter{{Name: model.MetricNameLabel, Value: "test"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: model.MetricNameLabel, Value: "test"}}, Exemplars: []mimirpb.Exemplar{ - {Labels: []mimirpb.LabelAdapter{{Name: "foo", Value: "bar1"}}, TimestampMs: 1000}, - {Labels: []mimirpb.LabelAdapter{{Name: "foo", Value: "bar2"}}, TimestampMs: 601000}, + {Labels: []mimirpb_custom.LabelAdapter{{Name: "foo", Value: "bar1"}}, TimestampMs: 1000}, + {Labels: []mimirpb_custom.LabelAdapter{{Name: "foo", Value: "bar2"}}, TimestampMs: 601000}, }, }, }), expectedExemplars: []mimirpb.PreallocTimeseries{ { TimeSeries: &mimirpb.TimeSeries{ - Labels: []mimirpb.LabelAdapter{{Name: model.MetricNameLabel, Value: "test"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: model.MetricNameLabel, Value: "test"}}, Exemplars: []mimirpb.Exemplar{ - {Labels: []mimirpb.LabelAdapter{{Name: "foo", Value: "bar1"}}, TimestampMs: 1000}, + {Labels: []mimirpb_custom.LabelAdapter{{Name: "foo", Value: "bar1"}}, TimestampMs: 1000}, }, }, }, @@ -1915,21 +1916,21 @@ func TestDistributor_ExemplarValidation(t *testing.T) { maxExemplarTS: math.MaxInt64, req: makeWriteRequestWith(mimirpb.PreallocTimeseries{ TimeSeries: &mimirpb.TimeSeries{ - Labels: []mimirpb.LabelAdapter{{Name: model.MetricNameLabel, Value: "test"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: model.MetricNameLabel, Value: "test"}}, Exemplars: []mimirpb.Exemplar{ - {Labels: []mimirpb.LabelAdapter{{Name: "foo", Value: "bar1"}}, TimestampMs: 600000}, - {Labels: []mimirpb.LabelAdapter{{Name: "foo", Value: "bar2"}}, TimestampMs: 601000}, - {Labels: []mimirpb.LabelAdapter{{Name: "foo", Value: "bar3"}}, TimestampMs: 602000}, + {Labels: []mimirpb_custom.LabelAdapter{{Name: "foo", Value: "bar1"}}, TimestampMs: 600000}, + {Labels: []mimirpb_custom.LabelAdapter{{Name: "foo", Value: "bar2"}}, TimestampMs: 601000}, + {Labels: []mimirpb_custom.LabelAdapter{{Name: "foo", Value: "bar3"}}, TimestampMs: 602000}, }, }, }), expectedExemplars: []mimirpb.PreallocTimeseries{ { TimeSeries: &mimirpb.TimeSeries{ - Labels: []mimirpb.LabelAdapter{{Name: model.MetricNameLabel, Value: "test"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: model.MetricNameLabel, Value: "test"}}, Exemplars: []mimirpb.Exemplar{ - {Labels: []mimirpb.LabelAdapter{{Name: "foo", Value: "bar1"}}, TimestampMs: 600000}, - {Labels: []mimirpb.LabelAdapter{{Name: "foo", Value: "bar2"}}, TimestampMs: 601000}, + {Labels: []mimirpb_custom.LabelAdapter{{Name: "foo", Value: "bar1"}}, TimestampMs: 600000}, + {Labels: []mimirpb_custom.LabelAdapter{{Name: "foo", Value: "bar2"}}, TimestampMs: 601000}, }, }, }, @@ -1948,20 +1949,20 @@ func TestDistributor_ExemplarValidation(t *testing.T) { maxExemplarTS: math.MaxInt64, req: makeWriteRequestWith(mimirpb.PreallocTimeseries{ TimeSeries: &mimirpb.TimeSeries{ - Labels: []mimirpb.LabelAdapter{{Name: model.MetricNameLabel, Value: "test"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: model.MetricNameLabel, Value: "test"}}, Exemplars: []mimirpb.Exemplar{ - {Labels: []mimirpb.LabelAdapter{{Name: "foo", Value: "bar1"}}, TimestampMs: 602000}, - {Labels: []mimirpb.LabelAdapter{{Name: "foo", Value: "bar2"}}, TimestampMs: 601000}, + {Labels: []mimirpb_custom.LabelAdapter{{Name: "foo", Value: "bar1"}}, TimestampMs: 602000}, + {Labels: []mimirpb_custom.LabelAdapter{{Name: "foo", Value: "bar2"}}, TimestampMs: 601000}, }, }, }), expectedExemplars: []mimirpb.PreallocTimeseries{ { TimeSeries: &mimirpb.TimeSeries{ - Labels: []mimirpb.LabelAdapter{{Name: model.MetricNameLabel, Value: "test"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: model.MetricNameLabel, Value: "test"}}, Exemplars: []mimirpb.Exemplar{ - {Labels: []mimirpb.LabelAdapter{{Name: "foo", Value: "bar2"}}, TimestampMs: 601000}, - {Labels: []mimirpb.LabelAdapter{{Name: "foo", Value: "bar1"}}, TimestampMs: 602000}, + {Labels: []mimirpb_custom.LabelAdapter{{Name: "foo", Value: "bar2"}}, TimestampMs: 601000}, + {Labels: []mimirpb_custom.LabelAdapter{{Name: "foo", Value: "bar1"}}, TimestampMs: 602000}, }, }, }, @@ -2107,16 +2108,16 @@ func TestDistributor_HistogramReduction(t *testing.T) { } } -func mkLabels(n int, extra ...string) []mimirpb.LabelAdapter { - ret := make([]mimirpb.LabelAdapter, 1+n+len(extra)/2) - ret[0] = mimirpb.LabelAdapter{Name: model.MetricNameLabel, Value: "foo"} +func mkLabels(n int, extra ...string) []mimirpb_custom.LabelAdapter { + ret := make([]mimirpb_custom.LabelAdapter, 1+n+len(extra)/2) + ret[0] = mimirpb_custom.LabelAdapter{Name: model.MetricNameLabel, Value: "foo"} for i := 0; i < n; i++ { - ret[i+1] = mimirpb.LabelAdapter{Name: fmt.Sprintf("name_%d", i), Value: fmt.Sprintf("value_%d", i)} + ret[i+1] = mimirpb_custom.LabelAdapter{Name: fmt.Sprintf("name_%d", i), Value: fmt.Sprintf("value_%d", i)} } for i := 0; i < len(extra); i += 2 { - ret[i+n+1] = mimirpb.LabelAdapter{Name: extra[i], Value: extra[i+1]} + ret[i+n+1] = mimirpb_custom.LabelAdapter{Name: extra[i], Value: extra[i+1]} } - slices.SortFunc(ret, func(a, b mimirpb.LabelAdapter) int { + slices.SortFunc(ret, func(a, b mimirpb_custom.LabelAdapter) int { switch { case a.Name < b.Name: return -1 @@ -2137,13 +2138,13 @@ func BenchmarkDistributor_Push(b *testing.B) { tests := map[string]struct { prepareConfig func(limits *validation.Limits) - prepareSeries func() ([][]mimirpb.LabelAdapter, []mimirpb.Sample) + prepareSeries func() ([][]mimirpb_custom.LabelAdapter, []mimirpb.Sample) expectedErr string }{ "all samples successfully pushed": { prepareConfig: func(*validation.Limits) {}, - prepareSeries: func() ([][]mimirpb.LabelAdapter, []mimirpb.Sample) { - metrics := make([][]mimirpb.LabelAdapter, numSeriesPerRequest) + prepareSeries: func() ([][]mimirpb_custom.LabelAdapter, []mimirpb.Sample) { + metrics := make([][]mimirpb_custom.LabelAdapter, numSeriesPerRequest) samples := make([]mimirpb.Sample, numSeriesPerRequest) for i := 0; i < numSeriesPerRequest; i++ { @@ -2163,8 +2164,8 @@ func BenchmarkDistributor_Push(b *testing.B) { limits.IngestionRate = 1 limits.IngestionBurstSize = 1 }, - prepareSeries: func() ([][]mimirpb.LabelAdapter, []mimirpb.Sample) { - metrics := make([][]mimirpb.LabelAdapter, numSeriesPerRequest) + prepareSeries: func() ([][]mimirpb_custom.LabelAdapter, []mimirpb.Sample) { + metrics := make([][]mimirpb_custom.LabelAdapter, numSeriesPerRequest) samples := make([]mimirpb.Sample, numSeriesPerRequest) for i := 0; i < numSeriesPerRequest; i++ { @@ -2183,8 +2184,8 @@ func BenchmarkDistributor_Push(b *testing.B) { prepareConfig: func(limits *validation.Limits) { limits.MaxLabelNamesPerSeries = 30 }, - prepareSeries: func() ([][]mimirpb.LabelAdapter, []mimirpb.Sample) { - metrics := make([][]mimirpb.LabelAdapter, numSeriesPerRequest) + prepareSeries: func() ([][]mimirpb_custom.LabelAdapter, []mimirpb.Sample) { + metrics := make([][]mimirpb_custom.LabelAdapter, numSeriesPerRequest) samples := make([]mimirpb.Sample, numSeriesPerRequest) for i := 0; i < numSeriesPerRequest; i++ { @@ -2203,8 +2204,8 @@ func BenchmarkDistributor_Push(b *testing.B) { prepareConfig: func(limits *validation.Limits) { limits.MaxLabelNameLength = 200 }, - prepareSeries: func() ([][]mimirpb.LabelAdapter, []mimirpb.Sample) { - metrics := make([][]mimirpb.LabelAdapter, numSeriesPerRequest) + prepareSeries: func() ([][]mimirpb_custom.LabelAdapter, []mimirpb.Sample) { + metrics := make([][]mimirpb_custom.LabelAdapter, numSeriesPerRequest) samples := make([]mimirpb.Sample, numSeriesPerRequest) for i := 0; i < numSeriesPerRequest; i++ { @@ -2224,8 +2225,8 @@ func BenchmarkDistributor_Push(b *testing.B) { prepareConfig: func(limits *validation.Limits) { limits.MaxLabelValueLength = 200 }, - prepareSeries: func() ([][]mimirpb.LabelAdapter, []mimirpb.Sample) { - metrics := make([][]mimirpb.LabelAdapter, numSeriesPerRequest) + prepareSeries: func() ([][]mimirpb_custom.LabelAdapter, []mimirpb.Sample) { + metrics := make([][]mimirpb_custom.LabelAdapter, numSeriesPerRequest) samples := make([]mimirpb.Sample, numSeriesPerRequest) for i := 0; i < numSeriesPerRequest; i++ { @@ -2245,8 +2246,8 @@ func BenchmarkDistributor_Push(b *testing.B) { prepareConfig: func(limits *validation.Limits) { limits.CreationGracePeriod = model.Duration(time.Minute) }, - prepareSeries: func() ([][]mimirpb.LabelAdapter, []mimirpb.Sample) { - metrics := make([][]mimirpb.LabelAdapter, numSeriesPerRequest) + prepareSeries: func() ([][]mimirpb_custom.LabelAdapter, []mimirpb.Sample) { + metrics := make([][]mimirpb_custom.LabelAdapter, numSeriesPerRequest) samples := make([]mimirpb.Sample, numSeriesPerRequest) for i := 0; i < numSeriesPerRequest; i++ { @@ -2273,8 +2274,8 @@ func BenchmarkDistributor_Push(b *testing.B) { }, } }, - prepareSeries: func() ([][]mimirpb.LabelAdapter, []mimirpb.Sample) { - metrics := make([][]mimirpb.LabelAdapter, numSeriesPerRequest) + prepareSeries: func() ([][]mimirpb_custom.LabelAdapter, []mimirpb.Sample) { + metrics := make([][]mimirpb_custom.LabelAdapter, numSeriesPerRequest) samples := make([]mimirpb.Sample, numSeriesPerRequest) for i := 0; i < numSeriesPerRequest; i++ { @@ -2397,7 +2398,7 @@ func TestDistributor_MetricsForLabelMatchers(t *testing.T) { const numIngesters = 5 fixtures := []struct { - lbls []mimirpb.LabelAdapter + lbls []mimirpb_custom.LabelAdapter value float64 timestamp int64 }{ @@ -2413,7 +2414,7 @@ func TestDistributor_MetricsForLabelMatchers(t *testing.T) { shuffleShardSize int matchers []*labels.Matcher maxSeriesPerQuery int - expectedResult [][]mimirpb.LabelAdapter + expectedResult [][]mimirpb_custom.LabelAdapter expectedIngesters int expectedError error }{ @@ -2428,7 +2429,7 @@ func TestDistributor_MetricsForLabelMatchers(t *testing.T) { matchers: []*labels.Matcher{ mustNewMatcher(labels.MatchEqual, model.MetricNameLabel, "test_1"), }, - expectedResult: [][]mimirpb.LabelAdapter{ + expectedResult: [][]mimirpb_custom.LabelAdapter{ fixtures[0].lbls, fixtures[1].lbls, }, @@ -2439,7 +2440,7 @@ func TestDistributor_MetricsForLabelMatchers(t *testing.T) { mustNewMatcher(labels.MatchEqual, "status", "200"), mustNewMatcher(labels.MatchEqual, model.MetricNameLabel, "test_1"), }, - expectedResult: [][]mimirpb.LabelAdapter{ + expectedResult: [][]mimirpb_custom.LabelAdapter{ fixtures[0].lbls, }, expectedIngesters: numIngesters, @@ -2448,7 +2449,7 @@ func TestDistributor_MetricsForLabelMatchers(t *testing.T) { matchers: []*labels.Matcher{ mustNewMatcher(labels.MatchEqual, model.MetricNameLabel, "fast_fingerprint_collision"), }, - expectedResult: [][]mimirpb.LabelAdapter{ + expectedResult: [][]mimirpb_custom.LabelAdapter{ fixtures[3].lbls, fixtures[4].lbls, }, @@ -2459,7 +2460,7 @@ func TestDistributor_MetricsForLabelMatchers(t *testing.T) { matchers: []*labels.Matcher{ mustNewMatcher(labels.MatchEqual, model.MetricNameLabel, "test_1"), }, - expectedResult: [][]mimirpb.LabelAdapter{ + expectedResult: [][]mimirpb_custom.LabelAdapter{ fixtures[0].lbls, fixtures[1].lbls, }, @@ -2549,7 +2550,7 @@ func TestDistributor_ActiveSeries(t *testing.T) { collision1, collision2 := labelsWithHashCollision() pushedData := []struct { - lbls []mimirpb.LabelAdapter + lbls []mimirpb_custom.LabelAdapter value float64 timestamp int64 }{ @@ -2565,7 +2566,7 @@ func TestDistributor_ActiveSeries(t *testing.T) { shuffleShardSize int requestMatchers []*labels.Matcher expectError error - expectedSeries [][]mimirpb.LabelAdapter + expectedSeries [][]mimirpb_custom.LabelAdapter expectedNumQueriedIngesters int }{ "should return an empty response if no metric match": { @@ -2575,18 +2576,18 @@ func TestDistributor_ActiveSeries(t *testing.T) { }, "should return all matching metrics": { requestMatchers: []*labels.Matcher{labels.MustNewMatcher(labels.MatchEqual, model.MetricNameLabel, "test_1")}, - expectedSeries: [][]mimirpb.LabelAdapter{pushedData[0].lbls, pushedData[1].lbls}, + expectedSeries: [][]mimirpb_custom.LabelAdapter{pushedData[0].lbls, pushedData[1].lbls}, expectedNumQueriedIngesters: numIngesters, }, "should honour shuffle shard size": { shuffleShardSize: 3, requestMatchers: []*labels.Matcher{labels.MustNewMatcher(labels.MatchEqual, model.MetricNameLabel, "test_2")}, - expectedSeries: [][]mimirpb.LabelAdapter{pushedData[2].lbls}, + expectedSeries: [][]mimirpb_custom.LabelAdapter{pushedData[2].lbls}, expectedNumQueriedIngesters: 3, }, "should return all matching series even if their hash collides": { requestMatchers: []*labels.Matcher{labels.MustNewMatcher(labels.MatchEqual, model.MetricNameLabel, "metric")}, - expectedSeries: [][]mimirpb.LabelAdapter{collision1, collision2}, + expectedSeries: [][]mimirpb_custom.LabelAdapter{collision1, collision2}, expectedNumQueriedIngesters: numIngesters, }, "aborts if response is too large": { @@ -2692,12 +2693,12 @@ func TestDistributor_ActiveSeries(t *testing.T) { } // Check that all the LabelAdaptors match all the Labels. Assume LabelAdaptors are already sorted. -func requireLabelAdaptersMatchLabels(tb testing.TB, a [][]mimirpb.LabelAdapter, b []labels.Labels) { +func requireLabelAdaptersMatchLabels(tb testing.TB, a [][]mimirpb_custom.LabelAdapter, b []labels.Labels) { tb.Helper() if len(a) == 0 && len(b) == 0 { return } - bAsLabelAdapters := make([][]mimirpb.LabelAdapter, len(b)) + bAsLabelAdapters := make([][]mimirpb_custom.LabelAdapter, len(b)) for i, s := range b { bAsLabelAdapters[i] = mimirpb.FromLabelsToLabelAdapters(s) } @@ -2713,7 +2714,7 @@ func TestDistributor_ActiveNativeHistogramSeries(t *testing.T) { collision1, collision2 := labelsWithHashCollision() pushedData := []struct { - lbls []mimirpb.LabelAdapter + lbls []mimirpb_custom.LabelAdapter value float64 timestamp int64 }{ @@ -3245,12 +3246,12 @@ func BenchmarkDistributor_ActiveSeries(b *testing.B) { ctx := user.InjectOrgID(context.Background(), "user") // Push test data. - metrics := make([][]mimirpb.LabelAdapter, numSeries) + metrics := make([][]mimirpb_custom.LabelAdapter, numSeries) samples := make([]mimirpb.Sample, numSeries) for i := 0; i < numSeries; i++ { metrics[i] = mkLabels(10) - metrics[i] = append(metrics[i], mimirpb.LabelAdapter{Name: "series_no", Value: fmt.Sprintf("series_%d", i)}) + metrics[i] = append(metrics[i], mimirpb_custom.LabelAdapter{Name: "series_no", Value: fmt.Sprintf("series_%d", i)}) samples[i] = mimirpb.Sample{TimestampMs: time.Now().UnixNano() / int64(time.Millisecond), Value: 1} } @@ -3277,7 +3278,7 @@ func TestDistributor_LabelNames(t *testing.T) { const numIngesters = 5 fixtures := []struct { - lbls []mimirpb.LabelAdapter + lbls []mimirpb_custom.LabelAdapter value float64 timestamp int64 }{ @@ -3473,7 +3474,7 @@ func TestDistributor_MetricsMetadata(t *testing.T) { func TestDistributor_LabelNamesAndValuesLimitTest(t *testing.T) { // distinct values are "__name__", "label_00", "label_01" that is 24 bytes in total fixtures := []struct { - lbls []mimirpb.LabelAdapter + lbls []mimirpb_custom.LabelAdapter value float64 timestamp int64 }{ @@ -3538,7 +3539,7 @@ func TestDistributor_LabelNamesAndValuesLimitTest(t *testing.T) { func TestDistributor_LabelValuesForLabelName(t *testing.T) { fixtures := []struct { - lbls []mimirpb.LabelAdapter + lbls []mimirpb_custom.LabelAdapter value float64 timestamp int64 }{ @@ -3608,7 +3609,7 @@ func TestDistributor_LabelValuesForLabelName(t *testing.T) { func TestDistributor_LabelNamesAndValues(t *testing.T) { fixtures := []struct { - lbls []mimirpb.LabelAdapter + lbls []mimirpb_custom.LabelAdapter value float64 timestamp int64 }{ @@ -3729,7 +3730,7 @@ func TestDistributor_LabelNamesAndValues_ExpectedAllPossibleLabelNamesAndValuesT } // adapted from pkg/ingester/activeseries/active_series_test.go -func labelsWithHashCollision() ([]mimirpb.LabelAdapter, []mimirpb.LabelAdapter) { +func labelsWithHashCollision() ([]mimirpb_custom.LabelAdapter, []mimirpb_custom.LabelAdapter) { // These two series have the same XXHash; thanks to https://github.com/pstibrany/labels_hash_collisions ls1 := labelAdapters("__name__", "metric", "lbl1", "value", "lbl2", "l6CQ5y") ls2 := labelAdapters("__name__", "metric", "lbl1", "value", "lbl2", "v7uDlF") @@ -4178,7 +4179,7 @@ func TestDistributor_LabelValuesCardinality(t *testing.T) { const replicationFactor = 3 fixtures := []struct { - labels []mimirpb.LabelAdapter + labels []mimirpb_custom.LabelAdapter value float64 timestamp int64 }{ @@ -4600,7 +4601,7 @@ func TestDistributor_LabelValuesCardinality_AvailabilityAndConsistency(t *testin func TestDistributor_LabelValuesCardinality_Limit(t *testing.T) { fixtures := []struct { - labels []mimirpb.LabelAdapter + labels []mimirpb_custom.LabelAdapter value float64 timestamp int64 }{ @@ -5163,7 +5164,7 @@ func mustNewMatcher(t labels.MatchType, n, v string) *labels.Matcher { return m } -func mockWriteRequest(la []mimirpb.LabelAdapter, value float64, timestampMs int64) *mimirpb.WriteRequest { +func mockWriteRequest(la []mimirpb_custom.LabelAdapter, value float64, timestampMs int64) *mimirpb.WriteRequest { samples := []mimirpb.Sample{ { TimestampMs: timestampMs, @@ -5171,14 +5172,14 @@ func mockWriteRequest(la []mimirpb.LabelAdapter, value float64, timestampMs int6 }, } - return mimirpb.ToWriteRequest([][]mimirpb.LabelAdapter{la}, samples, nil, nil, mimirpb.API) + return mimirpb.ToWriteRequest([][]mimirpb_custom.LabelAdapter{la}, samples, nil, nil, mimirpb.API) } -func mockWriteHistogramRequest(lbls []mimirpb.LabelAdapter, value float64, timestampMs int64) *mimirpb.WriteRequest { +func mockWriteHistogramRequest(lbls []mimirpb_custom.LabelAdapter, value float64, timestampMs int64) *mimirpb.WriteRequest { histograms := []mimirpb.Histogram{mimirpb.FromHistogramToHistogramProto(timestampMs, util_test.GenerateTestHistogram(int(value)))} req := mimirpb.NewWriteRequest(nil, mimirpb.API) - return req.AddHistogramSeries([][]mimirpb.LabelAdapter{lbls}, histograms, nil) + return req.AddHistogramSeries([][]mimirpb_custom.LabelAdapter{lbls}, histograms, nil) } type ingesterState int @@ -5768,9 +5769,9 @@ func makeFloatHistograms(ts int64, histogram *histogram.FloatHistogram) []mimirp // labelSetGenWithReplicaAndCluster returns generator for a label set with the given replica and cluster, // it can be used with the helper makeWriteRequestForLabelSetGen(). -func labelSetGenWithReplicaAndCluster(replica, cluster string) func(int) []mimirpb.LabelAdapter { - return func(id int) []mimirpb.LabelAdapter { - return []mimirpb.LabelAdapter{ +func labelSetGenWithReplicaAndCluster(replica, cluster string) func(int) []mimirpb_custom.LabelAdapter { + return func(id int) []mimirpb_custom.LabelAdapter { + return []mimirpb_custom.LabelAdapter{ {Name: "__name__", Value: "foo"}, {Name: "__replica__", Value: replica}, {Name: "bar", Value: "baz"}, @@ -5782,9 +5783,9 @@ func labelSetGenWithReplicaAndCluster(replica, cluster string) func(int) []mimir // labelSetGenWithCluster returns generator for a label set with given cluster but no replica, // it can be used with the helper makeWriteRequestForLabelSetGen(). -func labelSetGenWithCluster(cluster string) func(int) []mimirpb.LabelAdapter { - return func(id int) []mimirpb.LabelAdapter { - return []mimirpb.LabelAdapter{ +func labelSetGenWithCluster(cluster string) func(int) []mimirpb_custom.LabelAdapter { + return func(id int) []mimirpb_custom.LabelAdapter { + return []mimirpb_custom.LabelAdapter{ {Name: "__name__", Value: "foo"}, {Name: "bar", Value: "baz"}, {Name: "cluster", Value: cluster}, @@ -5795,15 +5796,15 @@ func labelSetGenWithCluster(cluster string) func(int) []mimirpb.LabelAdapter { // labelSetGenForStringPairs takes a slice of strings which are interpreted as pairs of label names and values, // it then returns a label set generator which generates labelsets of the given label names and values. -func labelSetGenForStringPairs(tb testing.TB, namesValues ...string) func(id int) []mimirpb.LabelAdapter { - return func(id int) []mimirpb.LabelAdapter { +func labelSetGenForStringPairs(tb testing.TB, namesValues ...string) func(id int) []mimirpb_custom.LabelAdapter { + return func(id int) []mimirpb_custom.LabelAdapter { if len(namesValues)%2 != 0 { tb.Fatalf("number of names and values must be even: %q", namesValues) } - labels := make([]mimirpb.LabelAdapter, 0, len(namesValues)/2) + labels := make([]mimirpb_custom.LabelAdapter, 0, len(namesValues)/2) for idx := 0; idx < len(namesValues)/2; idx++ { - labels = append(labels, mimirpb.LabelAdapter{ + labels = append(labels, mimirpb_custom.LabelAdapter{ Name: namesValues[2*idx], Value: namesValues[2*idx+1] + strconv.Itoa(id), }) @@ -5815,21 +5816,21 @@ func labelSetGenForStringPairs(tb testing.TB, namesValues ...string) func(id int // labelSetGenWithEmptyLabels takes a slice of label names, it then returns a label set generator which generates // labelsets of the given label names with empty values, plus a metric name and unique id label which are non-empty. -func labelSetGenWithEmptyLabels(metric string, names ...string) func(id int) []mimirpb.LabelAdapter { - return func(id int) []mimirpb.LabelAdapter { - labels := make([]mimirpb.LabelAdapter, 0, len(names)+2) - labels = append(labels, mimirpb.LabelAdapter{ +func labelSetGenWithEmptyLabels(metric string, names ...string) func(id int) []mimirpb_custom.LabelAdapter { + return func(id int) []mimirpb_custom.LabelAdapter { + labels := make([]mimirpb_custom.LabelAdapter, 0, len(names)+2) + labels = append(labels, mimirpb_custom.LabelAdapter{ Name: model.MetricNameLabel, Value: metric, }) - labels = append(labels, mimirpb.LabelAdapter{ + labels = append(labels, mimirpb_custom.LabelAdapter{ Name: "id", Value: fmt.Sprintf("%d", id), }) for _, name := range names { - labels = append(labels, mimirpb.LabelAdapter{ + labels = append(labels, mimirpb_custom.LabelAdapter{ Name: name, Value: "", }) @@ -5838,7 +5839,7 @@ func labelSetGenWithEmptyLabels(metric string, names ...string) func(id int) []m } } -type labelSetGen func(int) []mimirpb.LabelAdapter +type labelSetGen func(int) []mimirpb_custom.LabelAdapter type metaDataGen func(int, string) *mimirpb.MetricMetadata // makeWriteRequestForGenerators generates a write request based on the given generator functions. @@ -6861,7 +6862,7 @@ func (i *mockIngester) UserStats(ctx context.Context, _ *client.UserStatsRequest }, nil } -func match(labels []mimirpb.LabelAdapter, matchers []*labels.Matcher) bool { +func match(labels []mimirpb_custom.LabelAdapter, matchers []*labels.Matcher) bool { outer: for _, matcher := range matchers { for _, labels := range labels { @@ -6882,7 +6883,7 @@ func TestDistributorValidation(t *testing.T) { for name, tc := range map[string]struct { metadata []*mimirpb.MetricMetadata - labels [][]mimirpb.LabelAdapter + labels [][]mimirpb_custom.LabelAdapter samples []mimirpb.Sample exemplars []*mimirpb.Exemplar limits func(limits *validation.Limits) @@ -6890,20 +6891,20 @@ func TestDistributorValidation(t *testing.T) { }{ "validation passes": { metadata: []*mimirpb.MetricMetadata{{MetricFamilyName: "testmetric", Help: "a test metric.", Unit: "", Type: mimirpb.COUNTER}}, - labels: [][]mimirpb.LabelAdapter{{{Name: labels.MetricName, Value: "testmetric"}, {Name: "foo", Value: "bar"}}}, + labels: [][]mimirpb_custom.LabelAdapter{{{Name: labels.MetricName, Value: "testmetric"}, {Name: "foo", Value: "bar"}}}, samples: []mimirpb.Sample{{ TimestampMs: int64(now), Value: 1, }}, exemplars: []*mimirpb.Exemplar{{ - Labels: []mimirpb.LabelAdapter{{Name: "traceID", Value: "123abc"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "traceID", Value: "123abc"}}, TimestampMs: int64(now), Value: 1, }}, }, "validation passes when labels are unsorted": { - labels: [][]mimirpb.LabelAdapter{ + labels: [][]mimirpb_custom.LabelAdapter{ { {Name: "foo", Value: "bar"}, {Name: labels.MetricName, Value: "testmetric"}, @@ -6915,7 +6916,7 @@ func TestDistributorValidation(t *testing.T) { }, "validation fails for samples from the future": { - labels: [][]mimirpb.LabelAdapter{{{Name: labels.MetricName, Value: "testmetric"}, {Name: "foo", Value: "bar"}}}, + labels: [][]mimirpb_custom.LabelAdapter{{{Name: labels.MetricName, Value: "testmetric"}, {Name: "foo", Value: "bar"}}}, samples: []mimirpb.Sample{{ TimestampMs: int64(future), Value: 4, @@ -6924,19 +6925,19 @@ func TestDistributorValidation(t *testing.T) { }, "validation does not fail for samples from the past without past_grace_period setting": { - labels: [][]mimirpb.LabelAdapter{{{Name: "foo", Value: "bar"}, {Name: labels.MetricName, Value: "testmetric"}}}, + labels: [][]mimirpb_custom.LabelAdapter{{{Name: "foo", Value: "bar"}, {Name: labels.MetricName, Value: "testmetric"}}}, samples: []mimirpb.Sample{{TimestampMs: int64(past), Value: 1}}, }, "validation fails for samples from the past": { - labels: [][]mimirpb.LabelAdapter{{{Name: labels.MetricName, Value: "testmetric"}, {Name: "foo", Value: "bar"}}}, + labels: [][]mimirpb_custom.LabelAdapter{{{Name: labels.MetricName, Value: "testmetric"}, {Name: "foo", Value: "bar"}}}, samples: []mimirpb.Sample{{TimestampMs: int64(past), Value: 4}}, limits: func(limits *validation.Limits) { limits.PastGracePeriod = model.Duration(now.Sub(past) / 2) }, expectedErr: status.New(codes.InvalidArgument, fmt.Sprintf(sampleTimestampTooOldMsgFormat, past, "testmetric")), }, "exceeds maximum labels per series": { - labels: [][]mimirpb.LabelAdapter{{{Name: labels.MetricName, Value: "testmetric"}, {Name: "foo", Value: "bar"}, {Name: "foo2", Value: "bar2"}}}, + labels: [][]mimirpb_custom.LabelAdapter{{{Name: labels.MetricName, Value: "testmetric"}, {Name: "foo", Value: "bar"}, {Name: "foo2", Value: "bar2"}}}, samples: []mimirpb.Sample{{ TimestampMs: int64(now), Value: 2, @@ -6944,7 +6945,7 @@ func TestDistributorValidation(t *testing.T) { expectedErr: status.New(codes.InvalidArgument, fmt.Sprintf(tooManyLabelsMsgFormat, 3, 2, `testmetric{foo="bar", foo2="bar2"}`, "")), }, "exceeds maximum labels per series with a metric that exceeds 200 characters when formatted": { - labels: [][]mimirpb.LabelAdapter{{ + labels: [][]mimirpb_custom.LabelAdapter{{ {Name: labels.MetricName, Value: "testmetric"}, {Name: "foo-with-a-long-long-label", Value: "bar-with-a-long-long-value"}, {Name: "foo2-with-a-long-long-label", Value: "bar2-with-a-long-long-value"}, @@ -6958,7 +6959,7 @@ func TestDistributorValidation(t *testing.T) { expectedErr: status.New(codes.InvalidArgument, fmt.Sprintf(tooManyLabelsMsgFormat, 5, 2, `testmetric{foo-with-a-long-long-label="bar-with-a-long-long-value", foo2-with-a-long-long-label="bar2-with-a-long-long-value", foo3-with-a-long-long-label="bar3-with-a-long-long-value", foo4-with-a-lo`, "โ€ฆ")), }, "exceeds maximum labels per series with a metric that exceeds 200 bytes when formatted": { - labels: [][]mimirpb.LabelAdapter{{ + labels: [][]mimirpb_custom.LabelAdapter{{ {Name: labels.MetricName, Value: "testmetric"}, {Name: "foo", Value: "b"}, {Name: "families", Value: "๐Ÿ‘ฉโ€๐Ÿ‘ฆ๐Ÿ‘จโ€๐Ÿ‘ง๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘ง๐Ÿ‘ฉโ€๐Ÿ‘ง๐Ÿ‘ฉโ€๐Ÿ‘ฉโ€๐Ÿ‘ฆโ€๐Ÿ‘ฆ๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ฆ๐Ÿ‘จโ€๐Ÿ‘งโ€๐Ÿ‘ฆ๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘ฆ๐Ÿ‘ช๐Ÿ‘จโ€๐Ÿ‘ฆ๐Ÿ‘จโ€๐Ÿ‘ฆโ€๐Ÿ‘ฆ๐Ÿ‘จโ€๐Ÿ‘จโ€๐Ÿ‘ง๐Ÿ‘จโ€๐Ÿ‘งโ€๐Ÿ‘ง"}, @@ -6970,7 +6971,7 @@ func TestDistributorValidation(t *testing.T) { expectedErr: status.New(codes.InvalidArgument, fmt.Sprintf(tooManyLabelsMsgFormat, 3, 2, `testmetric{families="๐Ÿ‘ฉ\u200d๐Ÿ‘ฆ๐Ÿ‘จ\u200d๐Ÿ‘ง๐Ÿ‘จ\u200d๐Ÿ‘ฉ\u200d๐Ÿ‘ง๐Ÿ‘ฉ\u200d๐Ÿ‘ง๐Ÿ‘ฉ\u200d๐Ÿ‘ฉ\u200d๐Ÿ‘ฆ\u200d๐Ÿ‘ฆ๐Ÿ‘จ\u200d๐Ÿ‘ฉ\u200d๐Ÿ‘ง\u200d๐Ÿ‘ฆ๐Ÿ‘จ\u200d๐Ÿ‘ง\u200d๐Ÿ‘ฆ๐Ÿ‘จ\u200d๐Ÿ‘ฉ\u200d๐Ÿ‘ฆ๐Ÿ‘ช๐Ÿ‘จ\u200d๐Ÿ‘ฆ๐Ÿ‘จ\u200d๐Ÿ‘ฆ\u200d๐Ÿ‘ฆ๐Ÿ‘จ\u200d๐Ÿ‘จ\u200d๐Ÿ‘ง๐Ÿ‘จ\u200d๐Ÿ‘ง\u200d๐Ÿ‘ง", foo="b"}`, "")), }, "multiple validation failures should return the first failure": { - labels: [][]mimirpb.LabelAdapter{ + labels: [][]mimirpb_custom.LabelAdapter{ {{Name: labels.MetricName, Value: "testmetric"}, {Name: "foo", Value: "bar"}, {Name: "foo2", Value: "bar2"}}, {{Name: labels.MetricName, Value: "testmetric"}, {Name: "foo", Value: "bar"}}, }, @@ -6982,7 +6983,7 @@ func TestDistributorValidation(t *testing.T) { }, "metadata validation failure": { metadata: []*mimirpb.MetricMetadata{{MetricFamilyName: "", Help: "a test metric.", Unit: "", Type: mimirpb.COUNTER}}, - labels: [][]mimirpb.LabelAdapter{{{Name: labels.MetricName, Value: "testmetric"}, {Name: "foo", Value: "bar"}}}, + labels: [][]mimirpb_custom.LabelAdapter{{{Name: labels.MetricName, Value: "testmetric"}, {Name: "foo", Value: "bar"}}}, samples: []mimirpb.Sample{{ TimestampMs: int64(now), Value: 1, @@ -6992,7 +6993,7 @@ func TestDistributorValidation(t *testing.T) { // Validation passes for empty exemplar labels, since we just want to skip the exemplars and not fail the time series as a whole. "empty exemplar labels": { metadata: []*mimirpb.MetricMetadata{{MetricFamilyName: "testmetric", Help: "a test metric.", Unit: "", Type: mimirpb.COUNTER}}, - labels: [][]mimirpb.LabelAdapter{{{Name: labels.MetricName, Value: "testmetric"}, {Name: "foo", Value: "bar"}}}, + labels: [][]mimirpb_custom.LabelAdapter{{{Name: labels.MetricName, Value: "testmetric"}, {Name: "foo", Value: "bar"}}}, samples: []mimirpb.Sample{{ TimestampMs: int64(now), Value: 1, @@ -7039,8 +7040,8 @@ func TestDistributor_Push_Relabel(t *testing.T) { ctx := user.InjectOrgID(context.Background(), "user") type testcase struct { - inputSeries []mimirpb.LabelAdapter - expectedSeries []mimirpb.LabelAdapter + inputSeries []mimirpb_custom.LabelAdapter + expectedSeries []mimirpb_custom.LabelAdapter metricRelabelConfigs []*relabel.Config } @@ -7176,11 +7177,11 @@ func TestDistributor_MetricsWithRequestModifications(t *testing.T) { "cortex_distributor_received_metadata_total", } } - uniqueMetricsGen := func(sampleIdx int) []mimirpb.LabelAdapter { - return []mimirpb.LabelAdapter{{Name: "__name__", Value: fmt.Sprintf("metric_%d", sampleIdx)}} + uniqueMetricsGen := func(sampleIdx int) []mimirpb_custom.LabelAdapter { + return []mimirpb_custom.LabelAdapter{{Name: "__name__", Value: fmt.Sprintf("metric_%d", sampleIdx)}} } - exemplarLabelGen := func(sampleIdx int) []mimirpb.LabelAdapter { - return []mimirpb.LabelAdapter{{Name: "exemplarLabel", Value: fmt.Sprintf("value_%d", sampleIdx)}} + exemplarLabelGen := func(sampleIdx int) []mimirpb_custom.LabelAdapter { + return []mimirpb_custom.LabelAdapter{{Name: "exemplarLabel", Value: fmt.Sprintf("value_%d", sampleIdx)}} } metaDataGen := func(_ int, metricName string) *mimirpb.MetricMetadata { return &mimirpb.MetricMetadata{ @@ -7278,11 +7279,11 @@ func TestDistributor_MetricsWithRequestModifications(t *testing.T) { cfg.enableTracker = true dist, reg := getDistributor(cfg) - uniqueMetricsGenWithReplica := func(replica string) func(sampleIdx int) []mimirpb.LabelAdapter { - return func(sampleIdx int) []mimirpb.LabelAdapter { + uniqueMetricsGenWithReplica := func(replica string) func(sampleIdx int) []mimirpb_custom.LabelAdapter { + return func(sampleIdx int) []mimirpb_custom.LabelAdapter { labels := uniqueMetricsGen(sampleIdx) - labels = append(labels, mimirpb.LabelAdapter{Name: "__replica__", Value: replica}) - labels = append(labels, mimirpb.LabelAdapter{Name: "cluster", Value: "test_cluster"}) + labels = append(labels, mimirpb_custom.LabelAdapter{Name: "__replica__", Value: replica}) + labels = append(labels, mimirpb_custom.LabelAdapter{Name: "cluster", Value: "test_cluster"}) return labels } } @@ -7345,10 +7346,10 @@ func TestDistributor_MetricsWithRequestModifications(t *testing.T) { cfg.limits.MaxLabelValueLength = labelValueLimit dist, reg := getDistributor(cfg) - halfLabelValuesAboveLimit := func(sampleIdx int) []mimirpb.LabelAdapter { + halfLabelValuesAboveLimit := func(sampleIdx int) []mimirpb_custom.LabelAdapter { labels := uniqueMetricsGen(sampleIdx) if sampleIdx%2 == 0 { - labels = append(labels, mimirpb.LabelAdapter{ + labels = append(labels, mimirpb_custom.LabelAdapter{ Name: "long_label", Value: strings.Repeat("a", labelValueLimit+1), }) } @@ -7410,9 +7411,9 @@ func TestDistributor_MetricsWithRequestModifications(t *testing.T) { for sampleIdx := 0; sampleIdx < 20; sampleIdx++ { lbs := uniqueMetricsGen(sampleIdx) if sampleIdx%2 == 0 { - req.AddHistogramSeries([][]mimirpb.LabelAdapter{lbs}, []mimirpb.Histogram{validHistogram}, nil) + req.AddHistogramSeries([][]mimirpb_custom.LabelAdapter{lbs}, []mimirpb.Histogram{validHistogram}, nil) } else { - req.AddHistogramSeries([][]mimirpb.LabelAdapter{lbs}, []mimirpb.Histogram{invalidHistogram}, nil) + req.AddHistogramSeries([][]mimirpb_custom.LabelAdapter{lbs}, []mimirpb.Histogram{invalidHistogram}, nil) } } @@ -7585,14 +7586,14 @@ func TestSeriesAreShardedToCorrectIngesters(t *testing.T) { } d, ingesters, _, _ := prepare(t, config) - uniqueMetricsGen := func(sampleIdx int) []mimirpb.LabelAdapter { - return []mimirpb.LabelAdapter{ + uniqueMetricsGen := func(sampleIdx int) []mimirpb_custom.LabelAdapter { + return []mimirpb_custom.LabelAdapter{ {Name: "__name__", Value: fmt.Sprintf("%d", sampleIdx)}, {Name: "x", Value: fmt.Sprintf("%d", sampleIdx)}, } } - exemplarLabelGen := func(sampleIdx int) []mimirpb.LabelAdapter { - return []mimirpb.LabelAdapter{{Name: "exemplarLabel", Value: fmt.Sprintf("value_%d", sampleIdx)}} + exemplarLabelGen := func(sampleIdx int) []mimirpb_custom.LabelAdapter { + return []mimirpb_custom.LabelAdapter{{Name: "exemplarLabel", Value: fmt.Sprintf("value_%d", sampleIdx)}} } metaDataGen := func(_ int, metricName string) *mimirpb.MetricMetadata { return &mimirpb.MetricMetadata{ @@ -7761,8 +7762,8 @@ func countCalls(ingesters []*mockIngester, name string) int { } func TestStartFinishRequest(t *testing.T) { - uniqueMetricsGen := func(sampleIdx int) []mimirpb.LabelAdapter { - return []mimirpb.LabelAdapter{ + uniqueMetricsGen := func(sampleIdx int) []mimirpb_custom.LabelAdapter { + return []mimirpb_custom.LabelAdapter{ {Name: "__name__", Value: fmt.Sprintf("metric_%d", sampleIdx)}, } } @@ -8271,7 +8272,7 @@ func TestCheckStartedMiddleware(t *testing.T) { defer cancel() _, err = distributor.Push(ctx, mimirpb.ToWriteRequest( - [][]mimirpb.LabelAdapter{ + [][]mimirpb_custom.LabelAdapter{ { { Name: "__name__", diff --git a/pkg/distributor/ha_tracker.go b/pkg/distributor/ha_tracker.go index eaa90b500b..ffca0f56be 100644 --- a/pkg/distributor/ha_tracker.go +++ b/pkg/distributor/ha_tracker.go @@ -27,7 +27,7 @@ import ( "github.com/prometheus/client_golang/prometheus/promauto" "github.com/prometheus/prometheus/model/timestamp" - "github.com/grafana/mimir/pkg/mimirpb" + "github.com/grafana/mimir/pkg/mimirpb_custom" "github.com/grafana/mimir/pkg/util" ) @@ -660,9 +660,9 @@ func (h *defaultHaTracker) updateKVStore(ctx context.Context, userID, cluster, r return err } -func findHALabels(replicaLabel, clusterLabel string, labels []mimirpb.LabelAdapter) (string, string) { +func findHALabels(replicaLabel, clusterLabel string, labels []mimirpb_custom.LabelAdapter) (string, string) { var cluster, replica string - var pair mimirpb.LabelAdapter + var pair mimirpb_custom.LabelAdapter for _, pair = range labels { if pair.Name == replicaLabel { diff --git a/pkg/distributor/ha_tracker_test.go b/pkg/distributor/ha_tracker_test.go index 68ef61e417..8715fc4243 100644 --- a/pkg/distributor/ha_tracker_test.go +++ b/pkg/distributor/ha_tracker_test.go @@ -31,7 +31,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/grafana/mimir/pkg/mimirpb" + "github.com/grafana/mimir/pkg/mimirpb_custom" utiltest "github.com/grafana/mimir/pkg/util/test" ) @@ -840,11 +840,11 @@ func TestHATrackerFindHALabels(t *testing.T) { replica string } cases := []struct { - labelsIn []mimirpb.LabelAdapter + labelsIn []mimirpb_custom.LabelAdapter expected expectedOutput }{ { - []mimirpb.LabelAdapter{ + []mimirpb_custom.LabelAdapter{ {Name: "__name__", Value: "foo"}, {Name: "bar", Value: "baz"}, {Name: "sample", Value: "1"}, @@ -853,7 +853,7 @@ func TestHATrackerFindHALabels(t *testing.T) { expectedOutput{cluster: "", replica: "1"}, }, { - []mimirpb.LabelAdapter{ + []mimirpb_custom.LabelAdapter{ {Name: "__name__", Value: "foo"}, {Name: "bar", Value: "baz"}, {Name: "sample", Value: "1"}, @@ -862,7 +862,7 @@ func TestHATrackerFindHALabels(t *testing.T) { expectedOutput{cluster: "cluster-2", replica: ""}, }, { - []mimirpb.LabelAdapter{ + []mimirpb_custom.LabelAdapter{ {Name: "__name__", Value: "foo"}, {Name: "bar", Value: "baz"}, {Name: "sample", Value: "1"}, diff --git a/pkg/distributor/otel_test.go b/pkg/distributor/otel_test.go index 614784756c..54ac9b44f6 100644 --- a/pkg/distributor/otel_test.go +++ b/pkg/distributor/otel_test.go @@ -37,6 +37,7 @@ import ( "google.golang.org/protobuf/proto" "github.com/grafana/mimir/pkg/mimirpb" + "github.com/grafana/mimir/pkg/mimirpb_custom" "github.com/grafana/mimir/pkg/util/test" "github.com/grafana/mimir/pkg/util/validation" ) @@ -79,13 +80,13 @@ func TestOTelMetricsToTimeSeries(t *testing.T) { name string promoteResourceAttributes []string keepIdentifyingResourceAttributes bool - expectedLabels []mimirpb.LabelAdapter - expectedInfoLabels []mimirpb.LabelAdapter + expectedLabels []mimirpb_custom.LabelAdapter + expectedInfoLabels []mimirpb_custom.LabelAdapter }{ { name: "Successful conversion without resource attribute promotion", promoteResourceAttributes: nil, - expectedLabels: []mimirpb.LabelAdapter{ + expectedLabels: []mimirpb_custom.LabelAdapter{ { Name: "__name__", Value: "test_metric", @@ -103,7 +104,7 @@ func TestOTelMetricsToTimeSeries(t *testing.T) { Value: "metric value", }, }, - expectedInfoLabels: []mimirpb.LabelAdapter{ + expectedInfoLabels: []mimirpb_custom.LabelAdapter{ { Name: "__name__", Value: "target_info", @@ -130,7 +131,7 @@ func TestOTelMetricsToTimeSeries(t *testing.T) { name: "Successful conversion without resource attribute promotion, and keep identifying resource attributes", promoteResourceAttributes: nil, keepIdentifyingResourceAttributes: true, - expectedLabels: []mimirpb.LabelAdapter{ + expectedLabels: []mimirpb_custom.LabelAdapter{ { Name: "__name__", Value: "test_metric", @@ -148,7 +149,7 @@ func TestOTelMetricsToTimeSeries(t *testing.T) { Value: "metric value", }, }, - expectedInfoLabels: []mimirpb.LabelAdapter{ + expectedInfoLabels: []mimirpb_custom.LabelAdapter{ { Name: "__name__", Value: "target_info", @@ -186,7 +187,7 @@ func TestOTelMetricsToTimeSeries(t *testing.T) { { name: "Successful conversion with resource attribute promotion", promoteResourceAttributes: []string{"non-existent-attr", "existent-attr"}, - expectedLabels: []mimirpb.LabelAdapter{ + expectedLabels: []mimirpb_custom.LabelAdapter{ { Name: "__name__", Value: "test_metric", @@ -208,7 +209,7 @@ func TestOTelMetricsToTimeSeries(t *testing.T) { Value: "resource value", }, }, - expectedInfoLabels: []mimirpb.LabelAdapter{ + expectedInfoLabels: []mimirpb_custom.LabelAdapter{ { Name: "__name__", Value: "target_info", @@ -234,7 +235,7 @@ func TestOTelMetricsToTimeSeries(t *testing.T) { { name: "Successful conversion with resource attribute promotion, conflicting resource attributes are ignored", promoteResourceAttributes: []string{"non-existent-attr", "existent-attr", "metric-attr", "job", "instance"}, - expectedLabels: []mimirpb.LabelAdapter{ + expectedLabels: []mimirpb_custom.LabelAdapter{ { Name: "__name__", Value: "test_metric", @@ -256,7 +257,7 @@ func TestOTelMetricsToTimeSeries(t *testing.T) { Value: "metric value", }, }, - expectedInfoLabels: []mimirpb.LabelAdapter{ + expectedInfoLabels: []mimirpb_custom.LabelAdapter{ { Name: "__name__", Value: "target_info", @@ -504,7 +505,7 @@ func TestHandlerOTLPPush(t *testing.T) { require.Len(t, series, 1) for name, value := range tc.expectedAttributePromotions { - require.Truef(t, slices.ContainsFunc(series[0].Labels, func(l mimirpb.LabelAdapter) bool { + require.Truef(t, slices.ContainsFunc(series[0].Labels, func(l mimirpb_custom.LabelAdapter) bool { return l.Name == name && l.Value == value }), "OTel resource attribute should have been promoted to label %s=%s", name, value) } diff --git a/pkg/distributor/otlp/helper_generated.go b/pkg/distributor/otlp/helper_generated.go index b5dd5650bd..ab00f39a16 100644 --- a/pkg/distributor/otlp/helper_generated.go +++ b/pkg/distributor/otlp/helper_generated.go @@ -37,6 +37,7 @@ import ( conventions "go.opentelemetry.io/collector/semconv/v1.6.1" "github.com/grafana/mimir/pkg/mimirpb" + "github.com/grafana/mimir/pkg/mimirpb_custom" "github.com/prometheus/prometheus/model/timestamp" "github.com/prometheus/prometheus/model/value" @@ -76,7 +77,7 @@ func (m byBucketBoundsData) Less(i, j int) bool { return m[i].bound < m[j].bound func (m byBucketBoundsData) Swap(i, j int) { m[i], m[j] = m[j], m[i] } // ByLabelName enables the usage of sort.Sort() with a slice of labels. -type ByLabelName []mimirpb.LabelAdapter +type ByLabelName []mimirpb_custom.LabelAdapter func (a ByLabelName) Len() int { return len(a) } func (a ByLabelName) Less(i, j int) bool { return a[i].Name < a[j].Name } @@ -86,7 +87,7 @@ func (a ByLabelName) Swap(i, j int) { a[i], a[j] = a[j], a[i] } // The label slice should not contain duplicate label names; this method sorts the slice by label name before creating // the signature. // The algorithm is the same as in Prometheus' labels.StableHash function. -func timeSeriesSignature(labels []mimirpb.LabelAdapter) uint64 { +func timeSeriesSignature(labels []mimirpb_custom.LabelAdapter) uint64 { sort.Sort(ByLabelName(labels)) // Use xxhash.Sum64(b) for fast path as it's faster. @@ -120,15 +121,15 @@ var seps = []byte{'\xff'} // if logOnOverwrite is true, the overwrite is logged. Resulting label names are sanitized. // If settings.PromoteResourceAttributes is not empty, it's a set of resource attributes that should be promoted to labels. func createAttributes(resource pcommon.Resource, attributes pcommon.Map, settings Settings, - ignoreAttrs []string, logOnOverwrite bool, extras ...string) []mimirpb.LabelAdapter { + ignoreAttrs []string, logOnOverwrite bool, extras ...string) []mimirpb_custom.LabelAdapter { resourceAttrs := resource.Attributes() serviceName, haveServiceName := resourceAttrs.Get(conventions.AttributeServiceName) instance, haveInstanceID := resourceAttrs.Get(conventions.AttributeServiceInstanceID) - promotedAttrs := make([]mimirpb.LabelAdapter, 0, len(settings.PromoteResourceAttributes)) + promotedAttrs := make([]mimirpb_custom.LabelAdapter, 0, len(settings.PromoteResourceAttributes)) for _, name := range settings.PromoteResourceAttributes { if value, exists := resourceAttrs.Get(name); exists { - promotedAttrs = append(promotedAttrs, mimirpb.LabelAdapter{Name: name, Value: value.AsString()}) + promotedAttrs = append(promotedAttrs, mimirpb_custom.LabelAdapter{Name: name, Value: value.AsString()}) } } sort.Stable(ByLabelName(promotedAttrs)) @@ -146,12 +147,12 @@ func createAttributes(resource pcommon.Resource, attributes pcommon.Map, setting // Ensure attributes are sorted by key for consistent merging of keys which // collide when sanitized. - labels := make([]mimirpb.LabelAdapter, 0, maxLabelCount) + labels := make([]mimirpb_custom.LabelAdapter, 0, maxLabelCount) // XXX: Should we always drop service namespace/service name/service instance ID from the labels // (as they get mapped to other Prometheus labels)? attributes.Range(func(key string, value pcommon.Value) bool { if !slices.Contains(ignoreAttrs, key) { - labels = append(labels, mimirpb.LabelAdapter{Name: key, Value: value.AsString()}) + labels = append(labels, mimirpb_custom.LabelAdapter{Name: key, Value: value.AsString()}) } return true }) @@ -221,7 +222,7 @@ func createAttributes(resource pcommon.Resource, attributes pcommon.Map, setting labels = labels[:0] for k, v := range l { - labels = append(labels, mimirpb.LabelAdapter{Name: k, Value: v}) + labels = append(labels, mimirpb_custom.LabelAdapter{Name: k, Value: v}) } return labels @@ -380,7 +381,7 @@ func getPromExemplars[T exemplarType](ctx context.Context, everyN *everyNTimes, if traceID := exemplar.TraceID(); !traceID.IsEmpty() { val := hex.EncodeToString(traceID[:]) exemplarRunes += utf8.RuneCountInString(traceIDKey) + utf8.RuneCountInString(val) - promLabel := mimirpb.LabelAdapter{ + promLabel := mimirpb_custom.LabelAdapter{ Name: traceIDKey, Value: val, } @@ -389,7 +390,7 @@ func getPromExemplars[T exemplarType](ctx context.Context, everyN *everyNTimes, if spanID := exemplar.SpanID(); !spanID.IsEmpty() { val := hex.EncodeToString(spanID[:]) exemplarRunes += utf8.RuneCountInString(spanIDKey) + utf8.RuneCountInString(val) - promLabel := mimirpb.LabelAdapter{ + promLabel := mimirpb_custom.LabelAdapter{ Name: spanIDKey, Value: val, } @@ -397,11 +398,11 @@ func getPromExemplars[T exemplarType](ctx context.Context, everyN *everyNTimes, } attrs := exemplar.FilteredAttributes() - labelsFromAttributes := make([]mimirpb.LabelAdapter, 0, attrs.Len()) + labelsFromAttributes := make([]mimirpb_custom.LabelAdapter, 0, attrs.Len()) attrs.Range(func(key string, value pcommon.Value) bool { val := value.AsString() exemplarRunes += utf8.RuneCountInString(key) + utf8.RuneCountInString(val) - promLabel := mimirpb.LabelAdapter{ + promLabel := mimirpb_custom.LabelAdapter{ Name: key, Value: val, } @@ -524,24 +525,24 @@ func (c *MimirConverter) addSummaryDataPoints(ctx context.Context, dataPoints pm // createLabels returns a copy of baseLabels, adding to it the pair model.MetricNameLabel=name. // If extras are provided, corresponding label pairs are also added to the returned slice. // If extras is uneven length, the last (unpaired) extra will be ignored. -func createLabels(name string, baseLabels []mimirpb.LabelAdapter, extras ...string) []mimirpb.LabelAdapter { +func createLabels(name string, baseLabels []mimirpb_custom.LabelAdapter, extras ...string) []mimirpb_custom.LabelAdapter { extraLabelCount := len(extras) / 2 - labels := make([]mimirpb.LabelAdapter, len(baseLabels), len(baseLabels)+extraLabelCount+1) // +1 for name + labels := make([]mimirpb_custom.LabelAdapter, len(baseLabels), len(baseLabels)+extraLabelCount+1) // +1 for name copy(labels, baseLabels) n := len(extras) n -= n % 2 for extrasIdx := 0; extrasIdx < n; extrasIdx += 2 { - labels = append(labels, mimirpb.LabelAdapter{Name: extras[extrasIdx], Value: extras[extrasIdx+1]}) + labels = append(labels, mimirpb_custom.LabelAdapter{Name: extras[extrasIdx], Value: extras[extrasIdx+1]}) } - labels = append(labels, mimirpb.LabelAdapter{Name: model.MetricNameLabel, Value: name}) + labels = append(labels, mimirpb_custom.LabelAdapter{Name: model.MetricNameLabel, Value: name}) return labels } // getOrCreateTimeSeries returns the time series corresponding to the label set if existent, and false. // Otherwise it creates a new one and returns that, and true. -func (c *MimirConverter) getOrCreateTimeSeries(lbls []mimirpb.LabelAdapter) (*mimirpb.TimeSeries, bool) { +func (c *MimirConverter) getOrCreateTimeSeries(lbls []mimirpb_custom.LabelAdapter) (*mimirpb.TimeSeries, bool) { h := timeSeriesSignature(lbls) ts := c.unique[h] if ts != nil { @@ -577,7 +578,7 @@ func (c *MimirConverter) getOrCreateTimeSeries(lbls []mimirpb.LabelAdapter) (*mi // addTimeSeriesIfNeeded adds a corresponding time series if it doesn't already exist. // If the time series doesn't already exist, it gets added with startTimestamp for its value and timestamp for its timestamp, // both converted to milliseconds. -func (c *MimirConverter) addTimeSeriesIfNeeded(lbls []mimirpb.LabelAdapter, startTimestamp int64, timestamp pcommon.Timestamp) { +func (c *MimirConverter) addTimeSeriesIfNeeded(lbls []mimirpb_custom.LabelAdapter, startTimestamp int64, timestamp pcommon.Timestamp) { ts, created := c.getOrCreateTimeSeries(lbls) if created { ts.Samples = []mimirpb.Sample{ @@ -599,7 +600,7 @@ const defaultIntervalForStartTimestamps = int64(300_000) // make use of its direct support fort Created Timestamps instead. // See https://opentelemetry.io/docs/specs/otel/metrics/data-model/#resets-and-gaps to know more about how OTel handles // resets for cumulative metrics. -func (c *MimirConverter) handleStartTime(startTs, ts int64, labels []mimirpb.LabelAdapter, settings Settings, typ string, value float64, logger *slog.Logger) { +func (c *MimirConverter) handleStartTime(startTs, ts int64, labels []mimirpb_custom.LabelAdapter, settings Settings, typ string, value float64, logger *slog.Logger) { if !settings.EnableCreatedTimestampZeroIngestion { return } diff --git a/pkg/distributor/otlp/metrics_to_prw_generated.go b/pkg/distributor/otlp/metrics_to_prw_generated.go index 5eb1391dad..157a8c0a01 100644 --- a/pkg/distributor/otlp/metrics_to_prw_generated.go +++ b/pkg/distributor/otlp/metrics_to_prw_generated.go @@ -35,6 +35,7 @@ import ( "github.com/prometheus/prometheus/util/annotations" "github.com/grafana/mimir/pkg/mimirpb" + "github.com/grafana/mimir/pkg/mimirpb_custom" ) type Settings struct { @@ -54,7 +55,7 @@ type Settings struct { } type StartTsAndTs struct { - Labels []mimirpb.LabelAdapter + Labels []mimirpb_custom.LabelAdapter StartTs int64 Ts int64 } @@ -203,7 +204,7 @@ func (c *MimirConverter) FromMetrics(ctx context.Context, md pmetric.Metrics, se return annots, errs } -func isSameMetric(ts *mimirpb.TimeSeries, lbls []mimirpb.LabelAdapter) bool { +func isSameMetric(ts *mimirpb.TimeSeries, lbls []mimirpb_custom.LabelAdapter) bool { if len(ts.Labels) != len(lbls) { return false } @@ -250,7 +251,7 @@ func (c *MimirConverter) addExemplars(ctx context.Context, dataPoint pmetric.His // If there is no corresponding TimeSeries already, it's created. // The corresponding TimeSeries is returned. // If either lbls is nil/empty or sample is nil, nothing is done. -func (c *MimirConverter) addSample(sample *mimirpb.Sample, lbls []mimirpb.LabelAdapter) *mimirpb.TimeSeries { +func (c *MimirConverter) addSample(sample *mimirpb.Sample, lbls []mimirpb_custom.LabelAdapter) *mimirpb.TimeSeries { if sample == nil || len(lbls) == 0 { // This shouldn't happen return nil @@ -261,7 +262,7 @@ func (c *MimirConverter) addSample(sample *mimirpb.Sample, lbls []mimirpb.LabelA return ts } -type labelsStringer []mimirpb.LabelAdapter +type labelsStringer []mimirpb_custom.LabelAdapter func (ls labelsStringer) String() string { var seriesBuilder strings.Builder diff --git a/pkg/distributor/otlp/number_data_points_generated.go b/pkg/distributor/otlp/number_data_points_generated.go index f6e32c3cb8..dadecb9f94 100644 --- a/pkg/distributor/otlp/number_data_points_generated.go +++ b/pkg/distributor/otlp/number_data_points_generated.go @@ -28,6 +28,7 @@ import ( "go.opentelemetry.io/collector/pdata/pmetric" "github.com/grafana/mimir/pkg/mimirpb" + "github.com/grafana/mimir/pkg/mimirpb_custom" "github.com/prometheus/prometheus/model/value" ) @@ -119,7 +120,7 @@ func (c *MimirConverter) addSumNumberDataPoints(ctx context.Context, dataPoints return nil } - createdLabels := make([]mimirpb.LabelAdapter, len(lbls)) + createdLabels := make([]mimirpb_custom.LabelAdapter, len(lbls)) copy(createdLabels, lbls) for i, l := range createdLabels { if l.Name == model.MetricNameLabel { diff --git a/pkg/distributor/push_test.go b/pkg/distributor/push_test.go index 192769b114..0f4f66408c 100644 --- a/pkg/distributor/push_test.go +++ b/pkg/distributor/push_test.go @@ -41,6 +41,7 @@ import ( "google.golang.org/grpc/credentials/insecure" "github.com/grafana/mimir/pkg/mimirpb" + "github.com/grafana/mimir/pkg/mimirpb_custom" "github.com/grafana/mimir/pkg/util" "github.com/grafana/mimir/pkg/util/test" "github.com/grafana/mimir/pkg/util/validation" @@ -359,54 +360,54 @@ func TestHandler_SkipExemplarUnmarshalingBasedOnLimits(t *testing.T) { { name: "request with exemplars and exemplars are enabled", submitTimeseries: mimirpb.TimeSeries{ - Labels: []mimirpb.LabelAdapter{ + Labels: []mimirpb_custom.LabelAdapter{ {Name: "label1", Value: "value1"}, }, Samples: []mimirpb.Sample{ {Value: 1, TimestampMs: timestampMs}, }, Exemplars: []mimirpb.Exemplar{ - {Labels: []mimirpb.LabelAdapter{{Name: "label1", Value: "value1"}}, Value: 1, TimestampMs: timestampMs}, - {Labels: []mimirpb.LabelAdapter{{Name: "label2", Value: "value2"}}, Value: 2, TimestampMs: timestampMs}, - {Labels: []mimirpb.LabelAdapter{{Name: "label3", Value: "value3"}}, Value: 3, TimestampMs: timestampMs}, + {Labels: []mimirpb_custom.LabelAdapter{{Name: "label1", Value: "value1"}}, Value: 1, TimestampMs: timestampMs}, + {Labels: []mimirpb_custom.LabelAdapter{{Name: "label2", Value: "value2"}}, Value: 2, TimestampMs: timestampMs}, + {Labels: []mimirpb_custom.LabelAdapter{{Name: "label3", Value: "value3"}}, Value: 3, TimestampMs: timestampMs}, }, Histograms: []mimirpb.Histogram{{Sum: 1, Schema: 2, ZeroThreshold: 3, ResetHint: 4, Timestamp: 5}}, }, maxGlobalExemplarsPerUser: 1, // exemplars are not disabled expectTimeseries: mimirpb.TimeSeries{ - Labels: []mimirpb.LabelAdapter{ + Labels: []mimirpb_custom.LabelAdapter{ {Name: "label1", Value: "value1"}, }, Samples: []mimirpb.Sample{ {Value: 1, TimestampMs: timestampMs}, }, Exemplars: []mimirpb.Exemplar{ - {Labels: []mimirpb.LabelAdapter{{Name: "label1", Value: "value1"}}, Value: 1, TimestampMs: timestampMs}, - {Labels: []mimirpb.LabelAdapter{{Name: "label2", Value: "value2"}}, Value: 2, TimestampMs: timestampMs}, - {Labels: []mimirpb.LabelAdapter{{Name: "label3", Value: "value3"}}, Value: 3, TimestampMs: timestampMs}, + {Labels: []mimirpb_custom.LabelAdapter{{Name: "label1", Value: "value1"}}, Value: 1, TimestampMs: timestampMs}, + {Labels: []mimirpb_custom.LabelAdapter{{Name: "label2", Value: "value2"}}, Value: 2, TimestampMs: timestampMs}, + {Labels: []mimirpb_custom.LabelAdapter{{Name: "label3", Value: "value3"}}, Value: 3, TimestampMs: timestampMs}, }, Histograms: []mimirpb.Histogram{{Sum: 1, Schema: 2, ZeroThreshold: 3, ResetHint: 4, Timestamp: 5}}, }, }, { name: "request with exemplars and exemplars are disabled", submitTimeseries: mimirpb.TimeSeries{ - Labels: []mimirpb.LabelAdapter{ + Labels: []mimirpb_custom.LabelAdapter{ {Name: "label1", Value: "value1"}, }, Samples: []mimirpb.Sample{ {Value: 1, TimestampMs: timestampMs}, }, Exemplars: []mimirpb.Exemplar{ - {Labels: []mimirpb.LabelAdapter{{Name: "label1", Value: "value1"}}, Value: 1, TimestampMs: timestampMs}, - {Labels: []mimirpb.LabelAdapter{{Name: "label2", Value: "value2"}}, Value: 2, TimestampMs: timestampMs}, - {Labels: []mimirpb.LabelAdapter{{Name: "label3", Value: "value3"}}, Value: 3, TimestampMs: timestampMs}, + {Labels: []mimirpb_custom.LabelAdapter{{Name: "label1", Value: "value1"}}, Value: 1, TimestampMs: timestampMs}, + {Labels: []mimirpb_custom.LabelAdapter{{Name: "label2", Value: "value2"}}, Value: 2, TimestampMs: timestampMs}, + {Labels: []mimirpb_custom.LabelAdapter{{Name: "label3", Value: "value3"}}, Value: 3, TimestampMs: timestampMs}, }, Histograms: []mimirpb.Histogram{{Sum: 1, Schema: 2, ZeroThreshold: 3, ResetHint: 4, Timestamp: 5}}, SkipUnmarshalingExemplars: true, }, maxGlobalExemplarsPerUser: 0, // 0 disables exemplars expectTimeseries: mimirpb.TimeSeries{ - Labels: []mimirpb.LabelAdapter{ + Labels: []mimirpb_custom.LabelAdapter{ {Name: "label1", Value: "value1"}, }, Samples: []mimirpb.Sample{ @@ -419,7 +420,7 @@ func TestHandler_SkipExemplarUnmarshalingBasedOnLimits(t *testing.T) { }, { name: "request without exemplars and exemplars are enabled", submitTimeseries: mimirpb.TimeSeries{ - Labels: []mimirpb.LabelAdapter{ + Labels: []mimirpb_custom.LabelAdapter{ {Name: "label1", Value: "value1"}, }, Samples: []mimirpb.Sample{ @@ -430,7 +431,7 @@ func TestHandler_SkipExemplarUnmarshalingBasedOnLimits(t *testing.T) { }, maxGlobalExemplarsPerUser: 1, // exemplars are not disabled expectTimeseries: mimirpb.TimeSeries{ - Labels: []mimirpb.LabelAdapter{ + Labels: []mimirpb_custom.LabelAdapter{ {Name: "label1", Value: "value1"}, }, Samples: []mimirpb.Sample{ @@ -548,7 +549,7 @@ func createMimirWriteRequestProtobuf(t *testing.T, skipLabelNameValidation, skip h := prompb.FromIntHistogram(1337, test.GenerateTestHistogram(1)) ts := mimirpb.PreallocTimeseries{ TimeSeries: &mimirpb.TimeSeries{ - Labels: []mimirpb.LabelAdapter{ + Labels: []mimirpb_custom.LabelAdapter{ {Name: "__name__", Value: "foo"}, }, Samples: []mimirpb.Sample{ @@ -572,7 +573,7 @@ func createMimirWriteRequestProtobufWithNonSupportedLabelNames(t *testing.T, ski t.Helper() ts := mimirpb.PreallocTimeseries{ TimeSeries: &mimirpb.TimeSeries{ - Labels: []mimirpb.LabelAdapter{ + Labels: []mimirpb_custom.LabelAdapter{ {Name: "a-label", Value: "value"}, // a-label does not comply with regex [a-zA-Z_:][a-zA-Z0-9_:]* }, Samples: []mimirpb.Sample{ diff --git a/pkg/distributor/query_test.go b/pkg/distributor/query_test.go index 9f47672938..631e3deb48 100644 --- a/pkg/distributor/query_test.go +++ b/pkg/distributor/query_test.go @@ -25,6 +25,7 @@ import ( ingester_client "github.com/grafana/mimir/pkg/ingester/client" "github.com/grafana/mimir/pkg/mimirpb" + "github.com/grafana/mimir/pkg/mimirpb_custom" "github.com/grafana/mimir/pkg/querier/api" "github.com/grafana/mimir/pkg/querier/stats" "github.com/grafana/mimir/pkg/util/limiter" @@ -561,8 +562,8 @@ func TestMergeExemplars(t *testing.T) { exemplar3 := mimirpb.Exemplar{Labels: mimirpb.FromLabelsToLabelAdapters(labels.FromStrings("traceID", "trace-3")), TimestampMs: now + 4, Value: 3} exemplar4 := mimirpb.Exemplar{Labels: mimirpb.FromLabelsToLabelAdapters(labels.FromStrings("traceID", "trace-4")), TimestampMs: now + 8, Value: 7} exemplar5 := mimirpb.Exemplar{Labels: mimirpb.FromLabelsToLabelAdapters(labels.FromStrings("traceID", "trace-4")), TimestampMs: now, Value: 7} - labels1 := []mimirpb.LabelAdapter{{Name: "label1", Value: "foo1"}} - labels2 := []mimirpb.LabelAdapter{{Name: "label1", Value: "foo2"}} + labels1 := []mimirpb_custom.LabelAdapter{{Name: "label1", Value: "foo1"}} + labels2 := []mimirpb_custom.LabelAdapter{{Name: "label1", Value: "foo2"}} for i, c := range []struct { seriesA []mimirpb.TimeSeries @@ -638,7 +639,7 @@ func makeExemplarQueryResponse(numSeries int) *ingester_client.ExemplarQueryResp } ts[i].Labels = mimirpb.FromLabelsToLabelAdapters(lbls.Labels()) ts[i].Exemplars = []mimirpb.Exemplar{{ - Labels: []mimirpb.LabelAdapter{{Name: "traceid", Value: "trace1"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "traceid", Value: "trace1"}}, Value: float64(i), TimestampMs: now.Add(time.Hour).UnixNano() / int64(time.Millisecond), }} diff --git a/pkg/distributor/validate.go b/pkg/distributor/validate.go index bbb6717bc9..52c3de4a89 100644 --- a/pkg/distributor/validate.go +++ b/pkg/distributor/validate.go @@ -17,6 +17,7 @@ import ( "github.com/prometheus/common/model" "github.com/grafana/mimir/pkg/mimirpb" + "github.com/grafana/mimir/pkg/mimirpb_custom" "github.com/grafana/mimir/pkg/util/extract" "github.com/grafana/mimir/pkg/util/globalerror" "github.com/grafana/mimir/pkg/util/validation" @@ -238,7 +239,7 @@ func newExemplarValidationMetrics(r prometheus.Registerer) *exemplarValidationMe // validateSample returns an err if the sample is invalid. // The returned error may retain the provided series labels. // It uses the passed 'now' time to measure the relative time of the sample. -func validateSample(m *sampleValidationMetrics, now model.Time, cfg sampleValidationConfig, userID, group string, ls []mimirpb.LabelAdapter, s mimirpb.Sample) error { +func validateSample(m *sampleValidationMetrics, now model.Time, cfg sampleValidationConfig, userID, group string, ls []mimirpb_custom.LabelAdapter, s mimirpb.Sample) error { if model.Time(s.TimestampMs) > now.Add(cfg.CreationGracePeriod(userID)) { m.tooFarInFuture.WithLabelValues(userID, group).Inc() unsafeMetricName, _ := extract.UnsafeMetricNameFromLabelAdapters(ls) @@ -257,7 +258,7 @@ func validateSample(m *sampleValidationMetrics, now model.Time, cfg sampleValida // validateSampleHistogram returns an err if the sample is invalid. // The returned error may retain the provided series labels. // It uses the passed 'now' time to measure the relative time of the sample. -func validateSampleHistogram(m *sampleValidationMetrics, now model.Time, cfg sampleValidationConfig, userID, group string, ls []mimirpb.LabelAdapter, s *mimirpb.Histogram) (bool, error) { +func validateSampleHistogram(m *sampleValidationMetrics, now model.Time, cfg sampleValidationConfig, userID, group string, ls []mimirpb_custom.LabelAdapter, s *mimirpb.Histogram) (bool, error) { if model.Time(s.Timestamp) > now.Add(cfg.CreationGracePeriod(userID)) { m.tooFarInFuture.WithLabelValues(userID, group).Inc() unsafeMetricName, _ := extract.UnsafeMetricNameFromLabelAdapters(ls) @@ -308,10 +309,10 @@ func validateSampleHistogram(m *sampleValidationMetrics, now model.Time, cfg sam // validateExemplar returns an error if the exemplar is invalid. // The returned error may retain the provided series labels. -func validateExemplar(m *exemplarValidationMetrics, userID string, ls []mimirpb.LabelAdapter, e mimirpb.Exemplar) error { +func validateExemplar(m *exemplarValidationMetrics, userID string, ls []mimirpb_custom.LabelAdapter, e mimirpb.Exemplar) error { if len(e.Labels) <= 0 { m.labelsMissing.WithLabelValues(userID).Inc() - return fmt.Errorf(exemplarEmptyLabelsMsgFormat, e.TimestampMs, mimirpb.FromLabelAdaptersToString(ls), mimirpb.FromLabelAdaptersToString([]mimirpb.LabelAdapter{})) + return fmt.Errorf(exemplarEmptyLabelsMsgFormat, e.TimestampMs, mimirpb.FromLabelAdaptersToString(ls), mimirpb.FromLabelAdaptersToString([]mimirpb_custom.LabelAdapter{})) } if e.TimestampMs == 0 { @@ -392,7 +393,7 @@ func removeNonASCIIChars(in string) (out string) { // validateLabels returns an err if the labels are invalid. // The returned error may retain the provided series labels. -func validateLabels(m *sampleValidationMetrics, cfg labelValidationConfig, userID, group string, ls []mimirpb.LabelAdapter, skipLabelValidation, skipLabelCountValidation bool) error { +func validateLabels(m *sampleValidationMetrics, cfg labelValidationConfig, userID, group string, ls []mimirpb_custom.LabelAdapter, skipLabelValidation, skipLabelCountValidation bool) error { unsafeMetricName, err := extract.UnsafeMetricNameFromLabelAdapters(ls) if err != nil { m.missingMetricName.WithLabelValues(userID, group).Inc() @@ -503,7 +504,7 @@ func cleanAndValidateMetadata(m *metadataValidationMetrics, cfg metadataValidati return err } -func getMetricAndEllipsis(ls []mimirpb.LabelAdapter) (string, string) { +func getMetricAndEllipsis(ls []mimirpb_custom.LabelAdapter) (string, string) { metric := mimirpb.FromLabelAdaptersToString(ls) ellipsis := "" diff --git a/pkg/distributor/validate_test.go b/pkg/distributor/validate_test.go index 0dc670d6e5..f8e570c7d9 100644 --- a/pkg/distributor/validate_test.go +++ b/pkg/distributor/validate_test.go @@ -26,6 +26,7 @@ import ( golangproto "google.golang.org/protobuf/proto" "github.com/grafana/mimir/pkg/mimirpb" + "github.com/grafana/mimir/pkg/mimirpb_custom" "github.com/grafana/mimir/pkg/util/validation" ) @@ -109,7 +110,7 @@ func TestValidateLabels(t *testing.T) { invalidLabelMsgFormat, "foo ", mimirpb.FromLabelAdaptersToString( - []mimirpb.LabelAdapter{ + []mimirpb_custom.LabelAdapter{ {Name: model.MetricNameLabel, Value: "valid"}, {Name: "foo ", Value: "bar"}, }, @@ -130,7 +131,7 @@ func TestValidateLabels(t *testing.T) { labelNameTooLongMsgFormat, "this_is_a_really_really_long_name_that_should_cause_an_error", mimirpb.FromLabelAdaptersToString( - []mimirpb.LabelAdapter{ + []mimirpb_custom.LabelAdapter{ {Name: model.MetricNameLabel, Value: "badLabelName"}, {Name: "this_is_a_really_really_long_name_that_should_cause_an_error", Value: "test_value_please_ignore"}, }, @@ -146,7 +147,7 @@ func TestValidateLabels(t *testing.T) { "much_shorter_name", "test_value_please_ignore_no_really_nothing_to_see_here", mimirpb.FromLabelAdaptersToString( - []mimirpb.LabelAdapter{ + []mimirpb_custom.LabelAdapter{ {Name: model.MetricNameLabel, Value: "badLabelValue"}, {Name: "much_shorter_name", Value: "test_value_please_ignore_no_really_nothing_to_see_here"}, }, @@ -160,7 +161,7 @@ func TestValidateLabels(t *testing.T) { err: fmt.Errorf( tooManyLabelsMsgFormat, tooManyLabelsArgs( - []mimirpb.LabelAdapter{ + []mimirpb_custom.LabelAdapter{ {Name: model.MetricNameLabel, Value: "foo"}, {Name: "bar", Value: "baz"}, {Name: "blip", Value: "blop"}, @@ -184,7 +185,7 @@ func TestValidateLabels(t *testing.T) { err: fmt.Errorf( tooManyInfoLabelsMsgFormat, tooManyLabelsArgs( - []mimirpb.LabelAdapter{ + []mimirpb_custom.LabelAdapter{ {Name: model.MetricNameLabel, Value: "foo_info"}, {Name: "bar", Value: "baz"}, {Name: "blip", Value: "blop"}, @@ -271,44 +272,44 @@ func TestValidateExemplars(t *testing.T) { }, { // Labels all blank - Labels: []mimirpb.LabelAdapter{{Name: "", Value: ""}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "", Value: ""}}, TimestampMs: 1000, }, { // Labels value blank - Labels: []mimirpb.LabelAdapter{{Name: "foo", Value: ""}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "foo", Value: ""}}, TimestampMs: 1000, }, { // Invalid timestamp - Labels: []mimirpb.LabelAdapter{{Name: "foo", Value: "bar"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "foo", Value: "bar"}}, }, { // Combined labelset too long - Labels: []mimirpb.LabelAdapter{{Name: "foo", Value: strings.Repeat("0", 126)}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "foo", Value: strings.Repeat("0", 126)}}, TimestampMs: 1000, }, } for _, ie := range invalidExemplars { - assert.Error(t, validateExemplar(m, userID, []mimirpb.LabelAdapter{}, ie)) + assert.Error(t, validateExemplar(m, userID, []mimirpb_custom.LabelAdapter{}, ie)) } validExemplars := []mimirpb.Exemplar{ { // Valid labels - Labels: []mimirpb.LabelAdapter{{Name: "foo", Value: "bar"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "foo", Value: "bar"}}, TimestampMs: 1000, }, { // Single label blank value with one valid value - Labels: []mimirpb.LabelAdapter{{Name: "foo", Value: ""}, {Name: "traceID", Value: "123abc"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "foo", Value: ""}, {Name: "traceID", Value: "123abc"}}, TimestampMs: 1000, }, } for _, ve := range validExemplars { - assert.NoError(t, validateExemplar(m, userID, []mimirpb.LabelAdapter{}, ve)) + assert.NoError(t, validateExemplar(m, userID, []mimirpb_custom.LabelAdapter{}, ve)) } validation.DiscardedExemplarsCounter(reg, "random reason").WithLabelValues("different user").Inc() @@ -429,7 +430,7 @@ func TestValidateLabelDuplication(t *testing.T) { userID := "testUser" - actual := validateLabels(newSampleValidationMetrics(nil), cfg, userID, "", []mimirpb.LabelAdapter{ + actual := validateLabels(newSampleValidationMetrics(nil), cfg, userID, "", []mimirpb_custom.LabelAdapter{ {Name: model.MetricNameLabel, Value: "a"}, {Name: model.MetricNameLabel, Value: "b"}, }, false, false) @@ -437,7 +438,7 @@ func TestValidateLabelDuplication(t *testing.T) { duplicateLabelMsgFormat, model.MetricNameLabel, mimirpb.FromLabelAdaptersToString( - []mimirpb.LabelAdapter{ + []mimirpb_custom.LabelAdapter{ {Name: model.MetricNameLabel, Value: "a"}, {Name: model.MetricNameLabel, Value: "b"}, }, @@ -445,7 +446,7 @@ func TestValidateLabelDuplication(t *testing.T) { ) assert.Equal(t, expected, actual) - actual = validateLabels(newSampleValidationMetrics(nil), cfg, userID, "", []mimirpb.LabelAdapter{ + actual = validateLabels(newSampleValidationMetrics(nil), cfg, userID, "", []mimirpb_custom.LabelAdapter{ {Name: model.MetricNameLabel, Value: "a"}, {Name: "a", Value: "a"}, {Name: "a", Value: "a"}, @@ -454,7 +455,7 @@ func TestValidateLabelDuplication(t *testing.T) { duplicateLabelMsgFormat, "a", mimirpb.FromLabelAdaptersToString( - []mimirpb.LabelAdapter{ + []mimirpb_custom.LabelAdapter{ {Name: model.MetricNameLabel, Value: "a"}, {Name: "a", Value: "a"}, {Name: "a", Value: "a"}, @@ -606,7 +607,7 @@ func TestMaxNativeHistorgramBuckets(t *testing.T) { t.Run(fmt.Sprintf("limit-%d-%s", limit, name), func(t *testing.T) { var cfg sampleValidationCfg cfg.maxNativeHistogramBuckets = limit - ls := []mimirpb.LabelAdapter{{Name: model.MetricNameLabel, Value: "a"}, {Name: "a", Value: "a"}} + ls := []mimirpb_custom.LabelAdapter{{Name: model.MetricNameLabel, Value: "a"}, {Name: "a", Value: "a"}} _, err := validateSampleHistogram(metrics, model.Now(), cfg, "user-1", "group-1", ls, &h) @@ -651,7 +652,7 @@ func TestInvalidNativeHistogramSchema(t *testing.T) { metrics := newSampleValidationMetrics(registry) cfg := sampleValidationCfg{} hist := &mimirpb.Histogram{} - labels := []mimirpb.LabelAdapter{{Name: model.MetricNameLabel, Value: "a"}, {Name: "a", Value: "a"}} + labels := []mimirpb_custom.LabelAdapter{{Name: model.MetricNameLabel, Value: "a"}, {Name: "a", Value: "a"}} for testName, testCase := range testCases { t.Run(testName, func(t *testing.T) { hist.Schema = testCase.schema @@ -667,7 +668,7 @@ func TestInvalidNativeHistogramSchema(t *testing.T) { `), "cortex_discarded_samples_total")) } -func tooManyLabelsArgs(series []mimirpb.LabelAdapter, limit int) []any { +func tooManyLabelsArgs(series []mimirpb_custom.LabelAdapter, limit int) []any { metric := mimirpb.FromLabelAdaptersToMetric(series).String() ellipsis := "" diff --git a/pkg/frontend/querymiddleware/codec_json_test.go b/pkg/frontend/querymiddleware/codec_json_test.go index eb8d4bfd66..39d594c0ba 100644 --- a/pkg/frontend/querymiddleware/codec_json_test.go +++ b/pkg/frontend/querymiddleware/codec_json_test.go @@ -23,6 +23,7 @@ import ( apierror "github.com/grafana/mimir/pkg/api/error" "github.com/grafana/mimir/pkg/mimirpb" + "github.com/grafana/mimir/pkg/mimirpb_custom" ) func TestPrometheusCodec_JSONResponse_Metrics(t *testing.T) { @@ -56,7 +57,7 @@ func TestPrometheusCodec_JSONResponse_Metrics(t *testing.T) { ResultType: model.ValString.String(), Result: []SampleStream{ { - Labels: []mimirpb.LabelAdapter{{Name: "value", Value: "foo"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "value", Value: "foo"}}, Samples: []mimirpb.Sample{{TimestampMs: 1_500}}, }, }, @@ -104,8 +105,8 @@ func TestPrometheusCodec_JSONResponse_Metrics(t *testing.T) { Data: &PrometheusData{ ResultType: model.ValVector.String(), Result: []SampleStream{ - {Labels: []mimirpb.LabelAdapter{{Name: "foo", Value: "bar"}}, Samples: []mimirpb.Sample{{TimestampMs: 1_000, Value: 200}}}, - {Labels: []mimirpb.LabelAdapter{{Name: "bar", Value: "baz"}}, Samples: []mimirpb.Sample{{TimestampMs: 1_000, Value: 201}}}, + {Labels: []mimirpb_custom.LabelAdapter{{Name: "foo", Value: "bar"}}, Samples: []mimirpb.Sample{{TimestampMs: 1_000, Value: 200}}}, + {Labels: []mimirpb_custom.LabelAdapter{{Name: "bar", Value: "baz"}}, Samples: []mimirpb.Sample{{TimestampMs: 1_000, Value: 201}}}, }, }, Headers: expectedRespHeaders, @@ -128,8 +129,8 @@ func TestPrometheusCodec_JSONResponse_Metrics(t *testing.T) { Data: &PrometheusData{ ResultType: model.ValMatrix.String(), Result: []SampleStream{ - {Labels: []mimirpb.LabelAdapter{{Name: "foo", Value: "bar"}}, Samples: []mimirpb.Sample{{TimestampMs: 1_000, Value: 100}, {TimestampMs: 2_000, Value: 200}}}, - {Labels: []mimirpb.LabelAdapter{{Name: "bar", Value: "baz"}}, Samples: []mimirpb.Sample{{TimestampMs: 1_000, Value: 101}, {TimestampMs: 2_000, Value: 201}}}, + {Labels: []mimirpb_custom.LabelAdapter{{Name: "foo", Value: "bar"}}, Samples: []mimirpb.Sample{{TimestampMs: 1_000, Value: 100}, {TimestampMs: 2_000, Value: 200}}}, + {Labels: []mimirpb_custom.LabelAdapter{{Name: "bar", Value: "baz"}}, Samples: []mimirpb.Sample{{TimestampMs: 1_000, Value: 101}, {TimestampMs: 2_000, Value: 201}}}, }, }, Headers: expectedRespHeaders, @@ -376,7 +377,7 @@ func TestPrometheusCodec_JSONEncoding_Metrics(t *testing.T) { Data: &PrometheusData{ ResultType: model.ValMatrix.String(), Result: []SampleStream{ - {Labels: []mimirpb.LabelAdapter{{Name: "foo", Value: "bar"}}, Histograms: []mimirpb.FloatHistogramPair{{TimestampMs: 1_234, Histogram: &responseHistogram}}}, + {Labels: []mimirpb_custom.LabelAdapter{{Name: "foo", Value: "bar"}}, Histograms: []mimirpb.FloatHistogramPair{{TimestampMs: 1_234, Histogram: &responseHistogram}}}, }, }, }, @@ -421,7 +422,7 @@ func TestPrometheusCodec_JSONEncoding_Metrics(t *testing.T) { ResultType: model.ValMatrix.String(), Result: []SampleStream{ { - Labels: []mimirpb.LabelAdapter{{Name: "foo", Value: "bar"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "foo", Value: "bar"}}, Samples: []mimirpb.Sample{{TimestampMs: 1_000, Value: 101}, {TimestampMs: 2_000, Value: 201}}, Histograms: []mimirpb.FloatHistogramPair{{TimestampMs: 3_000, Histogram: &responseHistogram}}}, }, diff --git a/pkg/frontend/querymiddleware/codec_protobuf.go b/pkg/frontend/querymiddleware/codec_protobuf.go index f984f6cef2..6d3739046a 100644 --- a/pkg/frontend/querymiddleware/codec_protobuf.go +++ b/pkg/frontend/querymiddleware/codec_protobuf.go @@ -10,6 +10,7 @@ import ( v1 "github.com/prometheus/prometheus/web/api/v1" "github.com/grafana/mimir/pkg/mimirpb" + "github.com/grafana/mimir/pkg/mimirpb_custom" ) type protobufFormatter struct{} @@ -246,7 +247,7 @@ func (f protobufFormatter) decodeStringData(data *mimirpb.StringData) *Prometheu ResultType: model.ValString.String(), Result: []SampleStream{ { - Labels: []mimirpb.LabelAdapter{{Name: "value", Value: data.Value}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "value", Value: data.Value}}, Samples: []mimirpb.Sample{{TimestampMs: data.TimestampMs}}, }, }, @@ -342,16 +343,16 @@ func (f protobufFormatter) DecodeSeriesResponse([]byte) (*PrometheusSeriesRespon return nil, errors.New("protobuf series decoding is not supported") } -func labelsFromStringArray(s []string) ([]mimirpb.LabelAdapter, error) { +func labelsFromStringArray(s []string) ([]mimirpb_custom.LabelAdapter, error) { if len(s)%2 != 0 { return nil, fmt.Errorf("metric is malformed: expected even number of symbols, but got %v", len(s)) } labelCount := len(s) / 2 - l := make([]mimirpb.LabelAdapter, labelCount) + l := make([]mimirpb_custom.LabelAdapter, labelCount) for i := 0; i < labelCount; i++ { - l[i] = mimirpb.LabelAdapter{ + l[i] = mimirpb_custom.LabelAdapter{ Name: s[2*i], Value: s[2*i+1], } @@ -360,7 +361,7 @@ func labelsFromStringArray(s []string) ([]mimirpb.LabelAdapter, error) { return l, nil } -func stringArrayFromLabels(labels []mimirpb.LabelAdapter) []string { +func stringArrayFromLabels(labels []mimirpb_custom.LabelAdapter) []string { s := make([]string, len(labels)*2) for i, l := range labels { diff --git a/pkg/frontend/querymiddleware/codec_protobuf_test.go b/pkg/frontend/querymiddleware/codec_protobuf_test.go index 16a6108382..1e1470c667 100644 --- a/pkg/frontend/querymiddleware/codec_protobuf_test.go +++ b/pkg/frontend/querymiddleware/codec_protobuf_test.go @@ -19,6 +19,7 @@ import ( apierror "github.com/grafana/mimir/pkg/api/error" "github.com/grafana/mimir/pkg/mimirpb" + "github.com/grafana/mimir/pkg/mimirpb_custom" ) var expectedProtobufResponseHeaders = []*PrometheusHeader{ @@ -86,7 +87,7 @@ var protobufCodecScenarios = []struct { ResultType: model.ValString.String(), Result: []SampleStream{ { - Labels: []mimirpb.LabelAdapter{{Name: "value", Value: "foo"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "value", Value: "foo"}}, Samples: []mimirpb.Sample{{TimestampMs: 1_500}}, }, }, @@ -150,7 +151,7 @@ var protobufCodecScenarios = []struct { Data: &PrometheusData{ ResultType: model.ValVector.String(), Result: []SampleStream{ - {Labels: []mimirpb.LabelAdapter{}, Samples: []mimirpb.Sample{{TimestampMs: 1_000, Value: 200}}}, + {Labels: []mimirpb_custom.LabelAdapter{}, Samples: []mimirpb.Sample{{TimestampMs: 1_000, Value: 200}}}, }, }, Headers: expectedProtobufResponseHeaders, @@ -173,7 +174,7 @@ var protobufCodecScenarios = []struct { Data: &PrometheusData{ ResultType: model.ValVector.String(), Result: []SampleStream{ - {Labels: []mimirpb.LabelAdapter{{Name: "foo", Value: "bar"}}, Samples: []mimirpb.Sample{{TimestampMs: 1_000, Value: 200}}}, + {Labels: []mimirpb_custom.LabelAdapter{{Name: "foo", Value: "bar"}}, Samples: []mimirpb.Sample{{TimestampMs: 1_000, Value: 200}}}, }, }, Headers: expectedProtobufResponseHeaders, @@ -197,7 +198,7 @@ var protobufCodecScenarios = []struct { ResultType: model.ValVector.String(), Result: []SampleStream{ { - Labels: []mimirpb.LabelAdapter{ + Labels: []mimirpb_custom.LabelAdapter{ {Name: "foo", Value: "bar"}, {Name: "baz", Value: "blah"}, }, @@ -226,8 +227,8 @@ var protobufCodecScenarios = []struct { Data: &PrometheusData{ ResultType: model.ValVector.String(), Result: []SampleStream{ - {Labels: []mimirpb.LabelAdapter{{Name: "foo", Value: "bar"}}, Samples: []mimirpb.Sample{{TimestampMs: 1_000, Value: 200}}}, - {Labels: []mimirpb.LabelAdapter{{Name: "bar", Value: "baz"}}, Samples: []mimirpb.Sample{{TimestampMs: 1_000, Value: 201}}}, + {Labels: []mimirpb_custom.LabelAdapter{{Name: "foo", Value: "bar"}}, Samples: []mimirpb.Sample{{TimestampMs: 1_000, Value: 200}}}, + {Labels: []mimirpb_custom.LabelAdapter{{Name: "bar", Value: "baz"}}, Samples: []mimirpb.Sample{{TimestampMs: 1_000, Value: 201}}}, }, }, Headers: expectedProtobufResponseHeaders, @@ -255,7 +256,7 @@ var protobufCodecScenarios = []struct { ResultType: model.ValVector.String(), Result: []SampleStream{ { - Labels: []mimirpb.LabelAdapter{{Name: "name-1", Value: "value-1"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "name-1", Value: "value-1"}}, Histograms: []mimirpb.FloatHistogramPair{{TimestampMs: 1234, Histogram: &protobufResponseHistogram}}, }, }, @@ -293,15 +294,15 @@ var protobufCodecScenarios = []struct { ResultType: model.ValVector.String(), Result: []SampleStream{ { - Labels: []mimirpb.LabelAdapter{{Name: "foo", Value: "bar"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "foo", Value: "bar"}}, Samples: []mimirpb.Sample{{TimestampMs: 1000, Value: 200}}, }, { - Labels: []mimirpb.LabelAdapter{{Name: "baz", Value: "blah"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "baz", Value: "blah"}}, Histograms: []mimirpb.FloatHistogramPair{{TimestampMs: 1234, Histogram: &protobufResponseHistogram}}, }, { - Labels: []mimirpb.LabelAdapter{{Name: "baz2", Value: "blah2"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "baz2", Value: "blah2"}}, Histograms: []mimirpb.FloatHistogramPair{{TimestampMs: 1234, Histogram: &protobufResponseHistogram2}}, }, }, @@ -357,7 +358,7 @@ var protobufCodecScenarios = []struct { Data: &PrometheusData{ ResultType: model.ValMatrix.String(), Result: []SampleStream{ - {Labels: []mimirpb.LabelAdapter{}}, + {Labels: []mimirpb_custom.LabelAdapter{}}, }, }, Headers: expectedProtobufResponseHeaders, @@ -380,7 +381,7 @@ var protobufCodecScenarios = []struct { Data: &PrometheusData{ ResultType: model.ValMatrix.String(), Result: []SampleStream{ - {Labels: []mimirpb.LabelAdapter{{Name: "foo", Value: "bar"}}}, + {Labels: []mimirpb_custom.LabelAdapter{{Name: "foo", Value: "bar"}}}, }, }, Headers: expectedProtobufResponseHeaders, @@ -404,7 +405,7 @@ var protobufCodecScenarios = []struct { ResultType: model.ValMatrix.String(), Result: []SampleStream{ { - Labels: []mimirpb.LabelAdapter{ + Labels: []mimirpb_custom.LabelAdapter{ {Name: "foo", Value: "bar"}, {Name: "baz", Value: "blah"}, }, @@ -437,7 +438,7 @@ var protobufCodecScenarios = []struct { ResultType: model.ValMatrix.String(), Result: []SampleStream{ { - Labels: []mimirpb.LabelAdapter{ + Labels: []mimirpb_custom.LabelAdapter{ {Name: "foo", Value: "bar"}, {Name: "baz", Value: "blah"}, }, @@ -474,7 +475,7 @@ var protobufCodecScenarios = []struct { ResultType: model.ValMatrix.String(), Result: []SampleStream{ { - Labels: []mimirpb.LabelAdapter{ + Labels: []mimirpb_custom.LabelAdapter{ {Name: "foo", Value: "bar"}, {Name: "baz", Value: "blah"}, }, @@ -507,11 +508,11 @@ var protobufCodecScenarios = []struct { ResultType: model.ValMatrix.String(), Result: []SampleStream{ { - Labels: []mimirpb.LabelAdapter{{Name: "foo", Value: "bar"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "foo", Value: "bar"}}, Samples: []mimirpb.Sample{{TimestampMs: 1_000, Value: 100}, {TimestampMs: 2_000, Value: 200}}, }, { - Labels: []mimirpb.LabelAdapter{{Name: "bar", Value: "baz"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "bar", Value: "baz"}}, Samples: []mimirpb.Sample{{TimestampMs: 1_000, Value: 101}, {TimestampMs: 2_000, Value: 201}}, }, }, @@ -540,7 +541,7 @@ var protobufCodecScenarios = []struct { ResultType: model.ValMatrix.String(), Result: []SampleStream{ { - Labels: []mimirpb.LabelAdapter{{Name: "name-1", Value: "value-1"}, {Name: "name-2", Value: "value-2"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "name-1", Value: "value-1"}, {Name: "name-2", Value: "value-2"}}, Histograms: []mimirpb.FloatHistogramPair{{TimestampMs: 1234, Histogram: &protobufResponseHistogram}}, }, }, @@ -570,7 +571,7 @@ var protobufCodecScenarios = []struct { ResultType: model.ValMatrix.String(), Result: []SampleStream{ { - Labels: []mimirpb.LabelAdapter{{Name: "name-1", Value: "value-1"}, {Name: "name-2", Value: "value-2"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "name-1", Value: "value-1"}, {Name: "name-2", Value: "value-2"}}, Samples: []mimirpb.Sample{{TimestampMs: 1000, Value: 200}}, Histograms: []mimirpb.FloatHistogramPair{{TimestampMs: 1234, Histogram: &protobufResponseHistogram}}, }, diff --git a/pkg/frontend/querymiddleware/codec_test.go b/pkg/frontend/querymiddleware/codec_test.go index 6d2b768625..4339efda8d 100644 --- a/pkg/frontend/querymiddleware/codec_test.go +++ b/pkg/frontend/querymiddleware/codec_test.go @@ -34,6 +34,7 @@ import ( apierror "github.com/grafana/mimir/pkg/api/error" "github.com/grafana/mimir/pkg/mimirpb" + "github.com/grafana/mimir/pkg/mimirpb_custom" "github.com/grafana/mimir/pkg/querier/api" "github.com/grafana/mimir/pkg/streamingpromql/compat" "github.com/grafana/mimir/pkg/util/chunkinfologger" @@ -1120,7 +1121,7 @@ func TestMergeAPIResponses(t *testing.T) { ResultType: matrix, Result: []SampleStream{ { - Labels: []mimirpb.LabelAdapter{}, + Labels: []mimirpb_custom.LabelAdapter{}, Samples: []mimirpb.Sample{ {Value: 0, TimestampMs: 0}, {Value: 1, TimestampMs: 1}, @@ -1135,7 +1136,7 @@ func TestMergeAPIResponses(t *testing.T) { ResultType: matrix, Result: []SampleStream{ { - Labels: []mimirpb.LabelAdapter{}, + Labels: []mimirpb_custom.LabelAdapter{}, Samples: []mimirpb.Sample{ {Value: 2, TimestampMs: 2}, {Value: 3, TimestampMs: 3}, @@ -1151,7 +1152,7 @@ func TestMergeAPIResponses(t *testing.T) { ResultType: matrix, Result: []SampleStream{ { - Labels: []mimirpb.LabelAdapter{}, + Labels: []mimirpb_custom.LabelAdapter{}, Samples: []mimirpb.Sample{ {Value: 0, TimestampMs: 0}, {Value: 1, TimestampMs: 1}, @@ -1176,7 +1177,7 @@ func TestMergeAPIResponses(t *testing.T) { ResultType: matrix, Result: []SampleStream{ { - Labels: []mimirpb.LabelAdapter{{Name: "a", Value: "b"}, {Name: "c", Value: "d"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "a", Value: "b"}, {Name: "c", Value: "d"}}, Samples: []mimirpb.Sample{ {Value: 0, TimestampMs: 0}, {Value: 1, TimestampMs: 1000}, @@ -1201,7 +1202,7 @@ func TestMergeAPIResponses(t *testing.T) { ResultType: matrix, Result: []SampleStream{ { - Labels: []mimirpb.LabelAdapter{{Name: "a", Value: "b"}, {Name: "c", Value: "d"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "a", Value: "b"}, {Name: "c", Value: "d"}}, Samples: []mimirpb.Sample{ {Value: 1, TimestampMs: 1000}, {Value: 2, TimestampMs: 2000}, @@ -1224,7 +1225,7 @@ func TestMergeAPIResponses(t *testing.T) { ResultType: matrix, Result: []SampleStream{ { - Labels: []mimirpb.LabelAdapter{{Name: "a", Value: "b"}, {Name: "c", Value: "d"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "a", Value: "b"}, {Name: "c", Value: "d"}}, Samples: []mimirpb.Sample{ {Value: 1, TimestampMs: 1000}, {Value: 2, TimestampMs: 2000}, @@ -1249,7 +1250,7 @@ func TestMergeAPIResponses(t *testing.T) { ResultType: matrix, Result: []SampleStream{ { - Labels: []mimirpb.LabelAdapter{{Name: "a", Value: "b"}, {Name: "c", Value: "d"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "a", Value: "b"}, {Name: "c", Value: "d"}}, Samples: []mimirpb.Sample{ {Value: 2, TimestampMs: 2000}, {Value: 3, TimestampMs: 3000}, @@ -1271,7 +1272,7 @@ func TestMergeAPIResponses(t *testing.T) { ResultType: matrix, Result: []SampleStream{ { - Labels: []mimirpb.LabelAdapter{{Name: "a", Value: "b"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "a", Value: "b"}}, Histograms: []mimirpb.FloatHistogramPair{ {TimestampMs: 1000, Histogram: &histogram1}, }, @@ -1286,7 +1287,7 @@ func TestMergeAPIResponses(t *testing.T) { ResultType: matrix, Result: []SampleStream{ { - Labels: []mimirpb.LabelAdapter{{Name: "a", Value: "b"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "a", Value: "b"}}, Histograms: []mimirpb.FloatHistogramPair{ { TimestampMs: 1000, @@ -1308,7 +1309,7 @@ func TestMergeAPIResponses(t *testing.T) { ResultType: matrix, Result: []SampleStream{ { - Labels: []mimirpb.LabelAdapter{{Name: "a", Value: "b"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "a", Value: "b"}}, Histograms: []mimirpb.FloatHistogramPair{ {TimestampMs: 1000, Histogram: &histogram1}, }, @@ -1322,7 +1323,7 @@ func TestMergeAPIResponses(t *testing.T) { ResultType: matrix, Result: []SampleStream{ { - Labels: []mimirpb.LabelAdapter{{Name: "a", Value: "b"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "a", Value: "b"}}, Histograms: []mimirpb.FloatHistogramPair{ {TimestampMs: 2000, Histogram: &histogram2}, }, @@ -1337,7 +1338,7 @@ func TestMergeAPIResponses(t *testing.T) { ResultType: matrix, Result: []SampleStream{ { - Labels: []mimirpb.LabelAdapter{{Name: "a", Value: "b"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "a", Value: "b"}}, Histograms: []mimirpb.FloatHistogramPair{ {TimestampMs: 1000, Histogram: &histogram1}, {TimestampMs: 2000, Histogram: &histogram2}, @@ -1357,7 +1358,7 @@ func TestMergeAPIResponses(t *testing.T) { ResultType: matrix, Result: []SampleStream{ { - Labels: []mimirpb.LabelAdapter{}, + Labels: []mimirpb_custom.LabelAdapter{}, Samples: []mimirpb.Sample{ {Value: 0, TimestampMs: 0}, {Value: 1, TimestampMs: 1}, @@ -1373,7 +1374,7 @@ func TestMergeAPIResponses(t *testing.T) { ResultType: matrix, Result: []SampleStream{ { - Labels: []mimirpb.LabelAdapter{}, + Labels: []mimirpb_custom.LabelAdapter{}, Samples: []mimirpb.Sample{ {Value: 2, TimestampMs: 2}, {Value: 3, TimestampMs: 3}, @@ -1390,7 +1391,7 @@ func TestMergeAPIResponses(t *testing.T) { ResultType: matrix, Result: []SampleStream{ { - Labels: []mimirpb.LabelAdapter{}, + Labels: []mimirpb_custom.LabelAdapter{}, Samples: []mimirpb.Sample{ {Value: 0, TimestampMs: 0}, {Value: 1, TimestampMs: 1}, @@ -1528,7 +1529,7 @@ func mockPrometheusResponse(numSeries, numSamplesPerSeries int) *PrometheusRespo } // Generate random labels. - lbls := make([]mimirpb.LabelAdapter, 10) + lbls := make([]mimirpb_custom.LabelAdapter, 10) for i := range lbls { lbls[i].Name = "a_medium_size_label_name" lbls[i].Value = "a_medium_size_label_value_that_is_used_to_benchmark_marshalling" @@ -1549,7 +1550,7 @@ func mockPrometheusResponse(numSeries, numSamplesPerSeries int) *PrometheusRespo } } -func mockPrometheusResponseSingleSeries(series []mimirpb.LabelAdapter, samples ...mimirpb.Sample) *PrometheusResponse { +func mockPrometheusResponseSingleSeries(series []mimirpb_custom.LabelAdapter, samples ...mimirpb.Sample) *PrometheusResponse { return &PrometheusResponse{ Status: "success", Data: &PrometheusData{ @@ -1564,7 +1565,7 @@ func mockPrometheusResponseSingleSeries(series []mimirpb.LabelAdapter, samples . } } -func mockPrometheusResponseWithSamplesAndHistograms(labels []mimirpb.LabelAdapter, samples []mimirpb.Sample, histograms []mimirpb.FloatHistogramPair) *PrometheusResponse { +func mockPrometheusResponseWithSamplesAndHistograms(labels []mimirpb_custom.LabelAdapter, samples []mimirpb.Sample, histograms []mimirpb.FloatHistogramPair) *PrometheusResponse { return &PrometheusResponse{ Status: "success", Data: &PrometheusData{ diff --git a/pkg/frontend/querymiddleware/model.pb.go b/pkg/frontend/querymiddleware/model.pb.go index 47f80838c3..671fbf1857 100644 --- a/pkg/frontend/querymiddleware/model.pb.go +++ b/pkg/frontend/querymiddleware/model.pb.go @@ -11,8 +11,9 @@ import ( _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" types "github.com/gogo/protobuf/types" - github_com_grafana_mimir_pkg_mimirpb "github.com/grafana/mimir/pkg/mimirpb" mimirpb "github.com/grafana/mimir/pkg/mimirpb" + _ "github.com/grafana/mimir/pkg/mimirpb_custom" + github_com_grafana_mimir_pkg_mimirpb_custom "github.com/grafana/mimir/pkg/mimirpb_custom" io "io" math "math" math_bits "math/bits" @@ -225,9 +226,9 @@ func (m *PrometheusData) GetResult() []SampleStream { } type SampleStream struct { - Labels []github_com_grafana_mimir_pkg_mimirpb.LabelAdapter `protobuf:"bytes,1,rep,name=labels,proto3,customtype=github.com/grafana/mimir/pkg/mimirpb.LabelAdapter" json:"metric"` - Samples []mimirpb.Sample `protobuf:"bytes,2,rep,name=samples,proto3" json:"values"` - Histograms []mimirpb.FloatHistogramPair `protobuf:"bytes,3,rep,name=histograms,proto3" json:"histograms"` + Labels []github_com_grafana_mimir_pkg_mimirpb_custom.LabelAdapter `protobuf:"bytes,1,rep,name=labels,proto3,customtype=github.com/grafana/mimir/pkg/mimirpb_custom.LabelAdapter" json:"metric"` + Samples []mimirpb.Sample `protobuf:"bytes,2,rep,name=samples,proto3" json:"values"` + Histograms []mimirpb.FloatHistogramPair `protobuf:"bytes,3,rep,name=histograms,proto3" json:"histograms"` } func (m *SampleStream) Reset() { *m = SampleStream{} } @@ -726,74 +727,75 @@ func init() { func init() { proto.RegisterFile("model.proto", fileDescriptor_4c16552f9fdb66d8) } var fileDescriptor_4c16552f9fdb66d8 = []byte{ - // 1061 bytes of a gzipped FileDescriptorProto - 0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02, 0x59, 0xd0, 0xd1, 0x5f, 0x89, 0xd3, 0x09, 0x73, 0xf4, 0x83, 0xa8, 0x63, 0xd0, - 0xd0, 0x3e, 0x73, 0x28, 0xfa, 0x08, 0x9a, 0xb3, 0x74, 0x1c, 0x57, 0x5f, 0x1e, 0xc7, 0xc5, 0x76, - 0x7a, 0xfe, 0xe2, 0x8c, 0x8c, 0x10, 0xd4, 0xc6, 0xcc, 0x59, 0xa8, 0x5a, 0xad, 0x62, 0xb5, 0xb6, - 0x3f, 0x81, 0xee, 0x8b, 0x82, 0x84, 0x17, 0xe4, 0x5f, 0x42, 0xac, 0xd6, 0x68, 0x13, 0xea, 0x6a, - 0x66, 0xe8, 0xf7, 0x89, 0xb5, 0x31, 0x3c, 0x38, 0xbf, 0x30, 0x2b, 0x4f, 0x2f, 0xcc, 0xca, 0xf3, - 0x0b, 0xd3, 0xf8, 0x69, 0x69, 0x1a, 0x7f, 0x2c, 0x4d, 0xe3, 0xc9, 0xd2, 0x34, 0xce, 0x97, 0xa6, - 0xf1, 0xe7, 0xd2, 0x34, 0xfe, 0x5e, 0x9a, 0x95, 0xe7, 0x4b, 0xd3, 0xf8, 0xed, 0xd2, 0xac, 0x9c, - 0x5f, 0x9a, 0x95, 0xa7, 0x97, 0x66, 0xe5, 0xfb, 0x75, 0x95, 0xad, 0xef, 0x3a, 0x8e, 0x47, 0x1f, - 0x11, 0x4e, 0xc7, 0x0d, 0xd5, 0xae, 0xef, 0xff, 0x1b, 0x00, 0x00, 0xff, 0xff, 0x4a, 0x48, 0x21, - 0x5e, 0x2c, 0x08, 0x00, 0x00, + // 1083 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x55, 0x4f, 0x6f, 0x1b, 0x45, + 0x14, 0xf7, 0xc6, 0xff, 0x9f, 0xd3, 0xc4, 0x9a, 0x46, 0xe0, 0x04, 0xba, 0x6b, 0xad, 0x38, 0x04,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0x7c, 0x41, 0x7c, 0xda, 0x31, 0xba, 0xc6, 0x76, 0xb3, + 0x5f, 0x8d, 0x23, 0xcb, 0xb8, 0x85, 0x15, 0x84, 0x6e, 0x40, 0xed, 0x6b, 0xe2, 0xcd, 0xa8, 0xe8, + 0xac, 0x74, 0xcb, 0x4b, 0x65, 0x0a, 0xda, 0x7f, 0xaf, 0x00, 0x5a, 0xba, 0xc3, 0x54, 0x84, 0x2c, + 0x10, 0x14, 0xd9, 0x50, 0x1b, 0x48, 0x22, 0x67, 0x22, 0x75, 0x09, 0x71, 0x64, 0xd5, 0x84, 0x42, + 0x70, 0xaa, 0x41, 0x7d, 0xa8, 0xec, 0x13, 0x49, 0x3a, 0x2b, 0x5d, 0x63, 0xbb, 0xb5, 0xbb, 0xd5, + 0x5b, 0x56, 0xb9, 0xb7, 0xf4, 0x98, 0x30, 0xfa, 0x28, 0x8e, 0xac, 0x35, 0x87, 0x48, 0x72, 0x93, + 0xf9, 0xae, 0xa4, 0x7e, 0x28, 0xe7, 0x58, 0xd9, 0xa2, 0xf7, 0xa1, 0x79, 0xc0, 0x39, 0xe3, 0x27, + 0xf3, 0x90, 0x76, 0xca, 0xea, 0xaa, 0x57, 0xe3, 0xc8, 0xba, 0x4e, 0x33, 0xb0, 0x60, 0xb1, 0x64, + 0xa2, 0x37, 0xa1, 0xaa, 0x84, 0x4e, 0x45, 0x99, 0x5c, 0x8f, 0x23, 0x6b, 0x5d, 0x99, 0x14, 0xe8, + 0x9a, 0x81, 0x6e, 0x43, 0x5d, 0x17, 0x49, 0x74, 0xaa, 0xdd, 0xf2, 0x76, 0x6b, 0xf7, 0xf5, 0xab, + 0x03, 0xd5, 0xa4, 0xac, 0x3c, 0x99, 0x0d, 0xda, 0x85, 0xc6, 0x37, 0x84, 0x07, 0x6e, 0x30, 0x11, + 0x9d, 0x9a, 0x2a, 0xe0, 0x2b, 0x71, 0x64, 0xa1, 0x47, 0x29, 0x56, 0xb8, 0x2f, 0xe7, 0x25, 0x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a8, 0x62, 0xd0, 0xd0, 0x1e, 0x73, 0x28, 0xfa, 0x00, 0xea, 0xd3, 0x74, 0x41, + 0x97, 0x5f, 0x5e, 0xd0, 0xcb, 0xeb, 0xf4, 0x46, 0xc6, 0x19, 0x19, 0x21, 0xa8, 0x8c, 0x98, 0x33, + 0x57, 0xb5, 0x5a, 0xc5, 0xea, 0x6c, 0x7f, 0x0c, 0xed, 0x17, 0x0d, 0x12, 0x5e, 0x90, 0x7f, 0x1b, + 0xb1, 0x3a, 0xa3, 0x0d, 0xa8, 0xaa, 0x9d, 0xa1, 0xe7, 0x13, 0x6b, 0xa1, 0x7f, 0x70, 0x76, 0x6e, + 0x96, 0x9e, 0x9e, 0x9b, 0xa5, 0xe7, 0xe7, 0xa6, 0xf1, 0xc3, 0xc2, 0x34, 0x7e, 0x5f, 0x98, 0xc6, + 0x93, 0x85, 0x69, 0x9c, 0x2d, 0x4c, 0xe3, 0x8f, 0x85, 0x69, 0xfc, 0xb5, 0x30, 0x4b, 0xcf, 0x17, + 0xa6, 0xf1, 0xcb, 0x85, 0x59, 0x3a, 0xbb, 0x30, 0x4b, 0x4f, 0x2f, 0xcc, 0xd2, 0xb7, 0xeb, 0x2a, + 0x5a, 0xdf, 0x75, 0x1c, 0x8f, 0x3e, 0x22, 0x9c, 0x8e, 0x6a, 0xaa, 0x5d, 0xdf, 0xfd, 0x27, 0x00, + 0x00, 0xff, 0xff, 0x3c, 0x34, 0x8a, 0x03, 0x84, 0x08, 0x00, 0x00, } func (this *PrometheusHeader) Equal(that interface{}) bool { @@ -2945,7 +2947,7 @@ func (m *SampleStream) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Labels = append(m.Labels, github_com_grafana_mimir_pkg_mimirpb.LabelAdapter{}) + m.Labels = append(m.Labels, github_com_grafana_mimir_pkg_mimirpb_custom.LabelAdapter{}) if err := m.Labels[len(m.Labels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/pkg/frontend/querymiddleware/model.proto b/pkg/frontend/querymiddleware/model.proto index 0a4951cfcd..af3cc7a23f 100644 --- a/pkg/frontend/querymiddleware/model.proto +++ b/pkg/frontend/querymiddleware/model.proto @@ -12,6 +12,7 @@ option go_package = "querymiddleware"; import "github.com/gogo/protobuf/gogoproto/gogo.proto"; import "github.com/grafana/mimir/pkg/mimirpb/mimir.proto"; +import "github.com/grafana/mimir/pkg/mimirpb_custom/mimir_custom_types.proto"; import "google/protobuf/any.proto"; option (gogoproto.marshaler_all) = true; @@ -38,7 +39,7 @@ message PrometheusData { } message SampleStream { - repeated cortexpb.LabelPair labels = 1 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "metric", (gogoproto.customtype) = "github.com/grafana/mimir/pkg/mimirpb.LabelAdapter"]; + repeated cortexpb_custom.LabelAdapter labels = 1 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "metric", (gogoproto.customtype) = "github.com/grafana/mimir/pkg/mimirpb_custom.LabelAdapter"]; repeated cortexpb.Sample samples = 2 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "values"]; repeated cortexpb.FloatHistogramPair histograms = 3 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "histograms"]; } diff --git a/pkg/frontend/querymiddleware/model_extra.go b/pkg/frontend/querymiddleware/model_extra.go index 9cf0764833..e9b9b58542 100644 --- a/pkg/frontend/querymiddleware/model_extra.go +++ b/pkg/frontend/querymiddleware/model_extra.go @@ -24,6 +24,7 @@ import ( v1 "github.com/prometheus/prometheus/web/api/v1" "github.com/grafana/mimir/pkg/mimirpb" + "github.com/grafana/mimir/pkg/mimirpb_custom" ) var ( @@ -873,7 +874,7 @@ func (sss *stringSampleStreams) UnmarshalJSON(b []byte) error { return err } *sss = []SampleStream{{ - Labels: []mimirpb.LabelAdapter{{Name: "value", Value: sv.Value}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "value", Value: sv.Value}}, Samples: []mimirpb.Sample{{TimestampMs: int64(sv.Timestamp)}}, }} return nil diff --git a/pkg/frontend/querymiddleware/querysharding.go b/pkg/frontend/querymiddleware/querysharding.go index 7fede857cb..5694b84c0d 100644 --- a/pkg/frontend/querymiddleware/querysharding.go +++ b/pkg/frontend/querymiddleware/querysharding.go @@ -27,6 +27,7 @@ import ( apierror "github.com/grafana/mimir/pkg/api/error" "github.com/grafana/mimir/pkg/frontend/querymiddleware/astmapper" "github.com/grafana/mimir/pkg/mimirpb" + "github.com/grafana/mimir/pkg/mimirpb_custom" "github.com/grafana/mimir/pkg/querier/stats" "github.com/grafana/mimir/pkg/storage/lazyquery" "github.com/grafana/mimir/pkg/util" @@ -439,7 +440,7 @@ func promqlResultToSamples(res *promql.Result) ([]SampleStream, error) { case promql.String: return []SampleStream{ { - Labels: []mimirpb.LabelAdapter{{Name: "value", Value: v.V}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "value", Value: v.V}}, Samples: []mimirpb.Sample{{TimestampMs: v.T}}, }, }, nil diff --git a/pkg/frontend/querymiddleware/querysharding_test.go b/pkg/frontend/querymiddleware/querysharding_test.go index 7b453d2b7a..6975f44396 100644 --- a/pkg/frontend/querymiddleware/querysharding_test.go +++ b/pkg/frontend/querymiddleware/querysharding_test.go @@ -40,6 +40,7 @@ import ( apierror "github.com/grafana/mimir/pkg/api/error" "github.com/grafana/mimir/pkg/frontend/querymiddleware/astmapper" "github.com/grafana/mimir/pkg/mimirpb" + "github.com/grafana/mimir/pkg/mimirpb_custom" "github.com/grafana/mimir/pkg/querier" "github.com/grafana/mimir/pkg/storage/sharding" "github.com/grafana/mimir/pkg/util" @@ -113,7 +114,7 @@ func approximatelyEquals(t *testing.T, a, b *PrometheusResponse) { require.ElementsMatch(t, a.Warnings, b.Warnings, "expected same warning annotations") } -func compareExpectedAndActual(t *testing.T, expectedTs, actualTs int64, expectedVal, actualVal float64, j int, labels []mimirpb.LabelAdapter, sampleType string, tolerance float64) { +func compareExpectedAndActual(t *testing.T, expectedTs, actualTs int64, expectedVal, actualVal float64, j int, labels []mimirpb_custom.LabelAdapter, sampleType string, tolerance float64) { require.Equalf(t, expectedTs, actualTs, "%s timestamp at position %d for series %s", sampleType, j, labels) if value.IsStaleNaN(expectedVal) { @@ -2034,7 +2035,7 @@ func TestPromqlResultToSampleStreams(t *testing.T) { input: &promql.Result{Value: promql.String{T: 1, V: "hi"}}, expected: []SampleStream{ { - Labels: []mimirpb.LabelAdapter{ + Labels: []mimirpb_custom.LabelAdapter{ { Name: "value", Value: "hi", @@ -2082,7 +2083,7 @@ func TestPromqlResultToSampleStreams(t *testing.T) { err: false, expected: []SampleStream{ { - Labels: []mimirpb.LabelAdapter{ + Labels: []mimirpb_custom.LabelAdapter{ {Name: "a", Value: "a1"}, {Name: "b", Value: "b1"}, }, @@ -2094,7 +2095,7 @@ func TestPromqlResultToSampleStreams(t *testing.T) { }, }, { - Labels: []mimirpb.LabelAdapter{ + Labels: []mimirpb_custom.LabelAdapter{ {Name: "a", Value: "a2"}, {Name: "b", Value: "b2"}, }, @@ -2130,7 +2131,7 @@ func TestPromqlResultToSampleStreams(t *testing.T) { err: false, expected: []SampleStream{ { - Labels: []mimirpb.LabelAdapter{ + Labels: []mimirpb_custom.LabelAdapter{ {Name: "a", Value: "a1"}, {Name: "b", Value: "b1"}, }, @@ -2146,7 +2147,7 @@ func TestPromqlResultToSampleStreams(t *testing.T) { }, }, { - Labels: []mimirpb.LabelAdapter{ + Labels: []mimirpb_custom.LabelAdapter{ {Name: "a", Value: "a2"}, {Name: "b", Value: "b2"}, }, diff --git a/pkg/frontend/querymiddleware/results_cache_test.go b/pkg/frontend/querymiddleware/results_cache_test.go index 0258062766..08278db778 100644 --- a/pkg/frontend/querymiddleware/results_cache_test.go +++ b/pkg/frontend/querymiddleware/results_cache_test.go @@ -20,6 +20,7 @@ import ( "github.com/stretchr/testify/require" "github.com/grafana/mimir/pkg/mimirpb" + "github.com/grafana/mimir/pkg/mimirpb_custom" ) func TestResultsCacheConfig_Validate(t *testing.T) { @@ -97,7 +98,7 @@ func mkAPIResponse(start, end, step int64) *PrometheusResponse { ResultType: matrix, Result: []SampleStream{ { - Labels: []mimirpb.LabelAdapter{ + Labels: []mimirpb_custom.LabelAdapter{ {Name: "foo", Value: "bar"}, }, Samples: samples, diff --git a/pkg/frontend/querymiddleware/roundtrip_test.go b/pkg/frontend/querymiddleware/roundtrip_test.go index 0e829478ae..2253726dd1 100644 --- a/pkg/frontend/querymiddleware/roundtrip_test.go +++ b/pkg/frontend/querymiddleware/roundtrip_test.go @@ -39,6 +39,7 @@ import ( apierror "github.com/grafana/mimir/pkg/api/error" "github.com/grafana/mimir/pkg/mimirpb" + "github.com/grafana/mimir/pkg/mimirpb_custom" querierapi "github.com/grafana/mimir/pkg/querier/api" "github.com/grafana/mimir/pkg/storage/ingest" "github.com/grafana/mimir/pkg/util/testkafka" @@ -161,7 +162,7 @@ func TestTripperware_InstantQuery(t *testing.T) { ResultType: "vector", Result: []SampleStream{ { - Labels: []mimirpb.LabelAdapter{{Name: "foo", Value: "bar"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "foo", Value: "bar"}}, Samples: []mimirpb.Sample{ {TimestampMs: int64(reqTime * 1000), Value: 1}, }, diff --git a/pkg/frontend/querymiddleware/sharded_queryable_test.go b/pkg/frontend/querymiddleware/sharded_queryable_test.go index cd05e6949e..9b247eea42 100644 --- a/pkg/frontend/querymiddleware/sharded_queryable_test.go +++ b/pkg/frontend/querymiddleware/sharded_queryable_test.go @@ -23,6 +23,7 @@ import ( "github.com/grafana/mimir/pkg/frontend/querymiddleware/astmapper" "github.com/grafana/mimir/pkg/mimirpb" + "github.com/grafana/mimir/pkg/mimirpb_custom" ) func TestShardedQuerier_Select(t *testing.T) { @@ -106,7 +107,7 @@ func TestShardedQuerier_Select(t *testing.T) { ResultType: string(parser.ValueTypeVector), Result: []SampleStream{ { - Labels: []mimirpb.LabelAdapter{ + Labels: []mimirpb_custom.LabelAdapter{ {Name: "a", Value: "a1"}, {Name: "b", Value: "b1"}, }, @@ -122,7 +123,7 @@ func TestShardedQuerier_Select(t *testing.T) { }, }, { - Labels: []mimirpb.LabelAdapter{ + Labels: []mimirpb_custom.LabelAdapter{ {Name: "a", Value: "a1"}, {Name: "b", Value: "b1"}, }, @@ -156,7 +157,7 @@ func TestShardedQuerier_Select(t *testing.T) { expected := []SampleStream{ { - Labels: []mimirpb.LabelAdapter{ + Labels: []mimirpb_custom.LabelAdapter{ {Name: "a", Value: "a1"}, {Name: "b", Value: "b1"}, }, @@ -172,7 +173,7 @@ func TestShardedQuerier_Select(t *testing.T) { }, }, { - Labels: []mimirpb.LabelAdapter{ + Labels: []mimirpb_custom.LabelAdapter{ {Name: "a", Value: "a1"}, {Name: "b", Value: "b1"}, }, @@ -232,7 +233,7 @@ func TestShardedQuerier_Select_ShouldConcurrentlyRunEmbeddedQueries(t *testing.T Data: &PrometheusData{ ResultType: string(parser.ValueTypeVector), Result: []SampleStream{{ - Labels: []mimirpb.LabelAdapter{{Name: "a", Value: "1"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "a", Value: "1"}}, Samples: []mimirpb.Sample{{Value: 1, TimestampMs: 1}}, }}, }, @@ -304,69 +305,69 @@ func TestNewSeriesSetFromEmbeddedQueriesResults(t *testing.T) { }{ "should add a stale marker at the end even if if input samples have no gaps": { input: []SampleStream{{ - Labels: []mimirpb.LabelAdapter{{Name: "a", Value: "1"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "a", Value: "1"}}, Samples: []mimirpb.Sample{{TimestampMs: 10, Value: 1}, {TimestampMs: 20, Value: 2}, {TimestampMs: 30, Value: 3}}, }, { - Labels: []mimirpb.LabelAdapter{{Name: "a", Value: "b"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "a", Value: "b"}}, Samples: []mimirpb.Sample{{TimestampMs: 20, Value: 2}, {TimestampMs: 30, Value: 3}}, }}, hints: &storage.SelectHints{Step: 10}, expected: []SampleStream{{ - Labels: []mimirpb.LabelAdapter{{Name: "a", Value: "1"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "a", Value: "1"}}, Samples: []mimirpb.Sample{{TimestampMs: 10, Value: 1}, {TimestampMs: 20, Value: 2}, {TimestampMs: 30, Value: 3}, {TimestampMs: 40, Value: math.Float64frombits(value.StaleNaN)}}, }, { - Labels: []mimirpb.LabelAdapter{{Name: "a", Value: "b"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "a", Value: "b"}}, Samples: []mimirpb.Sample{{TimestampMs: 20, Value: 2}, {TimestampMs: 30, Value: 3}, {TimestampMs: 40, Value: math.Float64frombits(value.StaleNaN)}}, }}, }, "should add stale markers at the beginning of each gap and one at the end of the series": { input: []SampleStream{{ - Labels: []mimirpb.LabelAdapter{{Name: "a", Value: "1"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "a", Value: "1"}}, Samples: []mimirpb.Sample{{TimestampMs: 10, Value: 1}, {TimestampMs: 40, Value: 4}, {TimestampMs: 90, Value: 9}}, }, { - Labels: []mimirpb.LabelAdapter{{Name: "a", Value: "b"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "a", Value: "b"}}, Samples: []mimirpb.Sample{{TimestampMs: 20, Value: 2}, {TimestampMs: 30, Value: 3}}, }}, hints: &storage.SelectHints{Step: 10}, expected: []SampleStream{{ - Labels: []mimirpb.LabelAdapter{{Name: "a", Value: "1"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "a", Value: "1"}}, Samples: []mimirpb.Sample{{TimestampMs: 10, Value: 1}, {TimestampMs: 20, Value: math.Float64frombits(value.StaleNaN)}, {TimestampMs: 40, Value: 4}, {TimestampMs: 50, Value: math.Float64frombits(value.StaleNaN)}, {TimestampMs: 90, Value: 9}, {TimestampMs: 100, Value: math.Float64frombits(value.StaleNaN)}}, }, { - Labels: []mimirpb.LabelAdapter{{Name: "a", Value: "b"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "a", Value: "b"}}, Samples: []mimirpb.Sample{{TimestampMs: 20, Value: 2}, {TimestampMs: 30, Value: 3}, {TimestampMs: 40, Value: math.Float64frombits(value.StaleNaN)}}, }}, }, "should not add stale markers even if points have gaps if hints is not passed": { input: []SampleStream{{ - Labels: []mimirpb.LabelAdapter{{Name: "a", Value: "1"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "a", Value: "1"}}, Samples: []mimirpb.Sample{{TimestampMs: 10, Value: 1}, {TimestampMs: 40, Value: 4}, {TimestampMs: 90, Value: 9}}, }, { - Labels: []mimirpb.LabelAdapter{{Name: "a", Value: "b"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "a", Value: "b"}}, Samples: []mimirpb.Sample{{TimestampMs: 20, Value: 2}, {TimestampMs: 30, Value: 3}}, }}, hints: nil, expected: []SampleStream{{ - Labels: []mimirpb.LabelAdapter{{Name: "a", Value: "1"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "a", Value: "1"}}, Samples: []mimirpb.Sample{{TimestampMs: 10, Value: 1}, {TimestampMs: 40, Value: 4}, {TimestampMs: 90, Value: 9}}, }, { - Labels: []mimirpb.LabelAdapter{{Name: "a", Value: "b"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "a", Value: "b"}}, Samples: []mimirpb.Sample{{TimestampMs: 20, Value: 2}, {TimestampMs: 30, Value: 3}}, }}, }, "should not add stale markers even if points have gaps if step == 0": { input: []SampleStream{{ - Labels: []mimirpb.LabelAdapter{{Name: "a", Value: "1"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "a", Value: "1"}}, Samples: []mimirpb.Sample{{TimestampMs: 10, Value: 1}, {TimestampMs: 40, Value: 4}, {TimestampMs: 90, Value: 9}}, }, { - Labels: []mimirpb.LabelAdapter{{Name: "a", Value: "b"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "a", Value: "b"}}, Samples: []mimirpb.Sample{{TimestampMs: 20, Value: 2}, {TimestampMs: 30, Value: 3}}, }}, hints: &storage.SelectHints{Step: 0}, expected: []SampleStream{{ - Labels: []mimirpb.LabelAdapter{{Name: "a", Value: "1"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "a", Value: "1"}}, Samples: []mimirpb.Sample{{TimestampMs: 10, Value: 1}, {TimestampMs: 40, Value: 4}, {TimestampMs: 90, Value: 9}}, }, { - Labels: []mimirpb.LabelAdapter{{Name: "a", Value: "b"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "a", Value: "b"}}, Samples: []mimirpb.Sample{{TimestampMs: 20, Value: 2}, {TimestampMs: 30, Value: 3}}, }}, }, @@ -388,7 +389,7 @@ func TestResponseToSamples(t *testing.T) { ResultType: string(parser.ValueTypeMatrix), Result: []SampleStream{ { - Labels: []mimirpb.LabelAdapter{ + Labels: []mimirpb_custom.LabelAdapter{ {Name: "a", Value: "a1"}, {Name: "b", Value: "b1"}, }, @@ -404,7 +405,7 @@ func TestResponseToSamples(t *testing.T) { }, }, { - Labels: []mimirpb.LabelAdapter{ + Labels: []mimirpb_custom.LabelAdapter{ {Name: "a", Value: "a1"}, {Name: "b", Value: "b1"}, }, diff --git a/pkg/frontend/querymiddleware/split_and_cache_test.go b/pkg/frontend/querymiddleware/split_and_cache_test.go index f95beeadbe..5aa62155c2 100644 --- a/pkg/frontend/querymiddleware/split_and_cache_test.go +++ b/pkg/frontend/querymiddleware/split_and_cache_test.go @@ -35,6 +35,7 @@ import ( apierror "github.com/grafana/mimir/pkg/api/error" "github.com/grafana/mimir/pkg/mimirpb" + "github.com/grafana/mimir/pkg/mimirpb_custom" "github.com/grafana/mimir/pkg/querier/stats" "github.com/grafana/mimir/pkg/util" ) @@ -49,7 +50,7 @@ func TestSplitAndCacheMiddleware_SplitByInterval(t *testing.T) { dayThreeStartTime = parseTimeRFC3339(t, "2021-10-16T00:00:00Z") dayFourEndTime = parseTimeRFC3339(t, "2021-10-17T23:59:59Z") queryURL = mockQueryRangeURL(dayOneStartTime, dayFourEndTime, `{__name__=~".+"}`) - seriesLabels = []mimirpb.LabelAdapter{{Name: "__name__", Value: "test_metric"}} + seriesLabels = []mimirpb_custom.LabelAdapter{{Name: "__name__", Value: "test_metric"}} // Mock the downstream responses. firstDayDownstreamResponse = jsonEncodePrometheusResponse(t, @@ -257,7 +258,7 @@ func TestSplitAndCacheMiddleware_ResultsCache(t *testing.T) { ResultType: model.ValMatrix.String(), Result: []SampleStream{ { - Labels: []mimirpb.LabelAdapter{ + Labels: []mimirpb_custom.LabelAdapter{ {Name: "foo", Value: "bar"}, }, Samples: []mimirpb.Sample{ @@ -394,7 +395,7 @@ func TestSplitAndCacheMiddleware_ResultsCacheNoStore(t *testing.T) { ResultType: model.ValMatrix.String(), Result: []SampleStream{ { - Labels: []mimirpb.LabelAdapter{ + Labels: []mimirpb_custom.LabelAdapter{ {Name: "foo", Value: "bar"}, }, Samples: []mimirpb.Sample{ @@ -520,7 +521,7 @@ func TestSplitAndCacheMiddleware_ResultsCache_ShouldNotLookupCacheIfStepIsNotAli ResultType: model.ValMatrix.String(), Result: []SampleStream{ { - Labels: []mimirpb.LabelAdapter{ + Labels: []mimirpb_custom.LabelAdapter{ {Name: "foo", Value: "bar"}, }, Samples: []mimirpb.Sample{ @@ -636,7 +637,7 @@ func TestSplitAndCacheMiddleware_ResultsCache_EnabledCachingOfStepUnalignedReque ResultType: model.ValMatrix.String(), Result: []SampleStream{ { - Labels: []mimirpb.LabelAdapter{ + Labels: []mimirpb_custom.LabelAdapter{ {Name: "foo", Value: "bar"}, }, Samples: []mimirpb.Sample{ @@ -729,7 +730,7 @@ func TestSplitAndCacheMiddleware_ResultsCache_ShouldNotCacheRequestEarlierThanMa queryStartTime: fiveMinutesAgo, queryEndTime: now, downstreamResponse: mockPrometheusResponseSingleSeries( - []mimirpb.LabelAdapter{{Name: "__name__", Value: "test_metric"}}, + []mimirpb_custom.LabelAdapter{{Name: "__name__", Value: "test_metric"}}, mimirpb.Sample{TimestampMs: fiveMinutesAgo.Unix() * 1000, Value: 10}, mimirpb.Sample{TimestampMs: now.Unix() * 1000, Value: 20}), expectedDownstreamStartTime: fiveMinutesAgo, @@ -759,14 +760,14 @@ func TestSplitAndCacheMiddleware_ResultsCache_ShouldNotCacheRequestEarlierThanMa queryStartTime: twentyMinutesAgo, queryEndTime: now, downstreamResponse: mockPrometheusResponseSingleSeries( - []mimirpb.LabelAdapter{{Name: "__name__", Value: "test_metric"}}, + []mimirpb_custom.LabelAdapter{{Name: "__name__", Value: "test_metric"}}, mimirpb.Sample{TimestampMs: twentyMinutesAgo.Unix() * 1000, Value: 10}, mimirpb.Sample{TimestampMs: now.Unix() * 1000, Value: 20}), expectedDownstreamStartTime: twentyMinutesAgo, expectedDownstreamEndTime: now, expectedCachedResponses: []Response{ mockPrometheusResponseSingleSeries( - []mimirpb.LabelAdapter{{Name: "__name__", Value: "test_metric"}}, + []mimirpb_custom.LabelAdapter{{Name: "__name__", Value: "test_metric"}}, // Any sample more recent than max cache freshness shouldn't be cached. mimirpb.Sample{TimestampMs: twentyMinutesAgo.Unix() * 1000, Value: 10}), }, @@ -1616,7 +1617,7 @@ func mockQueryRangeURL(startTime, endTime time.Time, query string) string { return generated.String() } -func mockProtobufResponseWithSamplesAndHistograms(labels []mimirpb.LabelAdapter, samples []mimirpb.Sample, histograms []mimirpb.FloatHistogramPair) *mimirpb.QueryResponse { +func mockProtobufResponseWithSamplesAndHistograms(labels []mimirpb_custom.LabelAdapter, samples []mimirpb.Sample, histograms []mimirpb.FloatHistogramPair) *mimirpb.QueryResponse { return &mimirpb.QueryResponse{ Status: mimirpb.QueryResponse_SUCCESS, Data: &mimirpb.QueryResponse_Matrix{ diff --git a/pkg/ingester/circuitbreaker_test.go b/pkg/ingester/circuitbreaker_test.go index 99d46d3644..848c8524c6 100644 --- a/pkg/ingester/circuitbreaker_test.go +++ b/pkg/ingester/circuitbreaker_test.go @@ -26,6 +26,7 @@ import ( "google.golang.org/grpc/codes" "github.com/grafana/mimir/pkg/mimirpb" + "github.com/grafana/mimir/pkg/mimirpb_custom" "github.com/grafana/mimir/pkg/util/validation" ) @@ -583,7 +584,7 @@ func TestIngester_IngestStorage_PushToStorage_CircuitBreaker(t *testing.T) { for initialDelayEnabled, initialDelayStatus := range map[bool]string{false: "disabled", true: "enabled"} { for testName, testCase := range tests { t.Run(fmt.Sprintf("%s with initial delay %s", testName, initialDelayStatus), func(t *testing.T) { - metricLabelAdapters := [][]mimirpb.LabelAdapter{{{Name: labels.MetricName, Value: "test"}}} + metricLabelAdapters := [][]mimirpb_custom.LabelAdapter{{{Name: labels.MetricName, Value: "test"}}} metricNames := []string{ "cortex_ingester_circuit_breaker_results_total", "cortex_ingester_circuit_breaker_transitions_total", @@ -925,7 +926,7 @@ func TestIngester_Push_CircuitBreaker_DeadlineExceeded(t *testing.T) { pushTimeout := 1 * time.Second for initialDelayEnabled, initialDelayStatus := range map[bool]string{false: "disabled", true: "enabled"} { t.Run(fmt.Sprintf("test slow push with initial delay %s", initialDelayStatus), func(t *testing.T) { - metricLabelAdapters := [][]mimirpb.LabelAdapter{{{Name: labels.MetricName, Value: "test"}}} + metricLabelAdapters := [][]mimirpb_custom.LabelAdapter{{{Name: labels.MetricName, Value: "test"}}} metricNames := []string{ "cortex_ingester_circuit_breaker_results_total", "cortex_ingester_circuit_breaker_transitions_total", diff --git a/pkg/ingester/client/buffering_client_test.go b/pkg/ingester/client/buffering_client_test.go index 08056f6a0a..890b50fad2 100644 --- a/pkg/ingester/client/buffering_client_test.go +++ b/pkg/ingester/client/buffering_client_test.go @@ -18,6 +18,7 @@ import ( "google.golang.org/grpc/credentials/insecure" "github.com/grafana/mimir/pkg/mimirpb" + "github.com/grafana/mimir/pkg/mimirpb_custom" pool2 "github.com/grafana/mimir/pkg/util/pool" ) @@ -240,10 +241,10 @@ func TestWriteRequestBufferingClient_PushConcurrent(t *testing.T) { } func createRequest(metricName string, seriesPerRequest int) *mimirpb.WriteRequest { - metrics := make([][]mimirpb.LabelAdapter, 0, seriesPerRequest) + metrics := make([][]mimirpb_custom.LabelAdapter, 0, seriesPerRequest) samples := make([]mimirpb.Sample, 0, seriesPerRequest) for i := 0; i < seriesPerRequest; i++ { - metrics = append(metrics, []mimirpb.LabelAdapter{{Name: labels.MetricName, Value: metricName}, {Name: "cardinality", Value: strconv.Itoa(i)}}) + metrics = append(metrics, []mimirpb_custom.LabelAdapter{{Name: labels.MetricName, Value: metricName}, {Name: "cardinality", Value: strconv.Itoa(i)}}) samples = append(samples, mimirpb.Sample{Value: float64(i), TimestampMs: time.Now().UnixMilli()}) } diff --git a/pkg/ingester/client/chunkcompat.go b/pkg/ingester/client/chunkcompat.go index d3eedaf43d..bfb1bf9d7d 100644 --- a/pkg/ingester/client/chunkcompat.go +++ b/pkg/ingester/client/chunkcompat.go @@ -14,6 +14,7 @@ import ( "github.com/prometheus/prometheus/model/labels" "github.com/grafana/mimir/pkg/mimirpb" + "github.com/grafana/mimir/pkg/mimirpb_custom" "github.com/grafana/mimir/pkg/storage/chunk" "github.com/grafana/mimir/pkg/util/modelutil" ) @@ -21,7 +22,7 @@ import ( // StreamsToMatrix converts a slice of QueryStreamResponse to a model.Matrix. func StreamsToMatrix(from, through model.Time, responses []*QueryStreamResponse) (model.Matrix, error) { result := model.Matrix{} - streamingSeries := [][]mimirpb.LabelAdapter{} + streamingSeries := [][]mimirpb_custom.LabelAdapter{} haveReachedEndOfStreamingSeriesLabels := false for _, response := range responses { diff --git a/pkg/ingester/client/client_test.go b/pkg/ingester/client/client_test.go index bd575c3d69..906a040c60 100644 --- a/pkg/ingester/client/client_test.go +++ b/pkg/ingester/client/client_test.go @@ -14,6 +14,7 @@ import ( "github.com/stretchr/testify/require" "github.com/grafana/mimir/pkg/mimirpb" + "github.com/grafana/mimir/pkg/mimirpb_custom" "github.com/grafana/mimir/pkg/util" "github.com/grafana/mimir/pkg/util/test" ) @@ -31,7 +32,7 @@ func TestMarshall(t *testing.T) { for i := 0; i < numSeries; i++ { req.Timeseries = append(req.Timeseries, mimirpb.PreallocTimeseries{ TimeSeries: &mimirpb.TimeSeries{ - Labels: []mimirpb.LabelAdapter{ + Labels: []mimirpb_custom.LabelAdapter{ {Name: "foo", Value: strconv.Itoa(i)}, }, Samples: []mimirpb.Sample{ diff --git a/pkg/ingester/client/ingester.pb.go b/pkg/ingester/client/ingester.pb.go index bbefc14b1e..c614a38de5 100644 --- a/pkg/ingester/client/ingester.pb.go +++ b/pkg/ingester/client/ingester.pb.go @@ -14,6 +14,7 @@ import ( github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" github_com_grafana_mimir_pkg_mimirpb "github.com/grafana/mimir/pkg/mimirpb" mimirpb "github.com/grafana/mimir/pkg/mimirpb" + mimirpb_custom "github.com/grafana/mimir/pkg/mimirpb_custom" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -708,8 +709,8 @@ func (m *QueryStreamResponse) GetStreamingSeriesChunks() []QueryStreamSeriesChun } type QueryStreamSeries struct { - Labels []github_com_grafana_mimir_pkg_mimirpb.LabelAdapter `protobuf:"bytes,1,rep,name=labels,proto3,customtype=github.com/grafana/mimir/pkg/mimirpb.LabelAdapter" json:"labels"` - ChunkCount int64 `protobuf:"varint,2,opt,name=chunk_count,json=chunkCount,proto3" json:"chunk_count,omitempty"` + Labels []mimirpb_custom.LabelAdapter `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels"` + ChunkCount int64 `protobuf:"varint,2,opt,name=chunk_count,json=chunkCount,proto3" json:"chunk_count,omitempty"` } func (m *QueryStreamSeries) Reset() { *m = QueryStreamSeries{} } @@ -744,6 +745,13 @@ func (m *QueryStreamSeries) XXX_DiscardUnknown() { var xxx_messageInfo_QueryStreamSeries proto.InternalMessageInfo +func (m *QueryStreamSeries) GetLabels() []mimirpb_custom.LabelAdapter { + if m != nil { + return m.Labels + } + return nil +} + func (m *QueryStreamSeries) GetChunkCount() int64 { if m != nil { return m.ChunkCount @@ -1519,10 +1527,10 @@ func (m *ActiveSeriesResponse) GetBucketCount() []uint64 { } type TimeSeriesChunk struct { - FromIngesterId string `protobuf:"bytes,1,opt,name=from_ingester_id,json=fromIngesterId,proto3" json:"from_ingester_id,omitempty"` - UserId string `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - Labels []github_com_grafana_mimir_pkg_mimirpb.LabelAdapter `protobuf:"bytes,3,rep,name=labels,proto3,customtype=github.com/grafana/mimir/pkg/mimirpb.LabelAdapter" json:"labels"` - Chunks []Chunk `protobuf:"bytes,4,rep,name=chunks,proto3" json:"chunks"` + FromIngesterId string `protobuf:"bytes,1,opt,name=from_ingester_id,json=fromIngesterId,proto3" json:"from_ingester_id,omitempty"` + UserId string `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + Labels []mimirpb_custom.LabelAdapter `protobuf:"bytes,3,rep,name=labels,proto3" json:"labels"` + Chunks []Chunk `protobuf:"bytes,4,rep,name=chunks,proto3" json:"chunks"` } func (m *TimeSeriesChunk) Reset() { *m = TimeSeriesChunk{} } @@ -1571,6 +1579,13 @@ func (m *TimeSeriesChunk) GetUserId() string { return "" } +func (m *TimeSeriesChunk) GetLabels() []mimirpb_custom.LabelAdapter { + if m != nil { + return m.Labels + } + return nil +} + func (m *TimeSeriesChunk) GetChunks() []Chunk { if m != nil { return m.Chunks @@ -1781,117 +1796,117 @@ func init() { func init() { proto.RegisterFile("ingester.proto", fileDescriptor_60f6df4f3586b478) } var fileDescriptor_60f6df4f3586b478 = []byte{ - // 1748 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0x4b, 0x6f, 0x1b, 0xc9, - 0x11, 0x66, 0xf3, 0xb5, 0x62, 0x91, 0x92, 0xa8, 0xa6, 0x24, 0x72, 0x47, 0xab, 0x91, 0x76, 0x02, - 0xef, 0x32, 0x9b, 0x5d, 0xc9, 0xaf, 0x2c, 0xbc, 0x9b, 0x0d, 0x02, 0x4a, 0xa6, 0x2d, 0xda, 0xa6, - 0x24, 0x0f, 0x25, 0xe7, 0x01,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ca, 0xe8, 0xf9, 0xa9, 0x8c, 0x5e, - 0x9c, 0xca, 0xe8, 0x5f, 0xa7, 0x32, 0xfa, 0xf7, 0xa9, 0x9c, 0x78, 0x7b, 0x2a, 0xa3, 0xdf, 0xbc, - 0x91, 0x13, 0x2f, 0xde, 0xc8, 0x89, 0x97, 0x6f, 0xe4, 0xc4, 0x2f, 0xb2, 0x9d, 0x9e, 0x41, 0x2c, - 0xda, 0xce, 0xb2, 0x27, 0xd0, 0x1b, 0xff, 0x0b, 0x00, 0x00, 0xff, 0xff, 0x69, 0x8a, 0xb2, 0x58, - 0x7d, 0x15, 0x00, 0x00, + // 1754 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0xcd, 0x6f, 0x1b, 0xc7, + 0x15, 0xe7, 0xf0, 0x2b, 0xe2, 0x23, 0x25, 0x53, 0x43, 0xd9, 0x64, 0x56, 0xd1, 0x4a, 0xd9, 0xc2, + 0x09, 0x9b, 0x26, 0x94, 0x63, 0xbb, 0x81, 0x9b, 0xa4, 0x28, 0x28, 0x89, 0xb1, 0xe8, 0x84, 0x92, + 0xb3, 0x94, 0xd2, 0x0f, 0x20, 0x58, 0x2c, 0xc9, 0x91, 0xb4, 0x10, 0x77, 0xc9, 0xec, 0x0c, 0x03, + 0x2b, 0xa7, 0x9e, 0x7a, 0xee, 0x5f, 0x50, 0xa0, 0xb7, 0xa2, 0xc7, 0x5e, 0x7a, 0x29, 0x72, 0xce, + 0xa5, 0x80, 0x6f, 0x0d, 0x0a, 0xd4, 0xa8, 0xe5, 0x4b, 0x8f, 0x01, 0xfa, 0x0f, 0x14, 0x3b, 0x33, + 0xfb, 0x49, 0x4a, 0xa2, 0x82, 0xc6, 0x27, 0x72, 0xde, 0xd7, 0xfc, 0xde, 0x9b, 0x37, 0xef, 0xbd, + 0x1d, 0x58, 0xb2, 0x9c, 0x63, 0x42, 0x19, 0x71, 0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) String() string { @@ -2322,7 +2337,7 @@ func (this *QueryStreamSeries) Equal(that interface{}) bool { return false } for i := range this.Labels { - if !this.Labels[i].Equal(that1.Labels[i]) { + if !this.Labels[i].Equal(&that1.Labels[i]) { return false } } @@ -2815,7 +2830,7 @@ func (this *TimeSeriesChunk) Equal(that interface{}) bool { return false } for i := range this.Labels { - if !this.Labels[i].Equal(that1.Labels[i]) { + if !this.Labels[i].Equal(&that1.Labels[i]) { return false } } @@ -3108,7 +3123,13 @@ func (this *QueryStreamSeries) GoString() string { } s := make([]string, 0, 6) s = append(s, "&client.QueryStreamSeries{") - s = append(s, "Labels: "+fmt.Sprintf("%#v", this.Labels)+",\n") + if this.Labels != nil { + vs := make([]*mimirpb_custom.LabelAdapter, len(this.Labels)) + for i := range vs { + vs[i] = &this.Labels[i] + } + s = append(s, "Labels: "+fmt.Sprintf("%#v", vs)+",\n") + } s = append(s, "ChunkCount: "+fmt.Sprintf("%#v", this.ChunkCount)+",\n") s = append(s, "}") return strings.Join(s, "") @@ -3314,7 +3335,13 @@ func (this *TimeSeriesChunk) GoString() string { s = append(s, "&client.TimeSeriesChunk{") s = append(s, "FromIngesterId: "+fmt.Sprintf("%#v", this.FromIngesterId)+",\n") s = append(s, "UserId: "+fmt.Sprintf("%#v", this.UserId)+",\n") - s = append(s, "Labels: "+fmt.Sprintf("%#v", this.Labels)+",\n") + if this.Labels != nil { + vs := make([]*mimirpb_custom.LabelAdapter, len(this.Labels)) + for i := range vs { + vs[i] = &this.Labels[i] + } + s = append(s, "Labels: "+fmt.Sprintf("%#v", vs)+",\n") + } if this.Chunks != nil { vs := make([]*Chunk, len(this.Chunks)) for i := range vs { @@ -4516,11 +4543,11 @@ func (m *QueryStreamSeries) MarshalToSizedBuffer(dAtA []byte) (int, error) { if len(m.Labels) > 0 { for iNdEx := len(m.Labels) - 1; iNdEx >= 0; iNdEx-- { { - size := m.Labels[iNdEx].Size() - i -= size - if _, err := m.Labels[iNdEx].MarshalTo(dAtA[i:]); err != nil { + size, err := m.Labels[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { return 0, err } + i -= size i = encodeVarintIngester(dAtA, i, uint64(size)) } i-- @@ -5176,11 +5203,11 @@ func (m *TimeSeriesChunk) MarshalToSizedBuffer(dAtA []byte) (int, error) { if len(m.Labels) > 0 { for iNdEx := len(m.Labels) - 1; iNdEx >= 0; iNdEx-- { { - size := m.Labels[iNdEx].Size() - i -= size - if _, err := m.Labels[iNdEx].MarshalTo(dAtA[i:]); err != nil { + size, err := m.Labels[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { return 0, err } + i -= size i = encodeVarintIngester(dAtA, i, uint64(size)) } i-- @@ -6137,8 +6164,13 @@ func (this *QueryStreamSeries) String() string { if this == nil { return "nil" } + repeatedStringForLabels := "[]LabelAdapter{" + for _, f := range this.Labels { + repeatedStringForLabels += fmt.Sprintf("%v", f) + "," + } + repeatedStringForLabels += "}" s := strings.Join([]string{`&QueryStreamSeries{`, - `Labels:` + fmt.Sprintf("%v", this.Labels) + `,`, + `Labels:` + repeatedStringForLabels + `,`, `ChunkCount:` + fmt.Sprintf("%v", this.ChunkCount) + `,`, `}`, }, "") @@ -6348,6 +6380,11 @@ func (this *TimeSeriesChunk) String() string { if this == nil { return "nil" } + repeatedStringForLabels := "[]LabelAdapter{" + for _, f := range this.Labels { + repeatedStringForLabels += fmt.Sprintf("%v", f) + "," + } + repeatedStringForLabels += "}" repeatedStringForChunks := "[]Chunk{" for _, f := range this.Chunks { repeatedStringForChunks += strings.Replace(strings.Replace(f.String(), "Chunk", "Chunk", 1), `&`, ``, 1) + "," @@ -6356,7 +6393,7 @@ func (this *TimeSeriesChunk) String() string { s := strings.Join([]string{`&TimeSeriesChunk{`, `FromIngesterId:` + fmt.Sprintf("%v", this.FromIngesterId) + `,`, `UserId:` + fmt.Sprintf("%v", this.UserId) + `,`, - `Labels:` + fmt.Sprintf("%v", this.Labels) + `,`, + `Labels:` + repeatedStringForLabels + `,`, `Chunks:` + repeatedStringForChunks + `,`, `}`, }, "") @@ -7872,7 +7909,7 @@ func (m *QueryStreamSeries) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Labels = append(m.Labels, github_com_grafana_mimir_pkg_mimirpb.LabelAdapter{}) + m.Labels = append(m.Labels, mimirpb_custom.LabelAdapter{}) if err := m.Labels[len(m.Labels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -9665,7 +9702,7 @@ func (m *TimeSeriesChunk) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Labels = append(m.Labels, github_com_grafana_mimir_pkg_mimirpb.LabelAdapter{}) + m.Labels = append(m.Labels, mimirpb_custom.LabelAdapter{}) if err := m.Labels[len(m.Labels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/pkg/ingester/client/ingester.proto b/pkg/ingester/client/ingester.proto index b2dd18b2a9..79fadb18c7 100644 --- a/pkg/ingester/client/ingester.proto +++ b/pkg/ingester/client/ingester.proto @@ -12,6 +12,7 @@ option go_package = "client"; import "github.com/gogo/protobuf/gogoproto/gogo.proto"; import "github.com/grafana/mimir/pkg/mimirpb/mimir.proto"; +import "github.com/grafana/mimir/pkg/mimirpb_custom/mimir_custom_types.proto"; option (gogoproto.marshaler_all) = true; option (gogoproto.unmarshaler_all) = true; @@ -123,7 +124,7 @@ message QueryStreamResponse { } message QueryStreamSeries { - repeated cortexpb.LabelPair labels = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/grafana/mimir/pkg/mimirpb.LabelAdapter"]; + repeated cortexpb_custom.LabelAdapter labels = 1 [(gogoproto.nullable) = false]; int64 chunk_count = 2; } @@ -207,7 +208,7 @@ message ActiveSeriesResponse { message TimeSeriesChunk { string from_ingester_id = 1; string user_id = 2; - repeated cortexpb.LabelPair labels = 3 [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/grafana/mimir/pkg/mimirpb.LabelAdapter"]; + repeated cortexpb_custom.LabelAdapter labels = 3 [(gogoproto.nullable) = false]; repeated Chunk chunks = 4 [(gogoproto.nullable) = false]; } diff --git a/pkg/ingester/errors.go b/pkg/ingester/errors.go index 7836787ad2..0ba252cb07 100644 --- a/pkg/ingester/errors.go +++ b/pkg/ingester/errors.go @@ -17,6 +17,7 @@ import ( "google.golang.org/grpc/codes" "github.com/grafana/mimir/pkg/mimirpb" + "github.com/grafana/mimir/pkg/mimirpb_custom" "github.com/grafana/mimir/pkg/util/globalerror" "github.com/grafana/mimir/pkg/util/log" "github.com/grafana/mimir/pkg/util/validation" @@ -104,7 +105,7 @@ var _ ingesterError = sampleError{} // Ensure that sampleError is a softError. var _ softError = sampleError{} -func newSampleError(errID globalerror.ID, errMsg string, timestamp model.Time, labels []mimirpb.LabelAdapter) sampleError { +func newSampleError(errID globalerror.ID, errMsg string, timestamp model.Time, labels []mimirpb_custom.LabelAdapter) sampleError { return sampleError{ errID: errID, errMsg: errMsg, @@ -113,23 +114,23 @@ func newSampleError(errID globalerror.ID, errMsg string, timestamp model.Time, l } } -func newSampleTimestampTooOldError(timestamp model.Time, labels []mimirpb.LabelAdapter) sampleError { +func newSampleTimestampTooOldError(timestamp model.Time, labels []mimirpb_custom.LabelAdapter) sampleError { return newSampleError(globalerror.SampleTimestampTooOld, "the sample has been rejected because its timestamp is too old", timestamp, labels) } -func newSampleTimestampTooOldOOOEnabledError(timestamp model.Time, labels []mimirpb.LabelAdapter, oooTimeWindow time.Duration) sampleError { +func newSampleTimestampTooOldOOOEnabledError(timestamp model.Time, labels []mimirpb_custom.LabelAdapter, oooTimeWindow time.Duration) sampleError { return newSampleError(globalerror.SampleTimestampTooOld, fmt.Sprintf("the sample has been rejected because another sample with a more recent timestamp has already been ingested and this sample is beyond the out-of-order time window of %s", model.Duration(oooTimeWindow).String()), timestamp, labels) } -func newSampleTimestampTooFarInFutureError(timestamp model.Time, labels []mimirpb.LabelAdapter) sampleError { +func newSampleTimestampTooFarInFutureError(timestamp model.Time, labels []mimirpb_custom.LabelAdapter) sampleError { return newSampleError(globalerror.SampleTooFarInFuture, "received a sample whose timestamp is too far in the future", timestamp, labels) } -func newSampleOutOfOrderError(timestamp model.Time, labels []mimirpb.LabelAdapter) sampleError { +func newSampleOutOfOrderError(timestamp model.Time, labels []mimirpb_custom.LabelAdapter) sampleError { return newSampleError(globalerror.SampleOutOfOrder, "the sample has been rejected because another sample with a more recent timestamp has already been ingested and out-of-order samples are not allowed", timestamp, labels) } -func newSampleDuplicateTimestampError(timestamp model.Time, labels []mimirpb.LabelAdapter) sampleError { +func newSampleDuplicateTimestampError(timestamp model.Time, labels []mimirpb_custom.LabelAdapter) sampleError { return newSampleError(globalerror.SampleDuplicateTimestamp, "the sample has been rejected because another sample with the same timestamp, but a different value, has already been ingested", timestamp, labels) } @@ -164,7 +165,7 @@ var _ ingesterError = exemplarError{} // Ensure that exemplarError is an softError. var _ softError = exemplarError{} -func newExemplarError(errID globalerror.ID, errMsg string, timestamp model.Time, seriesLabels, exemplarLabels []mimirpb.LabelAdapter) exemplarError { +func newExemplarError(errID globalerror.ID, errMsg string, timestamp model.Time, seriesLabels, exemplarLabels []mimirpb_custom.LabelAdapter) exemplarError { return exemplarError{ errID: errID, errMsg: errMsg, @@ -174,14 +175,14 @@ func newExemplarError(errID globalerror.ID, errMsg string, timestamp model.Time, } } -func newExemplarMissingSeriesError(timestamp model.Time, seriesLabels, exemplarLabels []mimirpb.LabelAdapter) exemplarError { +func newExemplarMissingSeriesError(timestamp model.Time, seriesLabels, exemplarLabels []mimirpb_custom.LabelAdapter) exemplarError { return newExemplarError(globalerror.ExemplarSeriesMissing, "the exemplar has been rejected because the related series has not been ingested yet", timestamp, seriesLabels, exemplarLabels) } -func newExemplarTimestampTooFarInFutureError(timestamp model.Time, seriesLabels, exemplarLabels []mimirpb.LabelAdapter) exemplarError { +func newExemplarTimestampTooFarInFutureError(timestamp model.Time, seriesLabels, exemplarLabels []mimirpb_custom.LabelAdapter) exemplarError { return newExemplarError(globalerror.ExemplarTooFarInFuture, "received an exemplar whose timestamp is too far in the future", timestamp, seriesLabels, exemplarLabels) } -func newExemplarTimestampTooFarInPastError(timestamp model.Time, seriesLabels, exemplarLabels []mimirpb.LabelAdapter) exemplarError { +func newExemplarTimestampTooFarInPastError(timestamp model.Time, seriesLabels, exemplarLabels []mimirpb_custom.LabelAdapter) exemplarError { return newExemplarError(globalerror.ExemplarTooFarInPast, "received an exemplar whose timestamp is too far in the past", timestamp, seriesLabels, exemplarLabels) } @@ -214,7 +215,7 @@ var _ ingesterError = tsdbIngestExemplarErr{} // Ensure that tsdbIngestExemplarErr is an softError. var _ softError = tsdbIngestExemplarErr{} -func newTSDBIngestExemplarErr(ingestErr error, timestamp model.Time, seriesLabels, exemplarLabels []mimirpb.LabelAdapter) tsdbIngestExemplarErr { +func newTSDBIngestExemplarErr(ingestErr error, timestamp model.Time, seriesLabels, exemplarLabels []mimirpb_custom.LabelAdapter) tsdbIngestExemplarErr { return tsdbIngestExemplarErr{ originalErr: ingestErr, timestamp: timestamp, @@ -292,7 +293,7 @@ type perMetricSeriesLimitReachedError struct { } // newPerMetricSeriesLimitReachedError creates a new perMetricSeriesLimitReachedError indicating that a per-metric series limit has been reached. -func newPerMetricSeriesLimitReachedError(limit int, labels []mimirpb.LabelAdapter) perMetricSeriesLimitReachedError { +func newPerMetricSeriesLimitReachedError(limit int, labels []mimirpb_custom.LabelAdapter) perMetricSeriesLimitReachedError { return perMetricSeriesLimitReachedError{ limit: limit, series: mimirpb.FromLabelAdaptersToString(labels), @@ -361,11 +362,11 @@ var _ softError = perMetricMetadataLimitReachedError{} type nativeHistogramValidationError struct { id globalerror.ID originalErr error - seriesLabels []mimirpb.LabelAdapter + seriesLabels []mimirpb_custom.LabelAdapter timestamp model.Time } -func newNativeHistogramValidationError(id globalerror.ID, originalErr error, timestamp model.Time, seriesLabels []mimirpb.LabelAdapter) nativeHistogramValidationError { +func newNativeHistogramValidationError(id globalerror.ID, originalErr error, timestamp model.Time, seriesLabels []mimirpb_custom.LabelAdapter) nativeHistogramValidationError { return nativeHistogramValidationError{ id: id, originalErr: originalErr, diff --git a/pkg/ingester/errors_test.go b/pkg/ingester/errors_test.go index 976d2451ae..42f1a093b5 100644 --- a/pkg/ingester/errors_test.go +++ b/pkg/ingester/errors_test.go @@ -20,6 +20,7 @@ import ( grpcstatus "google.golang.org/grpc/status" "github.com/grafana/mimir/pkg/mimirpb" + "github.com/grafana/mimir/pkg/mimirpb_custom" "github.com/grafana/mimir/pkg/util/globalerror" "github.com/grafana/mimir/pkg/util/validation" ) @@ -106,7 +107,7 @@ func TestNewPerUserMetadataLimitError(t *testing.T) { func TestNewPerMetricSeriesLimitError(t *testing.T) { limit := 100 - labels := []mimirpb.LabelAdapter{{Name: labels.MetricName, Value: "testmetric"}, {Name: "foo", Value: "biz"}} + labels := []mimirpb_custom.LabelAdapter{{Name: labels.MetricName, Value: "testmetric"}, {Name: "foo", Value: "biz"}} err := newPerMetricSeriesLimitReachedError(limit, labels) expectedErrMsg := fmt.Sprintf("%s This is for series %s", globalerror.MaxSeriesPerMetric.MessageWithPerTenantLimitConfig( @@ -145,7 +146,7 @@ func TestNewPerMetricMetadataLimitError(t *testing.T) { } func TestNewSampleError(t *testing.T) { - seriesLabels := []mimirpb.LabelAdapter{{Name: labels.MetricName, Value: "test"}} + seriesLabels := []mimirpb_custom.LabelAdapter{{Name: labels.MetricName, Value: "test"}} tests := map[string]struct { err error expectedMsg string @@ -187,8 +188,8 @@ func TestNewSampleError(t *testing.T) { } func TestNewExemplarError(t *testing.T) { - seriesLabels := []mimirpb.LabelAdapter{{Name: labels.MetricName, Value: "test"}} - exemplarsLabels := []mimirpb.LabelAdapter{{Name: "traceID", Value: "123"}} + seriesLabels := []mimirpb_custom.LabelAdapter{{Name: labels.MetricName, Value: "test"}} + exemplarsLabels := []mimirpb_custom.LabelAdapter{{Name: "traceID", Value: "123"}} tests := map[string]struct { err error expectedMsg string @@ -218,8 +219,8 @@ func TestNewExemplarError(t *testing.T) { } func TestNewTSDBIngestExemplarErr(t *testing.T) { - seriesLabels := []mimirpb.LabelAdapter{{Name: labels.MetricName, Value: "test"}} - exemplarsLabels := []mimirpb.LabelAdapter{{Name: "traceID", Value: "123"}} + seriesLabels := []mimirpb_custom.LabelAdapter{{Name: labels.MetricName, Value: "test"}} + exemplarsLabels := []mimirpb_custom.LabelAdapter{{Name: "traceID", Value: "123"}} anotherErr := errors.New("another error") err := newTSDBIngestExemplarErr(anotherErr, timestamp, seriesLabels, exemplarsLabels) expectedErrMsg := fmt.Sprintf("err: %v. timestamp=1970-01-19T05:30:43.969Z, series=test, exemplar={traceID=\"123\"}", anotherErr) @@ -343,7 +344,7 @@ func TestWrapOrAnnotateWithUser(t *testing.T) { require.NotErrorIs(t, annotatedUnsafeErr, annotatingErr) require.Nil(t, errors.Unwrap(annotatedUnsafeErr)) - metricLabelAdapters := []mimirpb.LabelAdapter{{Name: labels.MetricName, Value: "test"}} + metricLabelAdapters := []mimirpb_custom.LabelAdapter{{Name: labels.MetricName, Value: "test"}} wrappingErr := newSampleTimestampTooOldError(timestamp, metricLabelAdapters) expectedWrappedErrMsg := fmt.Sprintf("user=%s: %s", userID, wrappingErr.Error()) wrappedSafeErr := wrapOrAnnotateWithUser(wrappingErr, userID) @@ -357,7 +358,7 @@ func TestMapPushErrorToErrorWithStatus(t *testing.T) { const originalMsg = "this is an error" originalErr := errors.New(originalMsg) family := "testmetric" - labelAdapters := []mimirpb.LabelAdapter{{Name: labels.MetricName, Value: family}, {Name: "foo", Value: "biz"}} + labelAdapters := []mimirpb_custom.LabelAdapter{{Name: labels.MetricName, Value: family}, {Name: "foo", Value: "biz"}} timestamp := model.Time(1) testCases := map[string]struct { diff --git a/pkg/ingester/ingester.go b/pkg/ingester/ingester.go index e69cda6448..8b861ea81a 100644 --- a/pkg/ingester/ingester.go +++ b/pkg/ingester/ingester.go @@ -56,6 +56,7 @@ import ( asmodel "github.com/grafana/mimir/pkg/ingester/activeseries/model" "github.com/grafana/mimir/pkg/ingester/client" "github.com/grafana/mimir/pkg/mimirpb" + "github.com/grafana/mimir/pkg/mimirpb_custom" "github.com/grafana/mimir/pkg/querier/api" mimir_storage "github.com/grafana/mimir/pkg/storage" "github.com/grafana/mimir/pkg/storage/bucket" @@ -1186,31 +1187,31 @@ func (i *Ingester) PushWithCleanup(ctx context.Context, req *mimirpb.WriteReques func() { stats.failedSamplesCount++ }, - func(timestamp int64, labels []mimirpb.LabelAdapter) { + func(timestamp int64, labels []mimirpb_custom.LabelAdapter) { stats.sampleTimestampTooOldCount++ updateFirstPartial(i.errorSamplers.sampleTimestampTooOld, func() softError { return newSampleTimestampTooOldError(model.Time(timestamp), labels) }) }, - func(timestamp int64, labels []mimirpb.LabelAdapter) { + func(timestamp int64, labels []mimirpb_custom.LabelAdapter) { stats.sampleOutOfOrderCount++ updateFirstPartial(i.errorSamplers.sampleOutOfOrder, func() softError { return newSampleOutOfOrderError(model.Time(timestamp), labels) }) }, - func(timestamp int64, labels []mimirpb.LabelAdapter) { + func(timestamp int64, labels []mimirpb_custom.LabelAdapter) { stats.sampleTooOldCount++ updateFirstPartial(i.errorSamplers.sampleTimestampTooOldOOOEnabled, func() softError { return newSampleTimestampTooOldOOOEnabledError(model.Time(timestamp), labels, outOfOrderWindow) }) }, - func(timestamp int64, labels []mimirpb.LabelAdapter) { + func(timestamp int64, labels []mimirpb_custom.LabelAdapter) { stats.sampleTooFarInFutureCount++ updateFirstPartial(i.errorSamplers.sampleTimestampTooFarInFuture, func() softError { return newSampleTimestampTooFarInFutureError(model.Time(timestamp), labels) }) }, - func(timestamp int64, labels []mimirpb.LabelAdapter) { + func(timestamp int64, labels []mimirpb_custom.LabelAdapter) { stats.newValueForTimestampCount++ updateFirstPartial(i.errorSamplers.sampleDuplicateTimestamp, func() softError { return newSampleDuplicateTimestampError(model.Time(timestamp), labels) @@ -1222,44 +1223,44 @@ func (i *Ingester) PushWithCleanup(ctx context.Context, req *mimirpb.WriteReques return newPerUserSeriesLimitReachedError(i.limiter.limits.MaxGlobalSeriesPerUser(userID)) }) }, - func(labels []mimirpb.LabelAdapter) { + func(labels []mimirpb_custom.LabelAdapter) { stats.perMetricSeriesLimitCount++ updateFirstPartial(i.errorSamplers.maxSeriesPerMetricLimitExceeded, func() softError { return newPerMetricSeriesLimitReachedError(i.limiter.limits.MaxGlobalSeriesPerMetric(userID), labels) }) }, - func(err error, timestamp int64, labels []mimirpb.LabelAdapter) { + func(err error, timestamp int64, labels []mimirpb_custom.LabelAdapter) { stats.sampleOutOfOrderCount++ updateFirstPartial(i.errorSamplers.nativeHistogramValidationError, func() softError { e := newNativeHistogramValidationError(globalerror.NativeHistogramOOODisabled, err, model.Time(timestamp), labels) return e }) }, - func(err error, timestamp int64, labels []mimirpb.LabelAdapter) { + func(err error, timestamp int64, labels []mimirpb_custom.LabelAdapter) { stats.invalidNativeHistogramCount++ updateFirstPartial(i.errorSamplers.nativeHistogramValidationError, func() softError { return newNativeHistogramValidationError(globalerror.NativeHistogramCountMismatch, err, model.Time(timestamp), labels) }) }, - func(err error, timestamp int64, labels []mimirpb.LabelAdapter) { + func(err error, timestamp int64, labels []mimirpb_custom.LabelAdapter) { stats.invalidNativeHistogramCount++ updateFirstPartial(i.errorSamplers.nativeHistogramValidationError, func() softError { return newNativeHistogramValidationError(globalerror.NativeHistogramCountNotBigEnough, err, model.Time(timestamp), labels) }) }, - func(err error, timestamp int64, labels []mimirpb.LabelAdapter) { + func(err error, timestamp int64, labels []mimirpb_custom.LabelAdapter) { stats.invalidNativeHistogramCount++ updateFirstPartial(i.errorSamplers.nativeHistogramValidationError, func() softError { return newNativeHistogramValidationError(globalerror.NativeHistogramNegativeBucketCount, err, model.Time(timestamp), labels) }) }, - func(err error, timestamp int64, labels []mimirpb.LabelAdapter) { + func(err error, timestamp int64, labels []mimirpb_custom.LabelAdapter) { stats.invalidNativeHistogramCount++ updateFirstPartial(i.errorSamplers.nativeHistogramValidationError, func() softError { return newNativeHistogramValidationError(globalerror.NativeHistogramSpanNegativeOffset, err, model.Time(timestamp), labels) }) }, - func(err error, timestamp int64, labels []mimirpb.LabelAdapter) { + func(err error, timestamp int64, labels []mimirpb_custom.LabelAdapter) { stats.invalidNativeHistogramCount++ updateFirstPartial(i.errorSamplers.nativeHistogramValidationError, func() softError { return newNativeHistogramValidationError(globalerror.NativeHistogramSpansBucketsMismatch, err, model.Time(timestamp), labels) diff --git a/pkg/ingester/ingester_test.go b/pkg/ingester/ingester_test.go index 96ebf4f616..23e58b72da 100644 --- a/pkg/ingester/ingester_test.go +++ b/pkg/ingester/ingester_test.go @@ -63,6 +63,7 @@ import ( asmodel "github.com/grafana/mimir/pkg/ingester/activeseries/model" "github.com/grafana/mimir/pkg/ingester/client" "github.com/grafana/mimir/pkg/mimirpb" + "github.com/grafana/mimir/pkg/mimirpb_custom" "github.com/grafana/mimir/pkg/storage/chunk" "github.com/grafana/mimir/pkg/storage/sharding" mimir_tsdb "github.com/grafana/mimir/pkg/storage/tsdb" @@ -351,7 +352,7 @@ func TestIngester_StartReadRequest(t *testing.T) { } func TestIngester_Push(t *testing.T) { - metricLabelAdapters := []mimirpb.LabelAdapter{{Name: labels.MetricName, Value: "test"}} + metricLabelAdapters := []mimirpb_custom.LabelAdapter{{Name: labels.MetricName, Value: "test"}} metricLabelSet := mimirpb.FromLabelAdaptersToMetric(metricLabelAdapters) metricNames := []string{ "cortex_ingester_ingested_samples_total", @@ -406,7 +407,7 @@ func TestIngester_Push(t *testing.T) { "should succeed on valid series and metadata": { reqs: []*mimirpb.WriteRequest{ mimirpb.ToWriteRequest( - [][]mimirpb.LabelAdapter{metricLabelAdapters}, + [][]mimirpb_custom.LabelAdapter{metricLabelAdapters}, []mimirpb.Sample{{Value: 1, TimestampMs: 9}}, nil, []*mimirpb.MetricMetadata{ @@ -414,7 +415,7 @@ func TestIngester_Push(t *testing.T) { }, mimirpb.API), mimirpb.ToWriteRequest( - [][]mimirpb.LabelAdapter{metricLabelAdapters}, + [][]mimirpb_custom.LabelAdapter{metricLabelAdapters}, []mimirpb.Sample{{Value: 2, TimestampMs: 10}}, nil, []*mimirpb.MetricMetadata{ @@ -483,11 +484,11 @@ func TestIngester_Push(t *testing.T) { reqs: []*mimirpb.WriteRequest{ mimirpb.NewWriteRequest([]*mimirpb.MetricMetadata{ {MetricFamilyName: "metric_name_1", Help: "a help for metric_name_1", Unit: "", Type: mimirpb.HISTOGRAM}, - }, mimirpb.API).AddHistogramSeries([][]mimirpb.LabelAdapter{metricLabelAdapters}, + }, mimirpb.API).AddHistogramSeries([][]mimirpb_custom.LabelAdapter{metricLabelAdapters}, []mimirpb.Histogram{mimirpb.FromHistogramToHistogramProto(1, util_test.GenerateTestHistogram(1))}, nil), mimirpb.NewWriteRequest([]*mimirpb.MetricMetadata{ {MetricFamilyName: "metric_name_2", Help: "a help for metric_name_2", Unit: "", Type: mimirpb.GAUGEHISTOGRAM}, - }, mimirpb.API).AddHistogramSeries([][]mimirpb.LabelAdapter{metricLabelAdapters}, + }, mimirpb.API).AddHistogramSeries([][]mimirpb_custom.LabelAdapter{metricLabelAdapters}, []mimirpb.Histogram{mimirpb.FromHistogramToHistogramProto(2, util_test.GenerateTestGaugeHistogram(2))}, nil), }, expectedErr: nil, @@ -561,11 +562,11 @@ func TestIngester_Push(t *testing.T) { maxExemplars: 2, reqs: []*mimirpb.WriteRequest{ mimirpb.ToWriteRequest( - [][]mimirpb.LabelAdapter{metricLabelAdapters}, + [][]mimirpb_custom.LabelAdapter{metricLabelAdapters}, []mimirpb.Sample{{Value: 1, TimestampMs: 9}}, []*mimirpb.Exemplar{ { - Labels: []mimirpb.LabelAdapter{{Name: "traceID", Value: "123"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "traceID", Value: "123"}}, TimestampMs: 1000, Value: 1000, }, @@ -583,7 +584,7 @@ func TestIngester_Push(t *testing.T) { Labels: metricLabelAdapters, Exemplars: []mimirpb.Exemplar{ { - Labels: []mimirpb.LabelAdapter{{Name: "traceID", Value: "123"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "traceID", Value: "123"}}, TimestampMs: 1000, Value: 1000, }, @@ -667,16 +668,16 @@ func TestIngester_Push(t *testing.T) { Timeseries: []mimirpb.PreallocTimeseries{ { TimeSeries: &mimirpb.TimeSeries{ - Labels: []mimirpb.LabelAdapter{metricLabelAdapters[0]}, // Cannot reuse test slice var because it is cleared and returned to the pool + Labels: []mimirpb_custom.LabelAdapter{metricLabelAdapters[0]}, // Cannot reuse test slice var because it is cleared and returned to the pool Samples: []mimirpb.Sample{{Value: 1, TimestampMs: 9}}, }, }, { TimeSeries: &mimirpb.TimeSeries{ - Labels: []mimirpb.LabelAdapter{metricLabelAdapters[0]}, // Cannot reuse test slice var because it is cleared and returned to the pool + Labels: []mimirpb_custom.LabelAdapter{metricLabelAdapters[0]}, // Cannot reuse test slice var because it is cleared and returned to the pool Exemplars: []mimirpb.Exemplar{ { - Labels: []mimirpb.LabelAdapter{{Name: "traceID", Value: "123"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "traceID", Value: "123"}}, TimestampMs: 1000, Value: 1000, }, @@ -695,7 +696,7 @@ func TestIngester_Push(t *testing.T) { Labels: metricLabelAdapters, Exemplars: []mimirpb.Exemplar{ { - Labels: []mimirpb.LabelAdapter{{Name: "traceID", Value: "123"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "traceID", Value: "123"}}, TimestampMs: 1000, Value: 1000, }, @@ -766,18 +767,18 @@ func TestIngester_Push(t *testing.T) { maxExemplars: 2, reqs: []*mimirpb.WriteRequest{ mimirpb.ToWriteRequest( - [][]mimirpb.LabelAdapter{metricLabelAdapters}, + [][]mimirpb_custom.LabelAdapter{metricLabelAdapters}, []mimirpb.Sample{{Value: 1, TimestampMs: 9}}, nil, nil, mimirpb.API, ), mimirpb.ToWriteRequest( - [][]mimirpb.LabelAdapter{metricLabelAdapters}, + [][]mimirpb_custom.LabelAdapter{metricLabelAdapters}, []mimirpb.Sample{{Value: 2, TimestampMs: 10}}, []*mimirpb.Exemplar{ { - Labels: []mimirpb.LabelAdapter{{Name: "traceID", Value: "123"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "traceID", Value: "123"}}, TimestampMs: 1000, Value: 1000, }, @@ -795,7 +796,7 @@ func TestIngester_Push(t *testing.T) { Labels: metricLabelAdapters, Exemplars: []mimirpb.Exemplar{ { - Labels: []mimirpb.LabelAdapter{{Name: "traceID", Value: "123"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "traceID", Value: "123"}}, TimestampMs: 1000, Value: 1000, }, @@ -879,16 +880,16 @@ func TestIngester_Push(t *testing.T) { Timeseries: []mimirpb.PreallocTimeseries{ { TimeSeries: &mimirpb.TimeSeries{ - Labels: []mimirpb.LabelAdapter{metricLabelAdapters[0]}, // Cannot reuse test slice var because it is cleared and returned to the pool + Labels: []mimirpb_custom.LabelAdapter{metricLabelAdapters[0]}, // Cannot reuse test slice var because it is cleared and returned to the pool Samples: []mimirpb.Sample{{Value: 1, TimestampMs: 9}}, }, }, { TimeSeries: &mimirpb.TimeSeries{ - Labels: []mimirpb.LabelAdapter{metricLabelAdapters[0]}, // Cannot reuse test slice var because it is cleared and returned to the pool + Labels: []mimirpb_custom.LabelAdapter{metricLabelAdapters[0]}, // Cannot reuse test slice var because it is cleared and returned to the pool Exemplars: []mimirpb.Exemplar{ { - Labels: []mimirpb.LabelAdapter{{Name: "traceID", Value: "123"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "traceID", Value: "123"}}, TimestampMs: 1000, Value: 1000, }, @@ -901,10 +902,10 @@ func TestIngester_Push(t *testing.T) { Timeseries: []mimirpb.PreallocTimeseries{ { TimeSeries: &mimirpb.TimeSeries{ - Labels: []mimirpb.LabelAdapter{metricLabelAdapters[0]}, // Cannot reuse test slice var because it is cleared and returned to the pool + Labels: []mimirpb_custom.LabelAdapter{metricLabelAdapters[0]}, // Cannot reuse test slice var because it is cleared and returned to the pool Exemplars: []mimirpb.Exemplar{ { - Labels: []mimirpb.LabelAdapter{{Name: "traceID", Value: "333"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "traceID", Value: "333"}}, TimestampMs: 500, Value: 2000, }, @@ -914,7 +915,7 @@ func TestIngester_Push(t *testing.T) { }, }, }, - expectedErr: newErrorWithStatus(wrapOrAnnotateWithUser(newTSDBIngestExemplarErr(storage.ErrOutOfOrderExemplar, model.Time(500), []mimirpb.LabelAdapter{metricLabelAdapters[0]}, []mimirpb.LabelAdapter{{Name: "traceID", Value: "333"}}), userID), codes.InvalidArgument), + expectedErr: newErrorWithStatus(wrapOrAnnotateWithUser(newTSDBIngestExemplarErr(storage.ErrOutOfOrderExemplar, model.Time(500), []mimirpb_custom.LabelAdapter{metricLabelAdapters[0]}, []mimirpb_custom.LabelAdapter{{Name: "traceID", Value: "333"}}), userID), codes.InvalidArgument), expectedIngested: model.Matrix{ &model.SampleStream{Metric: metricLabelSet, Values: []model.SamplePair{{Value: 1, Timestamp: 9}}}, }, @@ -923,7 +924,7 @@ func TestIngester_Push(t *testing.T) { Labels: metricLabelAdapters, Exemplars: []mimirpb.Exemplar{ { - Labels: []mimirpb.LabelAdapter{{Name: "traceID", Value: "123"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "traceID", Value: "123"}}, TimestampMs: 1000, Value: 1000, }, @@ -1006,16 +1007,16 @@ func TestIngester_Push(t *testing.T) { Timeseries: []mimirpb.PreallocTimeseries{ { TimeSeries: &mimirpb.TimeSeries{ - Labels: []mimirpb.LabelAdapter{metricLabelAdapters[0]}, // Cannot reuse test slice var because it is cleared and returned to the pool + Labels: []mimirpb_custom.LabelAdapter{metricLabelAdapters[0]}, // Cannot reuse test slice var because it is cleared and returned to the pool Samples: []mimirpb.Sample{{Value: 1, TimestampMs: 9}}, }, }, { TimeSeries: &mimirpb.TimeSeries{ - Labels: []mimirpb.LabelAdapter{metricLabelAdapters[0]}, // Cannot reuse test slice var because it is cleared and returned to the pool + Labels: []mimirpb_custom.LabelAdapter{metricLabelAdapters[0]}, // Cannot reuse test slice var because it is cleared and returned to the pool Exemplars: []mimirpb.Exemplar{ { - Labels: []mimirpb.LabelAdapter{{Name: "traceID", Value: "123"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "traceID", Value: "123"}}, TimestampMs: 1000, Value: 1000, }, @@ -1028,10 +1029,10 @@ func TestIngester_Push(t *testing.T) { Timeseries: []mimirpb.PreallocTimeseries{ { TimeSeries: &mimirpb.TimeSeries{ - Labels: []mimirpb.LabelAdapter{metricLabelAdapters[0]}, // Cannot reuse test slice var because it is cleared and returned to the pool + Labels: []mimirpb_custom.LabelAdapter{metricLabelAdapters[0]}, // Cannot reuse test slice var because it is cleared and returned to the pool Exemplars: []mimirpb.Exemplar{ { - Labels: []mimirpb.LabelAdapter{{Name: "traceID", Value: "333"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "traceID", Value: "333"}}, TimestampMs: 500, Value: 2000, }, @@ -1050,7 +1051,7 @@ func TestIngester_Push(t *testing.T) { Labels: metricLabelAdapters, Exemplars: []mimirpb.Exemplar{ { - Labels: []mimirpb.LabelAdapter{{Name: "traceID", Value: "123"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "traceID", Value: "123"}}, TimestampMs: 1000, Value: 1000, }, @@ -1130,11 +1131,11 @@ func TestIngester_Push(t *testing.T) { nativeHistograms: true, reqs: []*mimirpb.WriteRequest{ mimirpb.NewWriteRequest(nil, mimirpb.API).AddHistogramSeries( - [][]mimirpb.LabelAdapter{metricLabelAdapters}, + [][]mimirpb_custom.LabelAdapter{metricLabelAdapters}, []mimirpb.Histogram{mimirpb.FromHistogramToHistogramProto(9, util_test.GenerateTestHistogram(1))}, []*mimirpb.Exemplar{ { - Labels: []mimirpb.LabelAdapter{{Name: "traceID", Value: "123"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "traceID", Value: "123"}}, TimestampMs: 1000, Value: 1000, }, @@ -1150,7 +1151,7 @@ func TestIngester_Push(t *testing.T) { Labels: metricLabelAdapters, Exemplars: []mimirpb.Exemplar{ { - Labels: []mimirpb.LabelAdapter{{Name: "traceID", Value: "123"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "traceID", Value: "123"}}, TimestampMs: 1000, Value: 1000, }, @@ -1241,7 +1242,7 @@ func TestIngester_Push(t *testing.T) { Timeseries: []mimirpb.PreallocTimeseries{ { TimeSeries: &mimirpb.TimeSeries{ - Labels: []mimirpb.LabelAdapter{metricLabelAdapters[0]}, // Cannot reuse test slice var because it is cleared and returned to the pool + Labels: []mimirpb_custom.LabelAdapter{metricLabelAdapters[0]}, // Cannot reuse test slice var because it is cleared and returned to the pool Histograms: []mimirpb.Histogram{ mimirpb.FromHistogramToHistogramProto(9, util_test.GenerateTestHistogram(1)), }, @@ -1249,10 +1250,10 @@ func TestIngester_Push(t *testing.T) { }, { TimeSeries: &mimirpb.TimeSeries{ - Labels: []mimirpb.LabelAdapter{metricLabelAdapters[0]}, // Cannot reuse test slice var because it is cleared and returned to the pool + Labels: []mimirpb_custom.LabelAdapter{metricLabelAdapters[0]}, // Cannot reuse test slice var because it is cleared and returned to the pool Exemplars: []mimirpb.Exemplar{ { - Labels: []mimirpb.LabelAdapter{{Name: "traceID", Value: "123"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "traceID", Value: "123"}}, TimestampMs: 1000, Value: 1000, }, @@ -1271,7 +1272,7 @@ func TestIngester_Push(t *testing.T) { Labels: metricLabelAdapters, Exemplars: []mimirpb.Exemplar{ { - Labels: []mimirpb.LabelAdapter{{Name: "traceID", Value: "123"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "traceID", Value: "123"}}, TimestampMs: 1000, Value: 1000, }, @@ -1359,16 +1360,16 @@ func TestIngester_Push(t *testing.T) { nativeHistograms: true, reqs: []*mimirpb.WriteRequest{ mimirpb.NewWriteRequest(nil, mimirpb.API).AddHistogramSeries( - [][]mimirpb.LabelAdapter{metricLabelAdapters}, + [][]mimirpb_custom.LabelAdapter{metricLabelAdapters}, []mimirpb.Histogram{mimirpb.FromHistogramToHistogramProto(9, util_test.GenerateTestHistogram(1))}, nil, ), mimirpb.NewWriteRequest(nil, mimirpb.API).AddHistogramSeries( - [][]mimirpb.LabelAdapter{metricLabelAdapters}, + [][]mimirpb_custom.LabelAdapter{metricLabelAdapters}, []mimirpb.Histogram{mimirpb.FromHistogramToHistogramProto(10, util_test.GenerateTestHistogram(2))}, []*mimirpb.Exemplar{ { - Labels: []mimirpb.LabelAdapter{{Name: "traceID", Value: "123"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "traceID", Value: "123"}}, TimestampMs: 1000, Value: 1000, }, @@ -1387,7 +1388,7 @@ func TestIngester_Push(t *testing.T) { Labels: metricLabelAdapters, Exemplars: []mimirpb.Exemplar{ { - Labels: []mimirpb.LabelAdapter{{Name: "traceID", Value: "123"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "traceID", Value: "123"}}, TimestampMs: 1000, Value: 1000, }, @@ -1475,23 +1476,23 @@ func TestIngester_Push(t *testing.T) { nativeHistograms: true, reqs: []*mimirpb.WriteRequest{ mimirpb.NewWriteRequest(nil, mimirpb.API).AddHistogramSeries( - [][]mimirpb.LabelAdapter{metricLabelAdapters}, + [][]mimirpb_custom.LabelAdapter{metricLabelAdapters}, []mimirpb.Histogram{mimirpb.FromHistogramToHistogramProto(9, util_test.GenerateTestHistogram(1))}, nil, ), mimirpb.NewWriteRequest(nil, mimirpb.API).AddHistogramSeries( - [][]mimirpb.LabelAdapter{metricLabelAdapters}, + [][]mimirpb_custom.LabelAdapter{metricLabelAdapters}, []mimirpb.Histogram{mimirpb.FromHistogramToHistogramProto(10, util_test.GenerateTestHistogram(2))}, nil, ).AddExemplarsAt(0, // Add exemplars to the first series. []*mimirpb.Exemplar{ { - Labels: []mimirpb.LabelAdapter{{Name: "traceID", Value: "123"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "traceID", Value: "123"}}, TimestampMs: 1000, Value: 1000, }, { - Labels: []mimirpb.LabelAdapter{{Name: "traceID", Value: "456"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "traceID", Value: "456"}}, TimestampMs: 2000, Value: 2000, }, @@ -1510,12 +1511,12 @@ func TestIngester_Push(t *testing.T) { Labels: metricLabelAdapters, Exemplars: []mimirpb.Exemplar{ { - Labels: []mimirpb.LabelAdapter{{Name: "traceID", Value: "123"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "traceID", Value: "123"}}, TimestampMs: 1000, Value: 1000, }, { - Labels: []mimirpb.LabelAdapter{{Name: "traceID", Value: "456"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "traceID", Value: "456"}}, TimestampMs: 2000, Value: 2000, }, @@ -1603,44 +1604,44 @@ func TestIngester_Push(t *testing.T) { nativeHistograms: true, reqs: []*mimirpb.WriteRequest{ mimirpb.NewWriteRequest(nil, mimirpb.API).AddHistogramSeries( - [][]mimirpb.LabelAdapter{metricLabelAdapters}, + [][]mimirpb_custom.LabelAdapter{metricLabelAdapters}, []mimirpb.Histogram{mimirpb.FromHistogramToHistogramProto(9, util_test.GenerateTestHistogram(1))}, nil, ).AddExemplarsAt(0, // Add exemplars to the first series. []*mimirpb.Exemplar{ { - Labels: []mimirpb.LabelAdapter{{Name: "traceID", Value: "123"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "traceID", Value: "123"}}, TimestampMs: 1000, Value: 1000, }, { - Labels: []mimirpb.LabelAdapter{{Name: "traceID", Value: "456"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "traceID", Value: "456"}}, TimestampMs: 2000, Value: 2000, }, }, ), mimirpb.NewWriteRequest(nil, mimirpb.API).AddHistogramSeries( - [][]mimirpb.LabelAdapter{metricLabelAdapters}, + [][]mimirpb_custom.LabelAdapter{metricLabelAdapters}, []mimirpb.Histogram{mimirpb.FromHistogramToHistogramProto(10, util_test.GenerateTestHistogram(2))}, nil, ).AddExemplarsAt(0, // Add exemplars to the first series. []*mimirpb.Exemplar{ { // This will never be ingested/appeneded as it is out of order. - Labels: []mimirpb.LabelAdapter{{Name: "traceID", Value: "333"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "traceID", Value: "333"}}, TimestampMs: 1500, Value: 1500, }, { // This is appended as duplicate. - Labels: []mimirpb.LabelAdapter{{Name: "traceID", Value: "456"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "traceID", Value: "456"}}, TimestampMs: 2000, Value: 2000, }, { // This is appended as new exemplar and pushes out the oldest exemplar. - Labels: []mimirpb.LabelAdapter{{Name: "traceID", Value: "789"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "traceID", Value: "789"}}, TimestampMs: 3000, Value: 3000, }, @@ -1659,12 +1660,12 @@ func TestIngester_Push(t *testing.T) { Labels: metricLabelAdapters, Exemplars: []mimirpb.Exemplar{ { - Labels: []mimirpb.LabelAdapter{{Name: "traceID", Value: "456"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "traceID", Value: "456"}}, TimestampMs: 2000, Value: 2000, }, { - Labels: []mimirpb.LabelAdapter{{Name: "traceID", Value: "789"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "traceID", Value: "789"}}, TimestampMs: 3000, Value: 3000, }, @@ -1677,13 +1678,13 @@ func TestIngester_Push(t *testing.T) { Exemplars: []mimirpb.Exemplar{ { // This examplar is dropped due to the max exemplar limit. - Labels: []mimirpb.LabelAdapter{{Name: "traceID", Value: "123"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "traceID", Value: "123"}}, TimestampMs: 1000, Value: 1000, }, { // This example is ignored as equal to the previous one. - Labels: []mimirpb.LabelAdapter{{Name: "traceID", Value: "456"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "traceID", Value: "456"}}, TimestampMs: 2000, Value: 2000, }, @@ -1770,13 +1771,13 @@ func TestIngester_Push(t *testing.T) { nativeHistograms: true, reqs: []*mimirpb.WriteRequest{ mimirpb.NewWriteRequest(nil, mimirpb.API).AddHistogramSeries( - [][]mimirpb.LabelAdapter{metricLabelAdapters}, + [][]mimirpb_custom.LabelAdapter{metricLabelAdapters}, []mimirpb.Histogram{mimirpb.FromHistogramToHistogramProto(10, histogramWithBucketCountMismatch)}, nil, ), }, // Expect the error string instead of constructing the error to catch if Prometheus changes the error message. - expectedErr: newErrorWithStatus(wrapOrAnnotateWithUser(newNativeHistogramValidationError(globalerror.NativeHistogramCountMismatch, fmt.Errorf("21 observations found in buckets, but the Count field is 22: histogram's observation count should equal the number of observations found in the buckets (in absence of NaN)"), model.Time(10), []mimirpb.LabelAdapter{metricLabelAdapters[0]}), userID), codes.InvalidArgument), + expectedErr: newErrorWithStatus(wrapOrAnnotateWithUser(newNativeHistogramValidationError(globalerror.NativeHistogramCountMismatch, fmt.Errorf("21 observations found in buckets, but the Count field is 22: histogram's observation count should equal the number of observations found in the buckets (in absence of NaN)"), model.Time(10), []mimirpb_custom.LabelAdapter{metricLabelAdapters[0]}), userID), codes.InvalidArgument), expectedMetrics: ` # HELP cortex_ingester_ingested_samples_total The total number of samples ingested per user. # TYPE cortex_ingester_ingested_samples_total counter @@ -1811,13 +1812,13 @@ func TestIngester_Push(t *testing.T) { nativeHistograms: true, reqs: []*mimirpb.WriteRequest{ mimirpb.NewWriteRequest(nil, mimirpb.API).AddHistogramSeries( - [][]mimirpb.LabelAdapter{metricLabelAdapters}, + [][]mimirpb_custom.LabelAdapter{metricLabelAdapters}, []mimirpb.Histogram{mimirpb.FromHistogramToHistogramProto(10, histogramWithCountNotBigEnough)}, nil, ), }, // Expect the error string instead of constructing the error to catch if Prometheus changes the error message. - expectedErr: newErrorWithStatus(wrapOrAnnotateWithUser(newNativeHistogramValidationError(globalerror.NativeHistogramCountNotBigEnough, fmt.Errorf("21 observations found in buckets, but the Count field is 20: histogram's observation count should be at least the number of observations found in the buckets"), model.Time(10), []mimirpb.LabelAdapter{metricLabelAdapters[0]}), userID), codes.InvalidArgument), + expectedErr: newErrorWithStatus(wrapOrAnnotateWithUser(newNativeHistogramValidationError(globalerror.NativeHistogramCountNotBigEnough, fmt.Errorf("21 observations found in buckets, but the Count field is 20: histogram's observation count should be at least the number of observations found in the buckets"), model.Time(10), []mimirpb_custom.LabelAdapter{metricLabelAdapters[0]}), userID), codes.InvalidArgument), expectedMetrics: ` # HELP cortex_ingester_ingested_samples_total The total number of samples ingested per user. # TYPE cortex_ingester_ingested_samples_total counter @@ -1852,13 +1853,13 @@ func TestIngester_Push(t *testing.T) { nativeHistograms: true, reqs: []*mimirpb.WriteRequest{ mimirpb.NewWriteRequest(nil, mimirpb.API).AddHistogramSeries( - [][]mimirpb.LabelAdapter{metricLabelAdapters}, + [][]mimirpb_custom.LabelAdapter{metricLabelAdapters}, []mimirpb.Histogram{mimirpb.FromHistogramToHistogramProto(10, histogramWithSpanNegativeOffset)}, nil, ), }, // Expect the error string instead of constructing the error to catch if Prometheus changes the error message. - expectedErr: newErrorWithStatus(wrapOrAnnotateWithUser(newNativeHistogramValidationError(globalerror.NativeHistogramSpanNegativeOffset, fmt.Errorf("positive side: span number 2 with offset -2: histogram has a span whose offset is negative"), model.Time(10), []mimirpb.LabelAdapter{metricLabelAdapters[0]}), userID), codes.InvalidArgument), + expectedErr: newErrorWithStatus(wrapOrAnnotateWithUser(newNativeHistogramValidationError(globalerror.NativeHistogramSpanNegativeOffset, fmt.Errorf("positive side: span number 2 with offset -2: histogram has a span whose offset is negative"), model.Time(10), []mimirpb_custom.LabelAdapter{metricLabelAdapters[0]}), userID), codes.InvalidArgument), expectedMetrics: ` # HELP cortex_ingester_ingested_samples_total The total number of samples ingested per user. # TYPE cortex_ingester_ingested_samples_total counter @@ -1893,13 +1894,13 @@ func TestIngester_Push(t *testing.T) { nativeHistograms: true, reqs: []*mimirpb.WriteRequest{ mimirpb.NewWriteRequest(nil, mimirpb.API).AddHistogramSeries( - [][]mimirpb.LabelAdapter{metricLabelAdapters}, + [][]mimirpb_custom.LabelAdapter{metricLabelAdapters}, []mimirpb.Histogram{mimirpb.FromHistogramToHistogramProto(10, histogramWithSpansBucketsMismatch)}, nil, ), }, // Expect the error string instead of constructing the error to catch if Prometheus changes the error message. - expectedErr: newErrorWithStatus(wrapOrAnnotateWithUser(newNativeHistogramValidationError(globalerror.NativeHistogramSpansBucketsMismatch, fmt.Errorf("positive side: spans need 5 buckets, have 4 buckets: histogram spans specify different number of buckets than provided"), model.Time(10), []mimirpb.LabelAdapter{metricLabelAdapters[0]}), userID), codes.InvalidArgument), + expectedErr: newErrorWithStatus(wrapOrAnnotateWithUser(newNativeHistogramValidationError(globalerror.NativeHistogramSpansBucketsMismatch, fmt.Errorf("positive side: spans need 5 buckets, have 4 buckets: histogram spans specify different number of buckets than provided"), model.Time(10), []mimirpb_custom.LabelAdapter{metricLabelAdapters[0]}), userID), codes.InvalidArgument), expectedMetrics: ` # HELP cortex_ingester_ingested_samples_total The total number of samples ingested per user. # TYPE cortex_ingester_ingested_samples_total counter @@ -1935,17 +1936,17 @@ func TestIngester_Push(t *testing.T) { disableOOONativeHistograms: true, reqs: []*mimirpb.WriteRequest{ mimirpb.NewWriteRequest(nil, mimirpb.API).AddHistogramSeries( - [][]mimirpb.LabelAdapter{metricLabelAdapters}, + [][]mimirpb_custom.LabelAdapter{metricLabelAdapters}, []mimirpb.Histogram{mimirpb.FromHistogramToHistogramProto(10, util_test.GenerateTestHistogram(1))}, nil, ), mimirpb.NewWriteRequest(nil, mimirpb.API).AddHistogramSeries( - [][]mimirpb.LabelAdapter{metricLabelAdapters}, + [][]mimirpb_custom.LabelAdapter{metricLabelAdapters}, []mimirpb.Histogram{mimirpb.FromHistogramToHistogramProto(-10, util_test.GenerateTestHistogram(1))}, nil, ), }, - expectedErr: newErrorWithStatus(wrapOrAnnotateWithUser(newNativeHistogramValidationError(globalerror.NativeHistogramOOODisabled, fmt.Errorf("out-of-order native histogram ingestion is disabled"), model.Time(-10), []mimirpb.LabelAdapter{metricLabelAdapters[0]}), userID), codes.InvalidArgument), + expectedErr: newErrorWithStatus(wrapOrAnnotateWithUser(newNativeHistogramValidationError(globalerror.NativeHistogramOOODisabled, fmt.Errorf("out-of-order native histogram ingestion is disabled"), model.Time(-10), []mimirpb_custom.LabelAdapter{metricLabelAdapters[0]}), userID), codes.InvalidArgument), expectedMetrics: ` # HELP cortex_ingester_ingested_samples_total The total number of samples ingested per user. # TYPE cortex_ingester_ingested_samples_total counter @@ -1994,13 +1995,13 @@ func TestIngester_Push(t *testing.T) { nativeHistograms: true, reqs: []*mimirpb.WriteRequest{ mimirpb.NewWriteRequest(nil, mimirpb.API).AddHistogramSeries( - [][]mimirpb.LabelAdapter{metricLabelAdapters}, + [][]mimirpb_custom.LabelAdapter{metricLabelAdapters}, []mimirpb.Histogram{mimirpb.FromHistogramToHistogramProto(10, histogramWithNegativeBucketCount)}, nil, ), }, // Expect the error string instead of constructing the error to catch if Prometheus changes the error message. - expectedErr: newErrorWithStatus(wrapOrAnnotateWithUser(newNativeHistogramValidationError(globalerror.NativeHistogramNegativeBucketCount, fmt.Errorf("negative side: bucket number 2 has observation count of -98: histogram has a bucket whose observation count is negative"), model.Time(10), []mimirpb.LabelAdapter{metricLabelAdapters[0]}), userID), codes.InvalidArgument), + expectedErr: newErrorWithStatus(wrapOrAnnotateWithUser(newNativeHistogramValidationError(globalerror.NativeHistogramNegativeBucketCount, fmt.Errorf("negative side: bucket number 2 has observation count of -98: histogram has a bucket whose observation count is negative"), model.Time(10), []mimirpb_custom.LabelAdapter{metricLabelAdapters[0]}), userID), codes.InvalidArgument), expectedMetrics: ` # HELP cortex_ingester_ingested_samples_total The total number of samples ingested per user. # TYPE cortex_ingester_ingested_samples_total counter @@ -2036,45 +2037,45 @@ func TestIngester_Push(t *testing.T) { nativeHistograms: true, reqs: []*mimirpb.WriteRequest{ mimirpb.NewWriteRequest(nil, mimirpb.API).AddHistogramSeries( - [][]mimirpb.LabelAdapter{metricLabelAdapters}, + [][]mimirpb_custom.LabelAdapter{metricLabelAdapters}, []mimirpb.Histogram{mimirpb.FromHistogramToHistogramProto(9, util_test.GenerateTestHistogram(1))}, nil, ).AddExemplarsAt(0, // Add exemplars to the first series. []*mimirpb.Exemplar{ { - Labels: []mimirpb.LabelAdapter{{Name: "traceID", Value: "123"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "traceID", Value: "123"}}, TimestampMs: 1000, Value: 1000, }, { - Labels: []mimirpb.LabelAdapter{{Name: "traceID", Value: "456"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "traceID", Value: "456"}}, TimestampMs: 2000, Value: 2000, }, }, ), mimirpb.NewWriteRequest(nil, mimirpb.API).AddHistogramSeries( - [][]mimirpb.LabelAdapter{metricLabelAdapters}, + [][]mimirpb_custom.LabelAdapter{metricLabelAdapters}, []mimirpb.Histogram{mimirpb.FromHistogramToHistogramProto(10, util_test.GenerateTestHistogram(2))}, nil, ).AddExemplarsAt(0, // Add exemplars to the first series. []*mimirpb.Exemplar{ { // This will never be ingested/appeneded as it is out of order. - Labels: []mimirpb.LabelAdapter{{Name: "traceID", Value: "123"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "traceID", Value: "123"}}, TimestampMs: 1000, Value: 1000, }, { // This will never be ingested/appeneded as it is out of order. - Labels: []mimirpb.LabelAdapter{{Name: "traceID", Value: "333"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "traceID", Value: "333"}}, TimestampMs: 1500, Value: 1500, }, }, ), }, - expectedErr: newErrorWithStatus(wrapOrAnnotateWithUser(newTSDBIngestExemplarErr(storage.ErrOutOfOrderExemplar, model.Time(1500), []mimirpb.LabelAdapter{metricLabelAdapters[0]}, []mimirpb.LabelAdapter{{Name: "traceID", Value: "333"}}), userID), codes.InvalidArgument), + expectedErr: newErrorWithStatus(wrapOrAnnotateWithUser(newTSDBIngestExemplarErr(storage.ErrOutOfOrderExemplar, model.Time(1500), []mimirpb_custom.LabelAdapter{metricLabelAdapters[0]}, []mimirpb_custom.LabelAdapter{{Name: "traceID", Value: "333"}}), userID), codes.InvalidArgument), expectedIngested: model.Matrix{ &model.SampleStream{Metric: metricLabelSet, Histograms: []model.SampleHistogramPair{ {Histogram: mimirpb.FromHistogramToPromHistogram(util_test.GenerateTestHistogram(1)), Timestamp: 9}, @@ -2086,12 +2087,12 @@ func TestIngester_Push(t *testing.T) { Labels: metricLabelAdapters, Exemplars: []mimirpb.Exemplar{ { - Labels: []mimirpb.LabelAdapter{{Name: "traceID", Value: "123"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "traceID", Value: "123"}}, TimestampMs: 1000, Value: 1000, }, { - Labels: []mimirpb.LabelAdapter{{Name: "traceID", Value: "456"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "traceID", Value: "456"}}, TimestampMs: 2000, Value: 2000, }, @@ -2180,38 +2181,38 @@ func TestIngester_Push(t *testing.T) { ignoreOOOExemplars: true, reqs: []*mimirpb.WriteRequest{ mimirpb.NewWriteRequest(nil, mimirpb.API).AddHistogramSeries( - [][]mimirpb.LabelAdapter{metricLabelAdapters}, + [][]mimirpb_custom.LabelAdapter{metricLabelAdapters}, []mimirpb.Histogram{mimirpb.FromHistogramToHistogramProto(9, util_test.GenerateTestHistogram(1))}, nil, ).AddExemplarsAt(0, // Add exemplars to the first series. []*mimirpb.Exemplar{ { - Labels: []mimirpb.LabelAdapter{{Name: "traceID", Value: "123"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "traceID", Value: "123"}}, TimestampMs: 1000, Value: 1000, }, { - Labels: []mimirpb.LabelAdapter{{Name: "traceID", Value: "456"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "traceID", Value: "456"}}, TimestampMs: 2000, Value: 2000, }, }, ), mimirpb.NewWriteRequest(nil, mimirpb.API).AddHistogramSeries( - [][]mimirpb.LabelAdapter{metricLabelAdapters}, + [][]mimirpb_custom.LabelAdapter{metricLabelAdapters}, []mimirpb.Histogram{mimirpb.FromHistogramToHistogramProto(10, util_test.GenerateTestHistogram(2))}, nil, ).AddExemplarsAt(0, // Add exemplars to the first series. []*mimirpb.Exemplar{ { // This will never be ingested/appeneded as it is out of order. - Labels: []mimirpb.LabelAdapter{{Name: "traceID", Value: "123"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "traceID", Value: "123"}}, TimestampMs: 1000, Value: 1000, }, { // This will never be ingested/appeneded as it is out of order. - Labels: []mimirpb.LabelAdapter{{Name: "traceID", Value: "333"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "traceID", Value: "333"}}, TimestampMs: 1500, Value: 1500, }, @@ -2230,12 +2231,12 @@ func TestIngester_Push(t *testing.T) { Labels: metricLabelAdapters, Exemplars: []mimirpb.Exemplar{ { - Labels: []mimirpb.LabelAdapter{{Name: "traceID", Value: "123"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "traceID", Value: "123"}}, TimestampMs: 1000, Value: 1000, }, { - Labels: []mimirpb.LabelAdapter{{Name: "traceID", Value: "456"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "traceID", Value: "456"}}, TimestampMs: 2000, Value: 2000, }, @@ -2322,13 +2323,13 @@ func TestIngester_Push(t *testing.T) { disableActiveSeries: true, reqs: []*mimirpb.WriteRequest{ mimirpb.ToWriteRequest( - [][]mimirpb.LabelAdapter{metricLabelAdapters}, + [][]mimirpb_custom.LabelAdapter{metricLabelAdapters}, []mimirpb.Sample{{Value: 1, TimestampMs: 9}}, nil, nil, mimirpb.API), mimirpb.ToWriteRequest( - [][]mimirpb.LabelAdapter{metricLabelAdapters}, + [][]mimirpb_custom.LabelAdapter{metricLabelAdapters}, []mimirpb.Sample{{Value: 2, TimestampMs: 10}}, nil, nil, @@ -2368,14 +2369,14 @@ func TestIngester_Push(t *testing.T) { "should soft fail on sample out-of-order": { reqs: []*mimirpb.WriteRequest{ mimirpb.ToWriteRequest( - [][]mimirpb.LabelAdapter{metricLabelAdapters}, + [][]mimirpb_custom.LabelAdapter{metricLabelAdapters}, []mimirpb.Sample{{Value: 2, TimestampMs: 10}}, nil, nil, mimirpb.API, ), mimirpb.ToWriteRequest( - [][]mimirpb.LabelAdapter{metricLabelAdapters}, + [][]mimirpb_custom.LabelAdapter{metricLabelAdapters}, []mimirpb.Sample{{Value: 1, TimestampMs: 9}}, nil, nil, @@ -2422,7 +2423,7 @@ func TestIngester_Push(t *testing.T) { "should soft fail on all samples out of bound in a write request": { reqs: []*mimirpb.WriteRequest{ mimirpb.ToWriteRequest( - [][]mimirpb.LabelAdapter{metricLabelAdapters}, + [][]mimirpb_custom.LabelAdapter{metricLabelAdapters}, []mimirpb.Sample{{Value: 2, TimestampMs: 1575043969}}, nil, nil, @@ -2480,7 +2481,7 @@ func TestIngester_Push(t *testing.T) { "should soft fail on all samples with histograms out of bound in a write request": { reqs: []*mimirpb.WriteRequest{ mimirpb.ToWriteRequest( - [][]mimirpb.LabelAdapter{metricLabelAdapters}, + [][]mimirpb_custom.LabelAdapter{metricLabelAdapters}, []mimirpb.Sample{{Value: 2, TimestampMs: 1575043969}}, nil, nil, @@ -2540,7 +2541,7 @@ func TestIngester_Push(t *testing.T) { "should succeed if histograms are out of bound but samples are not and histograms are not accepted": { reqs: []*mimirpb.WriteRequest{ mimirpb.ToWriteRequest( - [][]mimirpb.LabelAdapter{metricLabelAdapters}, + [][]mimirpb_custom.LabelAdapter{metricLabelAdapters}, []mimirpb.Sample{{Value: 2, TimestampMs: 1575043969}}, nil, nil, @@ -2597,7 +2598,7 @@ func TestIngester_Push(t *testing.T) { "should soft fail on some samples out of bound in a write request": { reqs: []*mimirpb.WriteRequest{ mimirpb.ToWriteRequest( - [][]mimirpb.LabelAdapter{metricLabelAdapters}, + [][]mimirpb_custom.LabelAdapter{metricLabelAdapters}, []mimirpb.Sample{{Value: 2, TimestampMs: 1575043969}}, nil, nil, @@ -2658,7 +2659,7 @@ func TestIngester_Push(t *testing.T) { "should soft fail on some samples with timestamp too far in future in a write request": { reqs: []*mimirpb.WriteRequest{ mimirpb.ToWriteRequest( - [][]mimirpb.LabelAdapter{metricLabelAdapters}, + [][]mimirpb_custom.LabelAdapter{metricLabelAdapters}, []mimirpb.Sample{{Value: 1, TimestampMs: now.UnixMilli()}}, nil, nil, @@ -2789,15 +2790,15 @@ func TestIngester_Push(t *testing.T) { Samples: []mimirpb.Sample{ {Value: 1, TimestampMs: now.UnixMilli()}}, Exemplars: []mimirpb.Exemplar{ - {Labels: []mimirpb.LabelAdapter{{Name: "traceID", Value: "111"}}, Value: 1, TimestampMs: now.UnixMilli()}, - {Labels: []mimirpb.LabelAdapter{{Name: "traceID", Value: "222"}}, Value: 2, TimestampMs: now.UnixMilli() + (86400 * 1000)}, + {Labels: []mimirpb_custom.LabelAdapter{{Name: "traceID", Value: "111"}}, Value: 1, TimestampMs: now.UnixMilli()}, + {Labels: []mimirpb_custom.LabelAdapter{{Name: "traceID", Value: "222"}}, Value: 2, TimestampMs: now.UnixMilli() + (86400 * 1000)}, }, }, }, }, }, }, - expectedErr: newErrorWithStatus(wrapOrAnnotateWithUser(newExemplarTimestampTooFarInFutureError(model.Time(now.UnixMilli()+(86400*1000)), metricLabelAdapters, []mimirpb.LabelAdapter{{Name: "traceID", Value: "222"}}), userID), codes.InvalidArgument), + expectedErr: newErrorWithStatus(wrapOrAnnotateWithUser(newExemplarTimestampTooFarInFutureError(model.Time(now.UnixMilli()+(86400*1000)), metricLabelAdapters, []mimirpb_custom.LabelAdapter{{Name: "traceID", Value: "222"}}), userID), codes.InvalidArgument), expectedIngested: model.Matrix{ &model.SampleStream{ Metric: metricLabelSet, @@ -2810,7 +2811,7 @@ func TestIngester_Push(t *testing.T) { { Labels: metricLabelAdapters, Exemplars: []mimirpb.Exemplar{ - {Labels: []mimirpb.LabelAdapter{{Name: "traceID", Value: "111"}}, TimestampMs: now.UnixMilli(), Value: 1}, + {Labels: []mimirpb_custom.LabelAdapter{{Name: "traceID", Value: "111"}}, TimestampMs: now.UnixMilli(), Value: 1}, }, }, }, @@ -2857,14 +2858,14 @@ func TestIngester_Push(t *testing.T) { "should soft fail on two different sample values at the same timestamp": { reqs: []*mimirpb.WriteRequest{ mimirpb.ToWriteRequest( - [][]mimirpb.LabelAdapter{metricLabelAdapters}, + [][]mimirpb_custom.LabelAdapter{metricLabelAdapters}, []mimirpb.Sample{{Value: 2, TimestampMs: 1575043969}}, nil, nil, mimirpb.API, ), mimirpb.ToWriteRequest( - [][]mimirpb.LabelAdapter{metricLabelAdapters}, + [][]mimirpb_custom.LabelAdapter{metricLabelAdapters}, []mimirpb.Sample{{Value: 1, TimestampMs: 1575043969}}, nil, nil, @@ -2917,10 +2918,10 @@ func TestIngester_Push(t *testing.T) { Timeseries: []mimirpb.PreallocTimeseries{ { TimeSeries: &mimirpb.TimeSeries{ - Labels: []mimirpb.LabelAdapter{metricLabelAdapters[0]}, // Cannot reuse test slice var because it is cleared and returned to the pool + Labels: []mimirpb_custom.LabelAdapter{metricLabelAdapters[0]}, // Cannot reuse test slice var because it is cleared and returned to the pool Exemplars: []mimirpb.Exemplar{ { - Labels: []mimirpb.LabelAdapter{{Name: "traceID", Value: "123"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "traceID", Value: "123"}}, TimestampMs: 1000, Value: 1000, }, @@ -2930,7 +2931,7 @@ func TestIngester_Push(t *testing.T) { }, }, }, - expectedErr: newErrorWithStatus(wrapOrAnnotateWithUser(newExemplarMissingSeriesError(model.Time(1000), metricLabelAdapters, []mimirpb.LabelAdapter{{Name: "traceID", Value: "123"}}), userID), codes.InvalidArgument), + expectedErr: newErrorWithStatus(wrapOrAnnotateWithUser(newExemplarMissingSeriesError(model.Time(1000), metricLabelAdapters, []mimirpb_custom.LabelAdapter{{Name: "traceID", Value: "123"}}), userID), codes.InvalidArgument), expectedIngested: nil, expectedMetadataIngested: nil, additionalMetrics: []string{ @@ -3008,10 +3009,10 @@ func TestIngester_Push(t *testing.T) { Timeseries: []mimirpb.PreallocTimeseries{ { TimeSeries: &mimirpb.TimeSeries{ - Labels: []mimirpb.LabelAdapter{metricLabelAdapters[0]}, // Cannot reuse test slice var because it is cleared and returned to the pool + Labels: []mimirpb_custom.LabelAdapter{metricLabelAdapters[0]}, // Cannot reuse test slice var because it is cleared and returned to the pool Exemplars: []mimirpb.Exemplar{ { - Labels: []mimirpb.LabelAdapter{{Name: "traceID", Value: "123"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "traceID", Value: "123"}}, TimestampMs: 1000, Value: 1000, }, @@ -3020,14 +3021,14 @@ func TestIngester_Push(t *testing.T) { }, { TimeSeries: &mimirpb.TimeSeries{ - Labels: []mimirpb.LabelAdapter{metricLabelAdapters[0]}, // Cannot reuse test slice var because it is cleared and returned to the pool + Labels: []mimirpb_custom.LabelAdapter{metricLabelAdapters[0]}, // Cannot reuse test slice var because it is cleared and returned to the pool Samples: []mimirpb.Sample{{Value: 1, TimestampMs: 9}}, }, }, }, }, }, - expectedErr: newErrorWithStatus(wrapOrAnnotateWithUser(newExemplarMissingSeriesError(model.Time(1000), metricLabelAdapters, []mimirpb.LabelAdapter{{Name: "traceID", Value: "123"}}), userID), codes.InvalidArgument), + expectedErr: newErrorWithStatus(wrapOrAnnotateWithUser(newExemplarMissingSeriesError(model.Time(1000), metricLabelAdapters, []mimirpb_custom.LabelAdapter{{Name: "traceID", Value: "123"}}), userID), codes.InvalidArgument), expectedIngested: model.Matrix{ &model.SampleStream{Metric: metricLabelSet, Values: []model.SamplePair{{Value: 1, Timestamp: 9}}}, }, @@ -3399,8 +3400,8 @@ func TestIngester_Push(t *testing.T) { } func TestIngester_Push_ShouldCorrectlyTrackMetricsInMultiTenantScenario(t *testing.T) { - metricLabelAdapters := [][]mimirpb.LabelAdapter{{{Name: labels.MetricName, Value: "test"}}} - metricLabelAdaptersHist := [][]mimirpb.LabelAdapter{{{Name: labels.MetricName, Value: "test_histogram"}}} + metricLabelAdapters := [][]mimirpb_custom.LabelAdapter{{{Name: labels.MetricName, Value: "test"}}} + metricLabelAdaptersHist := [][]mimirpb_custom.LabelAdapter{{{Name: labels.MetricName, Value: "test_histogram"}}} metricNames := []string{ "cortex_ingester_ingested_samples_total", "cortex_ingester_ingested_samples_failures_total", @@ -3511,8 +3512,8 @@ func TestIngester_Push_ShouldCorrectlyTrackMetricsInMultiTenantScenario(t *testi } func TestIngester_Push_DecreaseInactiveSeries(t *testing.T) { - metricLabelAdapters := [][]mimirpb.LabelAdapter{{{Name: labels.MetricName, Value: "test"}}} - metricLabelAdaptersHist := [][]mimirpb.LabelAdapter{{{Name: labels.MetricName, Value: "test_histogram"}}} + metricLabelAdapters := [][]mimirpb_custom.LabelAdapter{{{Name: labels.MetricName, Value: "test"}}} + metricLabelAdaptersHist := [][]mimirpb_custom.LabelAdapter{{{Name: labels.MetricName, Value: "test_histogram"}}} metricNames := []string{ "cortex_ingester_memory_series_created_total", "cortex_ingester_memory_series_removed_total", @@ -3606,7 +3607,7 @@ func BenchmarkIngesterPush(b *testing.B) { }) // Push a single time series to set the TSDB min time. - metricLabelAdapters := [][]mimirpb.LabelAdapter{{{Name: labels.MetricName, Value: "test"}}} + metricLabelAdapters := [][]mimirpb_custom.LabelAdapter{{{Name: labels.MetricName, Value: "test"}}} startTime := util.TimeToMillis(time.Now()) currTimeReq := mimirpb.ToWriteRequest( @@ -3684,14 +3685,14 @@ func Benchmark_Ingester_PushOnError(b *testing.B) { // If this returns false, test is skipped. prepareConfig func(limits *validation.Limits, instanceLimits *InstanceLimits) bool beforeBenchmark func(b *testing.B, ingester *Ingester, numSeriesPerRequest int) - runBenchmark func(b *testing.B, ingester *Ingester, metrics [][]mimirpb.LabelAdapter, samples []mimirpb.Sample) + runBenchmark func(b *testing.B, ingester *Ingester, metrics [][]mimirpb_custom.LabelAdapter, samples []mimirpb.Sample) }{ "out of bound samples": { prepareConfig: func(*validation.Limits, *InstanceLimits) bool { return true }, beforeBenchmark: func(b *testing.B, ingester *Ingester, _ int) { // Push a single time series to set the TSDB min time. currTimeReq := mimirpb.ToWriteRequest( - [][]mimirpb.LabelAdapter{{{Name: labels.MetricName, Value: metricName}}}, + [][]mimirpb_custom.LabelAdapter{{{Name: labels.MetricName, Value: metricName}}}, []mimirpb.Sample{{Value: 1, TimestampMs: util.TimeToMillis(time.Now())}}, nil, nil, @@ -3700,7 +3701,7 @@ func Benchmark_Ingester_PushOnError(b *testing.B) { _, err := ingester.Push(ctx, currTimeReq) require.NoError(b, err) }, - runBenchmark: func(b *testing.B, ingester *Ingester, metrics [][]mimirpb.LabelAdapter, samples []mimirpb.Sample) { + runBenchmark: func(b *testing.B, ingester *Ingester, metrics [][]mimirpb_custom.LabelAdapter, samples []mimirpb.Sample) { expectedErr := storage.ErrOutOfBounds.Error() // Push out of bound samples. @@ -3717,7 +3718,7 @@ func Benchmark_Ingester_PushOnError(b *testing.B) { // For each series, push a single sample with a timestamp greater than next pushes. for i := 0; i < numSeriesPerRequest; i++ { currTimeReq := mimirpb.ToWriteRequest( - [][]mimirpb.LabelAdapter{{{Name: labels.MetricName, Value: metricName}, {Name: "cardinality", Value: strconv.Itoa(i)}}}, + [][]mimirpb_custom.LabelAdapter{{{Name: labels.MetricName, Value: metricName}, {Name: "cardinality", Value: strconv.Itoa(i)}}}, []mimirpb.Sample{{Value: 1, TimestampMs: sampleTimestamp + 1}}, nil, nil, @@ -3727,7 +3728,7 @@ func Benchmark_Ingester_PushOnError(b *testing.B) { require.NoError(b, err) } }, - runBenchmark: func(b *testing.B, ingester *Ingester, metrics [][]mimirpb.LabelAdapter, samples []mimirpb.Sample) { + runBenchmark: func(b *testing.B, ingester *Ingester, metrics [][]mimirpb_custom.LabelAdapter, samples []mimirpb.Sample) { expectedErr := storage.ErrOutOfOrderSample.Error() // Push out-of-order samples. @@ -3746,7 +3747,7 @@ func Benchmark_Ingester_PushOnError(b *testing.B) { beforeBenchmark: func(b *testing.B, ingester *Ingester, _ int) { // Push a series with a metric name different than the one used during the benchmark. currTimeReq := mimirpb.ToWriteRequest( - [][]mimirpb.LabelAdapter{{{Name: labels.MetricName, Value: "another"}}}, + [][]mimirpb_custom.LabelAdapter{{{Name: labels.MetricName, Value: "another"}}}, []mimirpb.Sample{{Value: 1, TimestampMs: sampleTimestamp + 1}}, nil, nil, @@ -3755,7 +3756,7 @@ func Benchmark_Ingester_PushOnError(b *testing.B) { _, err := ingester.Push(ctx, currTimeReq) require.NoError(b, err) }, - runBenchmark: func(b *testing.B, ingester *Ingester, metrics [][]mimirpb.LabelAdapter, samples []mimirpb.Sample) { + runBenchmark: func(b *testing.B, ingester *Ingester, metrics [][]mimirpb_custom.LabelAdapter, samples []mimirpb.Sample) { // Push series with a different name than the one already pushed. for n := 0; n < b.N; n++ { _, err := ingester.Push(ctx, mimirpb.ToWriteRequest(metrics, samples, nil, nil, mimirpb.API)) // nolint:errcheck @@ -3771,7 +3772,7 @@ func Benchmark_Ingester_PushOnError(b *testing.B) { beforeBenchmark: func(b *testing.B, ingester *Ingester, _ int) { // Push a series with the same metric name but different labels than the one used during the benchmark. currTimeReq := mimirpb.ToWriteRequest( - [][]mimirpb.LabelAdapter{{{Name: labels.MetricName, Value: metricName}, {Name: "cardinality", Value: "another"}}}, + [][]mimirpb_custom.LabelAdapter{{{Name: labels.MetricName, Value: metricName}, {Name: "cardinality", Value: "another"}}}, []mimirpb.Sample{{Value: 1, TimestampMs: sampleTimestamp + 1}}, nil, nil, @@ -3780,7 +3781,7 @@ func Benchmark_Ingester_PushOnError(b *testing.B) { _, err := ingester.Push(ctx, currTimeReq) require.NoError(b, err) }, - runBenchmark: func(b *testing.B, ingester *Ingester, metrics [][]mimirpb.LabelAdapter, samples []mimirpb.Sample) { + runBenchmark: func(b *testing.B, ingester *Ingester, metrics [][]mimirpb_custom.LabelAdapter, samples []mimirpb.Sample) { // Push series with different labels than the one already pushed. for n := 0; n < b.N; n++ { _, err := ingester.Push(ctx, mimirpb.ToWriteRequest(metrics, samples, nil, nil, mimirpb.API)) // nolint:errcheck @@ -3803,7 +3804,7 @@ func Benchmark_Ingester_PushOnError(b *testing.B) { ingester.ingestionRate.Tick() }, - runBenchmark: func(b *testing.B, ingester *Ingester, metrics [][]mimirpb.LabelAdapter, samples []mimirpb.Sample) { + runBenchmark: func(b *testing.B, ingester *Ingester, metrics [][]mimirpb_custom.LabelAdapter, samples []mimirpb.Sample) { // Push series with different labels than the one already pushed. for n := 0; n < b.N; n++ { _, err := ingester.Push(ctx, mimirpb.ToWriteRequest(metrics, samples, nil, nil, mimirpb.API)) @@ -3825,7 +3826,7 @@ func Benchmark_Ingester_PushOnError(b *testing.B) { _, err := ingester.Push(ctx, generateSamplesForLabel(labels.FromStrings(labels.MetricName, "test"), 1, 10000)) require.NoError(b, err) }, - runBenchmark: func(b *testing.B, ingester *Ingester, metrics [][]mimirpb.LabelAdapter, samples []mimirpb.Sample) { + runBenchmark: func(b *testing.B, ingester *Ingester, metrics [][]mimirpb_custom.LabelAdapter, samples []mimirpb.Sample) { // Push series with different labels than the one already pushed. for n := 0; n < b.N; n++ { _, err := ingester.Push(ctx, mimirpb.ToWriteRequest(metrics, samples, nil, nil, mimirpb.API)) @@ -3845,7 +3846,7 @@ func Benchmark_Ingester_PushOnError(b *testing.B) { _, err := ingester.Push(ctx, generateSamplesForLabel(labels.FromStrings(labels.MetricName, "test"), 1, 10000)) require.NoError(b, err) }, - runBenchmark: func(b *testing.B, ingester *Ingester, metrics [][]mimirpb.LabelAdapter, samples []mimirpb.Sample) { + runBenchmark: func(b *testing.B, ingester *Ingester, metrics [][]mimirpb_custom.LabelAdapter, samples []mimirpb.Sample) { for n := 0; n < b.N; n++ { _, err := ingester.Push(ctx, mimirpb.ToWriteRequest(metrics, samples, nil, nil, mimirpb.API)) verifyErrorString(b, err, "max series limit reached") @@ -3863,7 +3864,7 @@ func Benchmark_Ingester_PushOnError(b *testing.B) { beforeBenchmark: func(_ *testing.B, ingester *Ingester, _ int) { ingester.inflightPushRequests.Inc() }, - runBenchmark: func(b *testing.B, ingester *Ingester, metrics [][]mimirpb.LabelAdapter, samples []mimirpb.Sample) { + runBenchmark: func(b *testing.B, ingester *Ingester, metrics [][]mimirpb_custom.LabelAdapter, samples []mimirpb.Sample) { for n := 0; n < b.N; n++ { _, err := ingester.Push(ctx, mimirpb.ToWriteRequest(metrics, samples, nil, nil, mimirpb.API)) verifyErrorString(b, err, "too many inflight push requests") @@ -3911,10 +3912,10 @@ func Benchmark_Ingester_PushOnError(b *testing.B) { testData.beforeBenchmark(b, ingester, scenario.numSeriesPerRequest) // Prepare the request. - metrics := make([][]mimirpb.LabelAdapter, 0, scenario.numSeriesPerRequest) + metrics := make([][]mimirpb_custom.LabelAdapter, 0, scenario.numSeriesPerRequest) samples := make([]mimirpb.Sample, 0, scenario.numSeriesPerRequest) for i := 0; i < scenario.numSeriesPerRequest; i++ { - metrics = append(metrics, []mimirpb.LabelAdapter{{Name: labels.MetricName, Value: metricName}, {Name: "cardinality", Value: strconv.Itoa(i)}}) + metrics = append(metrics, []mimirpb_custom.LabelAdapter{{Name: labels.MetricName, Value: metricName}, {Name: "cardinality", Value: strconv.Itoa(i)}}) samples = append(samples, mimirpb.Sample{Value: float64(i), TimestampMs: sampleTimestamp}) } @@ -4980,11 +4981,11 @@ func createIngesterWithSeries(t testing.TB, userID string, numSeries, numSamples batchSize := min(maxBatchSize, numSeries-o) // Generate metrics and samples (1 for each series). - metrics := make([][]mimirpb.LabelAdapter, 0, batchSize) + metrics := make([][]mimirpb_custom.LabelAdapter, 0, batchSize) samples := make([]mimirpb.Sample, 0, batchSize) for s := 0; s < batchSize; s++ { - metrics = append(metrics, []mimirpb.LabelAdapter{{Name: labels.MetricName, Value: fmt.Sprintf("test_%d", o+s)}}) + metrics = append(metrics, []mimirpb_custom.LabelAdapter{{Name: labels.MetricName, Value: fmt.Sprintf("test_%d", o+s)}}) samples = append(samples, mimirpb.Sample{ TimestampMs: ts, Value: 1, @@ -6136,7 +6137,7 @@ func mockHistogramWriteRequest(lbls labels.Labels, timestampMs int64, histIdx in h := util_test.GenerateTestHistogram(histIdx) histograms = []mimirpb.Histogram{mimirpb.FromHistogramToHistogramProto(timestampMs, h)} } - return mimirpb.NewWriteRequest(nil, mimirpb.API).AddHistogramSeries([][]mimirpb.LabelAdapter{mimirpb.FromLabelsToLabelAdapters(lbls)}, histograms, nil) + return mimirpb.NewWriteRequest(nil, mimirpb.API).AddHistogramSeries([][]mimirpb_custom.LabelAdapter{mimirpb.FromLabelsToLabelAdapters(lbls)}, histograms, nil) } func mockWriteRequest(t testing.TB, lbls labels.Labels, value float64, timestampMs int64) (*mimirpb.WriteRequest, *client.QueryResponse, *client.QueryStreamResponse, *client.QueryStreamResponse) { @@ -6147,7 +6148,7 @@ func mockWriteRequest(t testing.TB, lbls labels.Labels, value float64, timestamp }, } - req := mimirpb.ToWriteRequest([][]mimirpb.LabelAdapter{mimirpb.FromLabelsToLabelAdapters(lbls)}, samples, nil, nil, mimirpb.API) + req := mimirpb.ToWriteRequest([][]mimirpb_custom.LabelAdapter{mimirpb.FromLabelsToLabelAdapters(lbls)}, samples, nil, nil, mimirpb.API) // Generate the expected response expectedQueryRes := &client.QueryResponse{ @@ -8032,7 +8033,7 @@ func TestIngester_PushInstanceLimits(t *testing.T) { reqs: map[string][]*mimirpb.WriteRequest{ "test": { mimirpb.ToWriteRequest( - [][]mimirpb.LabelAdapter{{{Name: labels.MetricName, Value: "test"}}}, + [][]mimirpb_custom.LabelAdapter{{{Name: labels.MetricName, Value: "test"}}}, []mimirpb.Sample{{Value: 1, TimestampMs: 9}}, nil, []*mimirpb.MetricMetadata{ @@ -8051,7 +8052,7 @@ func TestIngester_PushInstanceLimits(t *testing.T) { reqs: map[string][]*mimirpb.WriteRequest{ "test": { mimirpb.ToWriteRequest( - [][]mimirpb.LabelAdapter{{{Name: labels.MetricName, Value: "test1"}}}, + [][]mimirpb_custom.LabelAdapter{{{Name: labels.MetricName, Value: "test1"}}}, []mimirpb.Sample{{Value: 1, TimestampMs: 9}}, nil, nil, @@ -8059,7 +8060,7 @@ func TestIngester_PushInstanceLimits(t *testing.T) { ), mimirpb.ToWriteRequest( - [][]mimirpb.LabelAdapter{{{Name: labels.MetricName, Value: "test2"}}}, // another series + [][]mimirpb_custom.LabelAdapter{{{Name: labels.MetricName, Value: "test2"}}}, // another series []mimirpb.Sample{{Value: 1, TimestampMs: 10}}, nil, nil, @@ -8078,7 +8079,7 @@ func TestIngester_PushInstanceLimits(t *testing.T) { reqs: map[string][]*mimirpb.WriteRequest{ "user1": { mimirpb.ToWriteRequest( - [][]mimirpb.LabelAdapter{{{Name: labels.MetricName, Value: "test1"}}}, + [][]mimirpb_custom.LabelAdapter{{{Name: labels.MetricName, Value: "test1"}}}, []mimirpb.Sample{{Value: 1, TimestampMs: 9}}, nil, nil, @@ -8088,7 +8089,7 @@ func TestIngester_PushInstanceLimits(t *testing.T) { "user2": { mimirpb.ToWriteRequest( - [][]mimirpb.LabelAdapter{{{Name: labels.MetricName, Value: "test2"}}}, // another series + [][]mimirpb_custom.LabelAdapter{{{Name: labels.MetricName, Value: "test2"}}}, // another series []mimirpb.Sample{{Value: 1, TimestampMs: 10}}, nil, nil, @@ -8107,7 +8108,7 @@ func TestIngester_PushInstanceLimits(t *testing.T) { reqs: map[string][]*mimirpb.WriteRequest{ "user1": { mimirpb.ToWriteRequest( - [][]mimirpb.LabelAdapter{{{Name: labels.MetricName, Value: "test1"}}}, + [][]mimirpb_custom.LabelAdapter{{{Name: labels.MetricName, Value: "test1"}}}, []mimirpb.Sample{{Value: 1, TimestampMs: 9}}, nil, nil, @@ -8115,7 +8116,7 @@ func TestIngester_PushInstanceLimits(t *testing.T) { ), mimirpb.ToWriteRequest( - [][]mimirpb.LabelAdapter{{{Name: labels.MetricName, Value: "test1"}}}, + [][]mimirpb_custom.LabelAdapter{{{Name: labels.MetricName, Value: "test1"}}}, []mimirpb.Sample{{Value: 1, TimestampMs: 10}}, nil, nil, @@ -8504,7 +8505,7 @@ func prepareRequestForTargetRequestDuration(ctx context.Context, t *testing.T, i } func generateSamplesForLabel(baseLabels labels.Labels, series, samples int) *mimirpb.WriteRequest { - lbls := make([][]mimirpb.LabelAdapter, 0, series*samples) + lbls := make([][]mimirpb_custom.LabelAdapter, 0, series*samples) ss := make([]mimirpb.Sample, 0, series*samples) for s := 0; s < series; s++ { @@ -8557,8 +8558,8 @@ func matrixToSamples(m model.Matrix) []mimirpb.Sample { } // Return one copy of the labels per sample -func matrixToLables(m model.Matrix) [][]mimirpb.LabelAdapter { - var labels [][]mimirpb.LabelAdapter +func matrixToLables(m model.Matrix) [][]mimirpb_custom.LabelAdapter { + var labels [][]mimirpb_custom.LabelAdapter for _, ss := range m { for range ss.Values { labels = append(labels, mimirpb.FromMetricsToLabelAdapters(ss.Metric)) @@ -8782,7 +8783,7 @@ func TestIngester_Push_SeriesWithBlankLabel(t *testing.T) { }) defer services.StopAndAwaitTerminated(context.Background(), ing) //nolint:errcheck - lbls := [][]mimirpb.LabelAdapter{{{Name: labels.MetricName, Value: "testmetric"}, {Name: "foo", Value: ""}, {Name: "bar", Value: ""}}} + lbls := [][]mimirpb_custom.LabelAdapter{{{Name: labels.MetricName, Value: "testmetric"}, {Name: "foo", Value: ""}, {Name: "bar", Value: ""}}} ctx := user.InjectOrgID(context.Background(), userID) _, err = ing.Push(ctx, mimirpb.ToWriteRequest( @@ -8840,7 +8841,7 @@ func TestIngesterUserLimitExceeded(t *testing.T) { userID := "1" // Series - labels1 := []mimirpb.LabelAdapter{{Name: labels.MetricName, Value: "testmetric"}, {Name: "foo", Value: "bar"}} + labels1 := []mimirpb_custom.LabelAdapter{{Name: labels.MetricName, Value: "testmetric"}, {Name: "foo", Value: "bar"}} sample1 := mimirpb.Sample{ TimestampMs: 0, Value: 1, @@ -8849,7 +8850,7 @@ func TestIngesterUserLimitExceeded(t *testing.T) { TimestampMs: 1, Value: 2, } - labels3 := []mimirpb.LabelAdapter{{Name: labels.MetricName, Value: "testmetric"}, {Name: "foo", Value: "biz"}} + labels3 := []mimirpb_custom.LabelAdapter{{Name: labels.MetricName, Value: "testmetric"}, {Name: "foo", Value: "biz"}} sample3 := mimirpb.Sample{ TimestampMs: 1, Value: 3, @@ -8860,12 +8861,12 @@ func TestIngesterUserLimitExceeded(t *testing.T) { // Append only one series and one metadata first, expect no error. ctx := user.InjectOrgID(context.Background(), userID) - _, err := ing.Push(ctx, mimirpb.ToWriteRequest([][]mimirpb.LabelAdapter{labels1}, []mimirpb.Sample{sample1}, nil, []*mimirpb.MetricMetadata{metadata1}, mimirpb.API)) + _, err := ing.Push(ctx, mimirpb.ToWriteRequest([][]mimirpb_custom.LabelAdapter{labels1}, []mimirpb.Sample{sample1}, nil, []*mimirpb.MetricMetadata{metadata1}, mimirpb.API)) require.NoError(t, err) testLimits := func() { // Append to two series, expect series-exceeded error. - _, err = ing.Push(ctx, mimirpb.ToWriteRequest([][]mimirpb.LabelAdapter{labels1, labels3}, []mimirpb.Sample{sample2, sample3}, nil, nil, mimirpb.API)) + _, err = ing.Push(ctx, mimirpb.ToWriteRequest([][]mimirpb_custom.LabelAdapter{labels1, labels3}, []mimirpb.Sample{sample2, sample3}, nil, nil, mimirpb.API)) expectedErr := newErrorWithStatus(wrapOrAnnotateWithUser(newPerUserSeriesLimitReachedError(ing.limiter.limits.MaxGlobalSeriesPerUser(userID)), userID), codes.FailedPrecondition) checkErrorWithStatus(t, err, expectedErr) @@ -8942,7 +8943,7 @@ func TestIngesterMetricLimitExceeded(t *testing.T) { defer services.StopAndAwaitTerminated(context.Background(), ing) //nolint:errcheck userID := "1" - labels1 := []mimirpb.LabelAdapter{{Name: labels.MetricName, Value: "testmetric"}, {Name: "foo", Value: "bar"}} + labels1 := []mimirpb_custom.LabelAdapter{{Name: labels.MetricName, Value: "testmetric"}, {Name: "foo", Value: "bar"}} sample1 := mimirpb.Sample{ TimestampMs: 0, Value: 1, @@ -8951,7 +8952,7 @@ func TestIngesterMetricLimitExceeded(t *testing.T) { TimestampMs: 1, Value: 2, } - labels3 := []mimirpb.LabelAdapter{{Name: labels.MetricName, Value: "testmetric"}, {Name: "foo", Value: "biz"}} + labels3 := []mimirpb_custom.LabelAdapter{{Name: labels.MetricName, Value: "testmetric"}, {Name: "foo", Value: "biz"}} sample3 := mimirpb.Sample{ TimestampMs: 1, Value: 3, @@ -8963,12 +8964,12 @@ func TestIngesterMetricLimitExceeded(t *testing.T) { // Append only one series and one metadata first, expect no error. ctx := user.InjectOrgID(context.Background(), userID) - _, err := ing.Push(ctx, mimirpb.ToWriteRequest([][]mimirpb.LabelAdapter{labels1}, []mimirpb.Sample{sample1}, nil, []*mimirpb.MetricMetadata{metadata1}, mimirpb.API)) + _, err := ing.Push(ctx, mimirpb.ToWriteRequest([][]mimirpb_custom.LabelAdapter{labels1}, []mimirpb.Sample{sample1}, nil, []*mimirpb.MetricMetadata{metadata1}, mimirpb.API)) require.NoError(t, err) testLimits := func() { // Append two series, expect series-exceeded error. - _, err = ing.Push(ctx, mimirpb.ToWriteRequest([][]mimirpb.LabelAdapter{labels1, labels3}, []mimirpb.Sample{sample2, sample3}, nil, nil, mimirpb.API)) + _, err = ing.Push(ctx, mimirpb.ToWriteRequest([][]mimirpb_custom.LabelAdapter{labels1, labels3}, []mimirpb.Sample{sample2, sample3}, nil, nil, mimirpb.API)) expectedErr := newErrorWithStatus(wrapOrAnnotateWithUser(newPerMetricSeriesLimitReachedError(ing.limiter.limits.MaxGlobalSeriesPerMetric(userID), labels3), userID), codes.FailedPrecondition) checkErrorWithStatus(t, err, expectedErr) @@ -9016,7 +9017,7 @@ func TestIngesterMetricLimitExceeded(t *testing.T) { } // Construct a set of realistic-looking samples, all with slightly different label sets -func benchmarkData(nSeries int) (allLabels [][]mimirpb.LabelAdapter, allSamples []mimirpb.Sample) { +func benchmarkData(nSeries int) (allLabels [][]mimirpb_custom.LabelAdapter, allSamples []mimirpb.Sample) { // Real example from Kubernetes' embedded cAdvisor metrics, lightly obfuscated. var benchmarkLabels = labels.FromStrings( model.MetricNameLabel, "container_cpu_usage_seconds_total", @@ -9065,30 +9066,30 @@ func (t *TenantLimitsMock) ByUserID(userID string) *validation.Limits { } func TestIngesterActiveSeries(t *testing.T) { - labelsToPush := [][]mimirpb.LabelAdapter{ + labelsToPush := [][]mimirpb_custom.LabelAdapter{ {{Name: labels.MetricName, Value: "test_metric"}, {Name: "bool", Value: "false"}, {Name: "team", Value: "a"}}, {{Name: labels.MetricName, Value: "test_metric"}, {Name: "bool", Value: "false"}, {Name: "team", Value: "b"}}, {{Name: labels.MetricName, Value: "test_metric"}, {Name: "bool", Value: "true"}, {Name: "team", Value: "a"}}, {{Name: labels.MetricName, Value: "test_metric"}, {Name: "bool", Value: "true"}, {Name: "team", Value: "b"}}, } - labelsToPushHist := [][]mimirpb.LabelAdapter{ + labelsToPushHist := [][]mimirpb_custom.LabelAdapter{ {{Name: labels.MetricName, Value: "test_histogram_metric"}, {Name: "bool", Value: "false"}, {Name: "team", Value: "a"}}, {{Name: labels.MetricName, Value: "test_histogram_metric"}, {Name: "bool", Value: "false"}, {Name: "team", Value: "b"}}, {{Name: labels.MetricName, Value: "test_histogram_metric"}, {Name: "bool", Value: "true"}, {Name: "team", Value: "a"}}, {{Name: labels.MetricName, Value: "test_histogram_metric"}, {Name: "bool", Value: "true"}, {Name: "team", Value: "b"}}, } - req := func(lbls []mimirpb.LabelAdapter, t time.Time) *mimirpb.WriteRequest { + req := func(lbls []mimirpb_custom.LabelAdapter, t time.Time) *mimirpb.WriteRequest { return mimirpb.ToWriteRequest( - [][]mimirpb.LabelAdapter{lbls}, + [][]mimirpb_custom.LabelAdapter{lbls}, []mimirpb.Sample{{Value: 1, TimestampMs: t.UnixMilli()}}, nil, nil, mimirpb.API, ) } - reqHist := func(lbls []mimirpb.LabelAdapter, t time.Time) *mimirpb.WriteRequest { - return mimirpb.NewWriteRequest(nil, mimirpb.API).AddHistogramSeries([][]mimirpb.LabelAdapter{lbls}, + reqHist := func(lbls []mimirpb_custom.LabelAdapter, t time.Time) *mimirpb.WriteRequest { + return mimirpb.NewWriteRequest(nil, mimirpb.API).AddHistogramSeries([][]mimirpb_custom.LabelAdapter{lbls}, []mimirpb.Histogram{mimirpb.FromHistogramToHistogramProto(t.UnixMilli(), util_test.GenerateTestGaugeHistogram(1))}, nil) } @@ -9425,30 +9426,30 @@ func TestIngesterActiveSeries(t *testing.T) { } func TestIngesterActiveSeriesConfigChanges(t *testing.T) { - labelsToPush := [][]mimirpb.LabelAdapter{ + labelsToPush := [][]mimirpb_custom.LabelAdapter{ {{Name: labels.MetricName, Value: "test_metric"}, {Name: "bool", Value: "false"}, {Name: "team", Value: "a"}}, {{Name: labels.MetricName, Value: "test_metric"}, {Name: "bool", Value: "false"}, {Name: "team", Value: "b"}}, {{Name: labels.MetricName, Value: "test_metric"}, {Name: "bool", Value: "true"}, {Name: "team", Value: "a"}}, {{Name: labels.MetricName, Value: "test_metric"}, {Name: "bool", Value: "true"}, {Name: "team", Value: "b"}}, } - labelsToPushHist := [][]mimirpb.LabelAdapter{ + labelsToPushHist := [][]mimirpb_custom.LabelAdapter{ {{Name: labels.MetricName, Value: "test_histogram_metric"}, {Name: "bool", Value: "false"}, {Name: "team", Value: "a"}}, {{Name: labels.MetricName, Value: "test_histogram_metric"}, {Name: "bool", Value: "false"}, {Name: "team", Value: "b"}}, {{Name: labels.MetricName, Value: "test_histogram_metric"}, {Name: "bool", Value: "true"}, {Name: "team", Value: "a"}}, {{Name: labels.MetricName, Value: "test_histogram_metric"}, {Name: "bool", Value: "true"}, {Name: "team", Value: "b"}}, } - req := func(lbls []mimirpb.LabelAdapter, t time.Time) *mimirpb.WriteRequest { + req := func(lbls []mimirpb_custom.LabelAdapter, t time.Time) *mimirpb.WriteRequest { return mimirpb.ToWriteRequest( - [][]mimirpb.LabelAdapter{lbls}, + [][]mimirpb_custom.LabelAdapter{lbls}, []mimirpb.Sample{{Value: 1, TimestampMs: t.UnixMilli()}}, nil, nil, mimirpb.API, ) } - reqHist := func(lbls []mimirpb.LabelAdapter, t time.Time) *mimirpb.WriteRequest { - return mimirpb.NewWriteRequest(nil, mimirpb.API).AddHistogramSeries([][]mimirpb.LabelAdapter{lbls}, + reqHist := func(lbls []mimirpb_custom.LabelAdapter, t time.Time) *mimirpb.WriteRequest { + return mimirpb.NewWriteRequest(nil, mimirpb.API).AddHistogramSeries([][]mimirpb_custom.LabelAdapter{lbls}, []mimirpb.Histogram{mimirpb.FromHistogramToHistogramProto(t.UnixMilli(), util_test.GenerateTestGaugeHistogram(1))}, nil) } @@ -9954,7 +9955,7 @@ func TestIngesterActiveSeriesConfigChanges(t *testing.T) { } } -func pushWithUser(t *testing.T, ingester *Ingester, labelsToPush [][]mimirpb.LabelAdapter, userID string, req func(lbls []mimirpb.LabelAdapter, t time.Time) *mimirpb.WriteRequest) { +func pushWithUser(t *testing.T, ingester *Ingester, labelsToPush [][]mimirpb_custom.LabelAdapter, userID string, req func(lbls []mimirpb_custom.LabelAdapter, t time.Time) *mimirpb.WriteRequest) { for _, label := range labelsToPush { ctx := user.InjectOrgID(context.Background(), userID) _, err := ingester.Push(ctx, req(label, time.Now())) @@ -9987,7 +9988,7 @@ func Test_Ingester_OutOfOrder(t *testing.T) { } func testIngesterOutOfOrder(t *testing.T, - makeWriteRequest func(start, end int64, s []mimirpb.LabelAdapter) *mimirpb.WriteRequest, + makeWriteRequest func(start, end int64, s []mimirpb_custom.LabelAdapter) *mimirpb.WriteRequest, makeExpectedSamples func(start, end int64, m model.Metric) model.Matrix) { cfg := defaultIngesterTestConfig(t) cfg.TSDBConfigUpdatePeriod = 1 * time.Second @@ -10031,7 +10032,7 @@ func testIngesterOutOfOrder(t *testing.T, start = start * time.Minute.Milliseconds() end = end * time.Minute.Milliseconds() - s := []mimirpb.LabelAdapter{{Name: labels.MetricName, Value: "test_1"}, {Name: "status", Value: "200"}} + s := []mimirpb_custom.LabelAdapter{{Name: labels.MetricName, Value: "test_1"}, {Name: "status", Value: "200"}} wReq := makeWriteRequest(start, end, s) _, err = i.Push(ctx, wReq) if expErr { @@ -10248,7 +10249,7 @@ func Test_Ingester_OutOfOrder_CompactHead(t *testing.T) { } func testIngesterOutOfOrderCompactHead(t *testing.T, - makeWriteRequest func(start, end int64, s []mimirpb.LabelAdapter) *mimirpb.WriteRequest, + makeWriteRequest func(start, end int64, s []mimirpb_custom.LabelAdapter) *mimirpb.WriteRequest, makeExpectedSamples func(start, end int64, m model.Metric) model.Matrix) { cfg := defaultIngesterTestConfig(t) cfg.BlocksStorageConfig.TSDB.HeadCompactionInterval = 1 * time.Hour // Long enough to not be reached during the test. @@ -10282,7 +10283,7 @@ func testIngesterOutOfOrderCompactHead(t *testing.T, start = start * time.Minute.Milliseconds() end = end * time.Minute.Milliseconds() - s := []mimirpb.LabelAdapter{{Name: labels.MetricName, Value: "test_1"}, {Name: "status", Value: "200"}} + s := []mimirpb_custom.LabelAdapter{{Name: labels.MetricName, Value: "test_1"}, {Name: "status", Value: "200"}} wReq := makeWriteRequest(start, end, s) _, err = i.Push(ctx, wReq) require.NoError(t, err) @@ -10332,7 +10333,7 @@ func Test_Ingester_OutOfOrder_CompactHead_StillActive(t *testing.T) { for name, tc := range ingesterSampleTypeScenarios { t.Run(name, func(t *testing.T) { testIngesterOutOfOrderCompactHeadStillActive(t, - func(ts int64, s []mimirpb.LabelAdapter) *mimirpb.WriteRequest { + func(ts int64, s []mimirpb_custom.LabelAdapter) *mimirpb.WriteRequest { return tc.makeWriteRequest(ts, ts, s) }) }) @@ -10340,7 +10341,7 @@ func Test_Ingester_OutOfOrder_CompactHead_StillActive(t *testing.T) { } func testIngesterOutOfOrderCompactHeadStillActive(t *testing.T, - makeWriteRequest func(ts int64, s []mimirpb.LabelAdapter) *mimirpb.WriteRequest) { + makeWriteRequest func(ts int64, s []mimirpb_custom.LabelAdapter) *mimirpb.WriteRequest) { cfg := defaultIngesterTestConfig(t) cfg.TSDBConfigUpdatePeriod = 1 * time.Second @@ -10366,7 +10367,7 @@ func testIngesterOutOfOrderCompactHeadStillActive(t *testing.T, ctx := user.InjectOrgID(context.Background(), userID) pushSamples := func(ts int64, series string) { - wReq := makeWriteRequest(ts*time.Minute.Milliseconds(), []mimirpb.LabelAdapter{{Name: labels.MetricName, Value: "test_1"}, {Name: "series", Value: series}}) + wReq := makeWriteRequest(ts*time.Minute.Milliseconds(), []mimirpb_custom.LabelAdapter{{Name: labels.MetricName, Value: "test_1"}, {Name: "series", Value: series}}) _, err = i.Push(ctx, wReq) require.NoError(t, err) } @@ -10451,9 +10452,9 @@ func Test_Ingester_ShipperLabelsOutOfOrderBlocksOnUpload(t *testing.T) { start = start * time.Minute.Milliseconds() end = end * time.Minute.Milliseconds() - s := []mimirpb.LabelAdapter{{Name: labels.MetricName, Value: "test_1"}, {Name: "status", Value: "200"}} + s := []mimirpb_custom.LabelAdapter{{Name: labels.MetricName, Value: "test_1"}, {Name: "status", Value: "200"}} var samples []mimirpb.Sample - var lbls [][]mimirpb.LabelAdapter + var lbls [][]mimirpb_custom.LabelAdapter for ts := start; ts <= end; ts += time.Minute.Milliseconds() { samples = append(samples, mimirpb.Sample{ TimestampMs: ts, @@ -10576,7 +10577,7 @@ func testIngesterCanEnableIngestAndQueryNativeHistograms(t *testing.T, sampleHis ing := newIngester() defer services.StopAndAwaitTerminated(context.Background(), ing) //nolint:errcheck - labels1 := []mimirpb.LabelAdapter{{Name: labels.MetricName, Value: "testmetric"}, {Name: "foo", Value: "bar"}} + labels1 := []mimirpb_custom.LabelAdapter{{Name: labels.MetricName, Value: "testmetric"}, {Name: "foo", Value: "bar"}} sample1 := mimirpb.Sample{ TimestampMs: 0, Value: 1, @@ -10588,8 +10589,8 @@ func testIngesterCanEnableIngestAndQueryNativeHistograms(t *testing.T, sampleHis // Append only one series and one metadata first, expect no error. ctx := user.InjectOrgID(context.Background(), userID) _, err = ing.Push(ctx, mimirpb.NewWriteRequest([]*mimirpb.MetricMetadata{metadata1}, mimirpb.API). - AddFloatSeries([][]mimirpb.LabelAdapter{labels1}, []mimirpb.Sample{sample1}, nil). - AddHistogramSeries([][]mimirpb.LabelAdapter{labels1}, sampleHistograms, nil)) + AddFloatSeries([][]mimirpb_custom.LabelAdapter{labels1}, []mimirpb.Sample{sample1}, nil). + AddHistogramSeries([][]mimirpb_custom.LabelAdapter{labels1}, sampleHistograms, nil)) require.NoError(t, err) expectedMetrics := ` @@ -10641,7 +10642,7 @@ func testIngesterCanEnableIngestAndQueryNativeHistograms(t *testing.T, sampleHis // Append only one series and one metadata first, expect no error. _, err = ing.Push(ctx, mimirpb.NewWriteRequest([]*mimirpb.MetricMetadata{metadata2}, mimirpb.API). - AddHistogramSeries([][]mimirpb.LabelAdapter{labels1}, sampleHistograms, nil)) + AddHistogramSeries([][]mimirpb_custom.LabelAdapter{labels1}, sampleHistograms, nil)) require.NoError(t, err) expectedMetrics = ` @@ -10712,7 +10713,7 @@ func TestIngester_GetOpenTSDBsConcurrencyConfig(t *testing.T) { } func TestIngester_PushWithSampledErrors(t *testing.T) { - metricLabelAdapters := []mimirpb.LabelAdapter{{Name: labels.MetricName, Value: "test"}} + metricLabelAdapters := []mimirpb_custom.LabelAdapter{{Name: labels.MetricName, Value: "test"}} metricNames := []string{ "cortex_discarded_samples_total", } @@ -10732,14 +10733,14 @@ func TestIngester_PushWithSampledErrors(t *testing.T) { "should soft fail on sample out-of-order": { reqs: []*mimirpb.WriteRequest{ mimirpb.ToWriteRequest( - [][]mimirpb.LabelAdapter{metricLabelAdapters}, + [][]mimirpb_custom.LabelAdapter{metricLabelAdapters}, []mimirpb.Sample{{Value: 2, TimestampMs: 10}}, nil, nil, mimirpb.API, ), mimirpb.ToWriteRequest( - [][]mimirpb.LabelAdapter{metricLabelAdapters}, + [][]mimirpb_custom.LabelAdapter{metricLabelAdapters}, []mimirpb.Sample{{Value: 1, TimestampMs: 9}}, nil, nil, @@ -10761,7 +10762,7 @@ func TestIngester_PushWithSampledErrors(t *testing.T) { "should soft fail on all samples out of bound in a write request": { reqs: []*mimirpb.WriteRequest{ mimirpb.ToWriteRequest( - [][]mimirpb.LabelAdapter{metricLabelAdapters}, + [][]mimirpb_custom.LabelAdapter{metricLabelAdapters}, []mimirpb.Sample{{Value: 2, TimestampMs: 1575043969}}, nil, nil, @@ -10794,7 +10795,7 @@ func TestIngester_PushWithSampledErrors(t *testing.T) { "should soft fail on all histograms out of bound in a write request": { reqs: []*mimirpb.WriteRequest{ mimirpb.ToWriteRequest( - [][]mimirpb.LabelAdapter{metricLabelAdapters}, + [][]mimirpb_custom.LabelAdapter{metricLabelAdapters}, []mimirpb.Sample{{Value: 2, TimestampMs: 1575043969}}, nil, nil, @@ -10828,7 +10829,7 @@ func TestIngester_PushWithSampledErrors(t *testing.T) { "should soft fail on all samples and histograms out of bound in a write request": { reqs: []*mimirpb.WriteRequest{ mimirpb.ToWriteRequest( - [][]mimirpb.LabelAdapter{metricLabelAdapters}, + [][]mimirpb_custom.LabelAdapter{metricLabelAdapters}, []mimirpb.Sample{{Value: 2, TimestampMs: 1575043969}}, nil, nil, @@ -10863,7 +10864,7 @@ func TestIngester_PushWithSampledErrors(t *testing.T) { "should soft fail on some samples out of bound in a write request": { reqs: []*mimirpb.WriteRequest{ mimirpb.ToWriteRequest( - [][]mimirpb.LabelAdapter{metricLabelAdapters}, + [][]mimirpb_custom.LabelAdapter{metricLabelAdapters}, []mimirpb.Sample{{Value: 2, TimestampMs: 1575043969}}, nil, nil, @@ -10899,7 +10900,7 @@ func TestIngester_PushWithSampledErrors(t *testing.T) { "should soft fail on some samples with timestamp too far in future in a write request": { reqs: []*mimirpb.WriteRequest{ mimirpb.ToWriteRequest( - [][]mimirpb.LabelAdapter{metricLabelAdapters}, + [][]mimirpb_custom.LabelAdapter{metricLabelAdapters}, []mimirpb.Sample{{Value: 1, TimestampMs: now.UnixMilli()}}, nil, nil, @@ -10969,8 +10970,8 @@ func TestIngester_PushWithSampledErrors(t *testing.T) { Samples: []mimirpb.Sample{ {Value: 1, TimestampMs: now.UnixMilli()}}, Exemplars: []mimirpb.Exemplar{ - {Labels: []mimirpb.LabelAdapter{{Name: "traceID", Value: "111"}}, Value: 1, TimestampMs: now.UnixMilli()}, - {Labels: []mimirpb.LabelAdapter{{Name: "traceID", Value: "222"}}, Value: 2, TimestampMs: now.UnixMilli() + (86400 * 1000)}, + {Labels: []mimirpb_custom.LabelAdapter{{Name: "traceID", Value: "111"}}, Value: 1, TimestampMs: now.UnixMilli()}, + {Labels: []mimirpb_custom.LabelAdapter{{Name: "traceID", Value: "222"}}, Value: 2, TimestampMs: now.UnixMilli() + (86400 * 1000)}, }, }, }, @@ -10978,22 +10979,22 @@ func TestIngester_PushWithSampledErrors(t *testing.T) { }, }, expectedErrs: []globalerror.ErrorWithStatus{ - newErrorWithStatus(wrapOrAnnotateWithUser(newExemplarTimestampTooFarInFutureError(model.Time(now.UnixMilli()+(86400*1000)), metricLabelAdapters, []mimirpb.LabelAdapter{{Name: "traceID", Value: "222"}}), users[0]), codes.InvalidArgument), - newErrorWithStatus(wrapOrAnnotateWithUser(newExemplarTimestampTooFarInFutureError(model.Time(now.UnixMilli()+(86400*1000)), metricLabelAdapters, []mimirpb.LabelAdapter{{Name: "traceID", Value: "222"}}), users[1]), codes.InvalidArgument), + newErrorWithStatus(wrapOrAnnotateWithUser(newExemplarTimestampTooFarInFutureError(model.Time(now.UnixMilli()+(86400*1000)), metricLabelAdapters, []mimirpb_custom.LabelAdapter{{Name: "traceID", Value: "222"}}), users[0]), codes.InvalidArgument), + newErrorWithStatus(wrapOrAnnotateWithUser(newExemplarTimestampTooFarInFutureError(model.Time(now.UnixMilli()+(86400*1000)), metricLabelAdapters, []mimirpb_custom.LabelAdapter{{Name: "traceID", Value: "222"}}), users[1]), codes.InvalidArgument), }, expectedSampling: false, }, "should soft fail on two different sample values at the same timestamp": { reqs: []*mimirpb.WriteRequest{ mimirpb.ToWriteRequest( - [][]mimirpb.LabelAdapter{metricLabelAdapters}, + [][]mimirpb_custom.LabelAdapter{metricLabelAdapters}, []mimirpb.Sample{{Value: 2, TimestampMs: 1575043969}}, nil, nil, mimirpb.API, ), mimirpb.ToWriteRequest( - [][]mimirpb.LabelAdapter{metricLabelAdapters}, + [][]mimirpb_custom.LabelAdapter{metricLabelAdapters}, []mimirpb.Sample{{Value: 1, TimestampMs: 1575043969}}, nil, nil, @@ -11021,10 +11022,10 @@ func TestIngester_PushWithSampledErrors(t *testing.T) { Timeseries: []mimirpb.PreallocTimeseries{ { TimeSeries: &mimirpb.TimeSeries{ - Labels: []mimirpb.LabelAdapter{metricLabelAdapters[0]}, // Cannot reuse test slice var because it is cleared and returned to the pool + Labels: []mimirpb_custom.LabelAdapter{metricLabelAdapters[0]}, // Cannot reuse test slice var because it is cleared and returned to the pool Exemplars: []mimirpb.Exemplar{ { - Labels: []mimirpb.LabelAdapter{{Name: "traceID", Value: "123"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "traceID", Value: "123"}}, TimestampMs: 1000, Value: 1000, }, @@ -11035,8 +11036,8 @@ func TestIngester_PushWithSampledErrors(t *testing.T) { }, }, expectedErrs: []globalerror.ErrorWithStatus{ - newErrorWithStatus(wrapOrAnnotateWithUser(newExemplarMissingSeriesError(model.Time(1000), metricLabelAdapters, []mimirpb.LabelAdapter{{Name: "traceID", Value: "123"}}), users[0]), codes.InvalidArgument), - newErrorWithStatus(wrapOrAnnotateWithUser(newExemplarMissingSeriesError(model.Time(1000), metricLabelAdapters, []mimirpb.LabelAdapter{{Name: "traceID", Value: "123"}}), users[1]), codes.InvalidArgument), + newErrorWithStatus(wrapOrAnnotateWithUser(newExemplarMissingSeriesError(model.Time(1000), metricLabelAdapters, []mimirpb_custom.LabelAdapter{{Name: "traceID", Value: "123"}}), users[0]), codes.InvalidArgument), + newErrorWithStatus(wrapOrAnnotateWithUser(newExemplarMissingSeriesError(model.Time(1000), metricLabelAdapters, []mimirpb_custom.LabelAdapter{{Name: "traceID", Value: "123"}}), users[1]), codes.InvalidArgument), }, expectedSampling: false, }, @@ -11194,8 +11195,8 @@ func TestIngester_SampledUserLimitExceeded(t *testing.T) { userID := "1" timestamp := int64(1575043969) - metricLabelAdapters1 := []mimirpb.LabelAdapter{{Name: labels.MetricName, Value: "test"}, {Name: "foo", Value: "bar"}} - metricLabelAdapters2 := []mimirpb.LabelAdapter{{Name: labels.MetricName, Value: "test"}, {Name: "foo", Value: "biz"}} + metricLabelAdapters1 := []mimirpb_custom.LabelAdapter{{Name: labels.MetricName, Value: "test"}, {Name: "foo", Value: "bar"}} + metricLabelAdapters2 := []mimirpb_custom.LabelAdapter{{Name: labels.MetricName, Value: "test"}, {Name: "foo", Value: "biz"}} sample1 := mimirpb.Sample{ TimestampMs: timestamp + 1, Value: 1, @@ -11212,7 +11213,7 @@ func TestIngester_SampledUserLimitExceeded(t *testing.T) { ctx := user.InjectOrgID(context.Background(), userID) // Append only one series first, expect no error. - res, err := client.Push(ctx, mimirpb.ToWriteRequest([][]mimirpb.LabelAdapter{metricLabelAdapters1}, []mimirpb.Sample{sample1}, nil, nil, mimirpb.API)) + res, err := client.Push(ctx, mimirpb.ToWriteRequest([][]mimirpb_custom.LabelAdapter{metricLabelAdapters1}, []mimirpb.Sample{sample1}, nil, nil, mimirpb.API)) require.NoError(t, err) require.NotNil(t, res) @@ -11225,7 +11226,7 @@ func TestIngester_SampledUserLimitExceeded(t *testing.T) { // - all 10 samples as discarded. for i := 0; i < 2*errorSampleRate; i++ { // Append 2 series first, expect max-series-per-user error. - _, err = client.Push(ctx, mimirpb.ToWriteRequest([][]mimirpb.LabelAdapter{metricLabelAdapters1, metricLabelAdapters2}, []mimirpb.Sample{sample2, sample3}, nil, nil, mimirpb.API)) + _, err = client.Push(ctx, mimirpb.ToWriteRequest([][]mimirpb_custom.LabelAdapter{metricLabelAdapters1, metricLabelAdapters2}, []mimirpb.Sample{sample2, sample3}, nil, nil, mimirpb.API)) require.Error(t, err) status, ok := grpcutil.ErrorToStatus(err) require.True(t, ok) @@ -11298,8 +11299,8 @@ func TestIngester_SampledMetricLimitExceeded(t *testing.T) { userID := "1" timestamp := int64(1575043969) - metricLabelAdapters1 := []mimirpb.LabelAdapter{{Name: labels.MetricName, Value: "test"}, {Name: "foo", Value: "bar"}} - metricLabelAdapters2 := []mimirpb.LabelAdapter{{Name: labels.MetricName, Value: "test"}, {Name: "foo", Value: "biz"}} + metricLabelAdapters1 := []mimirpb_custom.LabelAdapter{{Name: labels.MetricName, Value: "test"}, {Name: "foo", Value: "bar"}} + metricLabelAdapters2 := []mimirpb_custom.LabelAdapter{{Name: labels.MetricName, Value: "test"}, {Name: "foo", Value: "biz"}} sample1 := mimirpb.Sample{ TimestampMs: timestamp + 1, Value: 1, @@ -11316,7 +11317,7 @@ func TestIngester_SampledMetricLimitExceeded(t *testing.T) { ctx := user.InjectOrgID(context.Background(), userID) // Append only one series first, expect no error. - res, err := client.Push(ctx, mimirpb.ToWriteRequest([][]mimirpb.LabelAdapter{metricLabelAdapters1}, []mimirpb.Sample{sample1}, nil, nil, mimirpb.API)) + res, err := client.Push(ctx, mimirpb.ToWriteRequest([][]mimirpb_custom.LabelAdapter{metricLabelAdapters1}, []mimirpb.Sample{sample1}, nil, nil, mimirpb.API)) require.NoError(t, err) require.NotNil(t, res) @@ -11329,7 +11330,7 @@ func TestIngester_SampledMetricLimitExceeded(t *testing.T) { // - all 10 samples as discarded. for i := 0; i < 2*errorSampleRate; i++ { // Append 2 series first, expect max-series-per-user error. - _, err = client.Push(ctx, mimirpb.ToWriteRequest([][]mimirpb.LabelAdapter{metricLabelAdapters1, metricLabelAdapters2}, []mimirpb.Sample{sample2, sample3}, nil, nil, mimirpb.API)) + _, err = client.Push(ctx, mimirpb.ToWriteRequest([][]mimirpb_custom.LabelAdapter{metricLabelAdapters1, metricLabelAdapters2}, []mimirpb.Sample{sample2, sample3}, nil, nil, mimirpb.API)) require.Error(t, err) status, ok := grpcutil.ErrorToStatus(err) require.True(t, ok) @@ -11762,13 +11763,13 @@ func pushWithSimulatedGRPCHandler(ctx context.Context, i *Ingester, req *mimirpb } var ingesterSampleTypeScenarios = map[string]struct { - makeWriteRequest func(start, end int64, s []mimirpb.LabelAdapter) *mimirpb.WriteRequest + makeWriteRequest func(start, end int64, s []mimirpb_custom.LabelAdapter) *mimirpb.WriteRequest makeExpectedSamples func(start, end int64, m model.Metric) model.Matrix }{ "float": { - makeWriteRequest: func(start, end int64, s []mimirpb.LabelAdapter) *mimirpb.WriteRequest { + makeWriteRequest: func(start, end int64, s []mimirpb_custom.LabelAdapter) *mimirpb.WriteRequest { var samples []mimirpb.Sample - var lbls [][]mimirpb.LabelAdapter + var lbls [][]mimirpb_custom.LabelAdapter for ts := start; ts <= end; ts += time.Minute.Milliseconds() { samples = append(samples, mimirpb.Sample{ TimestampMs: ts, @@ -11793,9 +11794,9 @@ var ingesterSampleTypeScenarios = map[string]struct { }, }, "int histogram": { - makeWriteRequest: func(start, end int64, s []mimirpb.LabelAdapter) *mimirpb.WriteRequest { + makeWriteRequest: func(start, end int64, s []mimirpb_custom.LabelAdapter) *mimirpb.WriteRequest { var histograms []mimirpb.Histogram - var lbls [][]mimirpb.LabelAdapter + var lbls [][]mimirpb_custom.LabelAdapter for ts := start; ts <= end; ts += time.Minute.Milliseconds() { h := util_test.GenerateTestHistogram(int(ts)) histograms = append(histograms, mimirpb.FromHistogramToHistogramProto(ts, h)) @@ -11818,9 +11819,9 @@ var ingesterSampleTypeScenarios = map[string]struct { }, }, "float histogram": { - makeWriteRequest: func(start, end int64, s []mimirpb.LabelAdapter) *mimirpb.WriteRequest { + makeWriteRequest: func(start, end int64, s []mimirpb_custom.LabelAdapter) *mimirpb.WriteRequest { var histograms []mimirpb.Histogram - var lbls [][]mimirpb.LabelAdapter + var lbls [][]mimirpb_custom.LabelAdapter for ts := start; ts <= end; ts += time.Minute.Milliseconds() { h := util_test.GenerateTestFloatHistogram(int(ts)) histograms = append(histograms, mimirpb.FromFloatHistogramToHistogramProto(ts, h)) diff --git a/pkg/mimirpb/compat.go b/pkg/mimirpb/compat.go index 8242bda177..922d3058bf 100644 --- a/pkg/mimirpb/compat.go +++ b/pkg/mimirpb/compat.go @@ -21,6 +21,8 @@ import ( "github.com/prometheus/prometheus/model/histogram" "github.com/prometheus/prometheus/promql" "github.com/prometheus/prometheus/util/jsonutil" + + "github.com/grafana/mimir/pkg/mimirpb_custom" ) // ToWriteRequest converts matched slices of Labels, Samples, Exemplars, and Metadata into a WriteRequest @@ -28,7 +30,7 @@ import ( // method implies that only a single sample and optionally exemplar can be set for each series. // // For histograms use NewWriteRequest and Add* functions to build write request with Floats and Histograms -func ToWriteRequest(lbls [][]LabelAdapter, samples []Sample, exemplars []*Exemplar, metadata []*MetricMetadata, source WriteRequest_SourceEnum) *WriteRequest { +func ToWriteRequest(lbls [][]mimirpb_custom.LabelAdapter, samples []Sample, exemplars []*Exemplar, metadata []*MetricMetadata, source WriteRequest_SourceEnum) *WriteRequest { return NewWriteRequest(metadata, source).AddFloatSeries(lbls, samples, exemplars) } @@ -44,7 +46,7 @@ func NewWriteRequest(metadata []*MetricMetadata, source WriteRequest_SourceEnum) // AddFloatSeries converts matched slices of Labels, Samples, Exemplars into a WriteRequest // proto. It gets timeseries from the pool, so ReuseSlice() should be called when done. Note that this // method implies that only a single sample and optionally exemplar can be set for each series. -func (req *WriteRequest) AddFloatSeries(lbls [][]LabelAdapter, samples []Sample, exemplars []*Exemplar) *WriteRequest { +func (req *WriteRequest) AddFloatSeries(lbls [][]mimirpb_custom.LabelAdapter, samples []Sample, exemplars []*Exemplar) *WriteRequest { for i, s := range samples { ts := TimeseriesFromPool() ts.Labels = append(ts.Labels, lbls[i]...) @@ -66,7 +68,7 @@ func (req *WriteRequest) AddFloatSeries(lbls [][]LabelAdapter, samples []Sample, // AddHistogramSeries converts matched slices of Labels, Histograms, Exemplars into a WriteRequest // proto. It gets timeseries from the pool, so ReuseSlice() should be called when done. Note that this // method implies that only a single sample and optionally exemplar can be set for each series. -func (req *WriteRequest) AddHistogramSeries(lbls [][]LabelAdapter, histograms []Histogram, exemplars []*Exemplar) *WriteRequest { +func (req *WriteRequest) AddHistogramSeries(lbls [][]mimirpb_custom.LabelAdapter, histograms []Histogram, exemplars []*Exemplar) *WriteRequest { for i, s := range histograms { ts := TimeseriesFromPool() ts.Labels = append(ts.Labels, lbls[i]...) @@ -98,7 +100,7 @@ func (req *WriteRequest) AddExemplarsAt(i int, exemplars []*Exemplar) *WriteRequ // FromLabelAdaptersToMetric converts []LabelAdapter to a model.Metric. // Don't do this on any performance sensitive paths. -func FromLabelAdaptersToMetric(ls []LabelAdapter) model.Metric { +func FromLabelAdaptersToMetric(ls []mimirpb_custom.LabelAdapter) model.Metric { m := make(model.Metric, len(ls)) for _, la := range ls { m[model.LabelName(la.Name)] = model.LabelValue(la.Value) @@ -108,7 +110,7 @@ func FromLabelAdaptersToMetric(ls []LabelAdapter) model.Metric { // FromLabelAdaptersToKeyString makes a string to be used as a key to a map. // It's much simpler than FromLabelAdaptersToString, but not human-readable. -func FromLabelAdaptersToKeyString(ls []LabelAdapter) string { +func FromLabelAdaptersToKeyString(ls []mimirpb_custom.LabelAdapter) string { buf := make([]byte, 0, 1024) for i := range ls { buf = append(buf, '\xff') @@ -122,7 +124,7 @@ func FromLabelAdaptersToKeyString(ls []LabelAdapter) string { // FromLabelAdaptersToString formats label adapters as a metric name with labels, while preserving // label order, and keeping duplicates. If there are multiple "__name__" labels, only // first one is used as metric name, other ones will be included as regular labels. -func FromLabelAdaptersToString(ls []LabelAdapter) string { +func FromLabelAdaptersToString(ls []mimirpb_custom.LabelAdapter) string { var space [1024]byte var quoteSpace [256]byte b := bytes.NewBuffer(space[:0]) @@ -164,10 +166,10 @@ func FromLabelAdaptersToString(ls []LabelAdapter) string { // FromMetricsToLabelAdapters converts model.Metric to []LabelAdapter. // Don't do this on any performance sensitive paths. // The result is sorted. -func FromMetricsToLabelAdapters(metric model.Metric) []LabelAdapter { - result := make([]LabelAdapter, 0, len(metric)) +func FromMetricsToLabelAdapters(metric model.Metric) []mimirpb_custom.LabelAdapter { + result := make([]mimirpb_custom.LabelAdapter, 0, len(metric)) for k, v := range metric { - result = append(result, LabelAdapter{ + result = append(result, mimirpb_custom.LabelAdapter{ Name: string(k), Value: string(v), }) @@ -381,7 +383,7 @@ func FromHistogramToPromHistogram(h *histogram.Histogram) *model.SampleHistogram return FromFloatHistogramToPromHistogram(h.ToFloat(nil)) } -type byLabel []LabelAdapter +type byLabel []mimirpb_custom.LabelAdapter func (s byLabel) Len() int { return len(s) } func (s byLabel) Less(i, j int) bool { return s[i].Name < s[j].Name } @@ -596,7 +598,7 @@ type PreallocatingMetric struct { func (m *PreallocatingMetric) Unmarshal(dAtA []byte) error { numLabels, ok := m.labelsCount(dAtA) if ok && numLabels > 0 { - m.Labels = make([]LabelAdapter, 0, numLabels) + m.Labels = make([]mimirpb_custom.LabelAdapter, 0, numLabels) } return m.Metric.Unmarshal(dAtA) diff --git a/pkg/mimirpb/compat_slice.go b/pkg/mimirpb/compat_slice.go index f02c5aeafb..2e815cc447 100644 --- a/pkg/mimirpb/compat_slice.go +++ b/pkg/mimirpb/compat_slice.go @@ -11,6 +11,8 @@ import ( "unsafe" "github.com/prometheus/prometheus/model/labels" + + "github.com/grafana/mimir/pkg/mimirpb_custom" ) // FromLabelAdaptersToLabels casts []LabelAdapter to labels.Labels. @@ -19,19 +21,19 @@ import ( // // Note: while resulting labels.Labels is supposedly sorted, this function // doesn't enforce that. If input is not sorted, output will be wrong. -func FromLabelAdaptersToLabels(ls []LabelAdapter) labels.Labels { +func FromLabelAdaptersToLabels(ls []mimirpb_custom.LabelAdapter) labels.Labels { return *(*labels.Labels)(unsafe.Pointer(&ls)) } // This is like FromLabelAdaptersToLabels but easier for stringlabels to implement. -func FromLabelAdaptersOverwriteLabels(_ *labels.ScratchBuilder, ls []LabelAdapter, dest *labels.Labels) { +func FromLabelAdaptersOverwriteLabels(_ *labels.ScratchBuilder, ls []mimirpb_custom.LabelAdapter, dest *labels.Labels) { *dest = FromLabelAdaptersToLabels(ls) } // FromLabelAdaptersToLabelsWithCopy converts []LabelAdapter to labels.Labels. // Do NOT use unsafe to convert between data types because this function may // get in input labels whose data structure is reused. -func FromLabelAdaptersToLabelsWithCopy(input []LabelAdapter) labels.Labels { +func FromLabelAdaptersToLabelsWithCopy(input []mimirpb_custom.LabelAdapter) labels.Labels { return CopyLabels(FromLabelAdaptersToLabels(input)) } @@ -70,23 +72,23 @@ func copyStringToBuffer(in string, buf []byte) (string, []byte) { } // FromLabelAdaptersToBuilder converts []LabelAdapter to labels.Builder. -func FromLabelAdaptersToBuilder(ls []LabelAdapter, builder *labels.Builder) { +func FromLabelAdaptersToBuilder(ls []mimirpb_custom.LabelAdapter, builder *labels.Builder) { builder.Reset(FromLabelAdaptersToLabels(ls)) } // FromBuilderToLabelAdapters converts labels.Builder to []LabelAdapter. -func FromBuilderToLabelAdapters(builder *labels.Builder, _ []LabelAdapter) []LabelAdapter { +func FromBuilderToLabelAdapters(builder *labels.Builder, _ []mimirpb_custom.LabelAdapter) []mimirpb_custom.LabelAdapter { return FromLabelsToLabelAdapters(builder.Labels()) } // FromLabelsToLabelAdapters casts labels.Labels to []LabelAdapter. // It uses unsafe, but as LabelAdapter == labels.Label this should be safe. // This allows us to use labels.Labels directly in protos. -func FromLabelsToLabelAdapters(ls labels.Labels) []LabelAdapter { - return *(*[]LabelAdapter)(unsafe.Pointer(&ls)) +func FromLabelsToLabelAdapters(ls labels.Labels) []mimirpb_custom.LabelAdapter { + return *(*[]mimirpb_custom.LabelAdapter)(unsafe.Pointer(&ls)) } // CompareLabelAdapters returns 0 if a==b, <0 if a < b, and >0 if a > b. -func CompareLabelAdapters(a, b []LabelAdapter) int { +func CompareLabelAdapters(a, b []mimirpb_custom.LabelAdapter) int { return labels.Compare(FromLabelAdaptersToLabels(a), FromLabelAdaptersToLabels(b)) } diff --git a/pkg/mimirpb/compat_stringlabels.go b/pkg/mimirpb/compat_stringlabels.go index d959745f0c..c0c221f4eb 100644 --- a/pkg/mimirpb/compat_stringlabels.go +++ b/pkg/mimirpb/compat_stringlabels.go @@ -6,11 +6,13 @@ package mimirpb import ( "github.com/prometheus/prometheus/model/labels" + + "github.com/grafana/mimir/pkg/mimirpb_custom" ) // FromLabelAdaptersToLabels converts []LabelAdapter to labels.Labels. // Note this is relatively expensive; see FromLabelAdaptersOverwriteLabels for a fast unsafe way. -func FromLabelAdaptersToLabels(ls []LabelAdapter) labels.Labels { +func FromLabelAdaptersToLabels(ls []mimirpb_custom.LabelAdapter) labels.Labels { builder := labels.NewScratchBuilder(len(ls)) for _, v := range ls { builder.Add(v.Name, v.Value) @@ -20,7 +22,7 @@ func FromLabelAdaptersToLabels(ls []LabelAdapter) labels.Labels { // FromLabelAdaptersToLabelsWithCopy converts []LabelAdapter to labels.Labels. // The output does not retain any part of the input. -func FromLabelAdaptersToLabelsWithCopy(input []LabelAdapter) labels.Labels { +func FromLabelAdaptersToLabelsWithCopy(input []mimirpb_custom.LabelAdapter) labels.Labels { return FromLabelAdaptersToLabels(input) } @@ -30,7 +32,7 @@ func CopyLabels(input labels.Labels) labels.Labels { } // Build a labels.Labels from LabelAdaptors, with amortized zero allocations. -func FromLabelAdaptersOverwriteLabels(builder *labels.ScratchBuilder, ls []LabelAdapter, dest *labels.Labels) { +func FromLabelAdaptersOverwriteLabels(builder *labels.ScratchBuilder, ls []mimirpb_custom.LabelAdapter, dest *labels.Labels) { builder.Reset() for _, v := range ls { builder.Add(v.Name, v.Value) @@ -39,7 +41,7 @@ func FromLabelAdaptersOverwriteLabels(builder *labels.ScratchBuilder, ls []Label } // FromLabelAdaptersToBuilder converts []LabelAdapter to labels.Builder. -func FromLabelAdaptersToBuilder(ls []LabelAdapter, builder *labels.Builder) { +func FromLabelAdaptersToBuilder(ls []mimirpb_custom.LabelAdapter, builder *labels.Builder) { builder.Reset(labels.EmptyLabels()) for _, v := range ls { builder.Set(v.Name, v.Value) @@ -48,26 +50,26 @@ func FromLabelAdaptersToBuilder(ls []LabelAdapter, builder *labels.Builder) { // FromBuilderToLabelAdapters converts labels.Builder to []LabelAdapter, reusing ls. // Note the result may not be sorted. -func FromBuilderToLabelAdapters(builder *labels.Builder, ls []LabelAdapter) []LabelAdapter { +func FromBuilderToLabelAdapters(builder *labels.Builder, ls []mimirpb_custom.LabelAdapter) []mimirpb_custom.LabelAdapter { ls = ls[:0] builder.Range(func(l labels.Label) { - ls = append(ls, LabelAdapter{Name: l.Name, Value: l.Value}) + ls = append(ls, mimirpb_custom.LabelAdapter{Name: l.Name, Value: l.Value}) }) return ls } // FromLabelsToLabelAdapters casts labels.Labels to []LabelAdapter. // For now it's doing an expensive conversion: TODO figure out a faster way. -func FromLabelsToLabelAdapters(ls labels.Labels) []LabelAdapter { - r := make([]LabelAdapter, 0, ls.Len()) +func FromLabelsToLabelAdapters(ls labels.Labels) []mimirpb_custom.LabelAdapter { + r := make([]mimirpb_custom.LabelAdapter, 0, ls.Len()) ls.Range(func(l labels.Label) { - r = append(r, LabelAdapter{Name: l.Name, Value: l.Value}) + r = append(r, mimirpb_custom.LabelAdapter{Name: l.Name, Value: l.Value}) }) return r } // CompareLabelAdapters returns be 0 if a==b, <0 if a < b, and >0 if a > b. -func CompareLabelAdapters(a, b []LabelAdapter) int { +func CompareLabelAdapters(a, b []mimirpb_custom.LabelAdapter) int { l := len(a) if len(b) < l { l = len(b) diff --git a/pkg/mimirpb/compat_test.go b/pkg/mimirpb/compat_test.go index c41dbd85df..f1c1fd8d91 100644 --- a/pkg/mimirpb/compat_test.go +++ b/pkg/mimirpb/compat_test.go @@ -21,6 +21,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/grafana/mimir/pkg/mimirpb_custom" "github.com/grafana/mimir/pkg/util/test" ) @@ -179,7 +180,7 @@ func TestMetricMetadataToMetricTypeToMetricType(t *testing.T) { } func TestFromLabelAdaptersToLabels(t *testing.T) { - input := []LabelAdapter{{Name: "hello", Value: "world"}} + input := []mimirpb_custom.LabelAdapter{{Name: "hello", Value: "world"}} expected := labels.FromStrings("hello", "world") actual := FromLabelAdaptersToLabels(input) @@ -187,7 +188,7 @@ func TestFromLabelAdaptersToLabels(t *testing.T) { } func TestFromLabelAdaptersToLabelsWithCopy(t *testing.T) { - input := []LabelAdapter{{Name: "hello", Value: "world"}} + input := []mimirpb_custom.LabelAdapter{{Name: "hello", Value: "world"}} expected := labels.FromStrings("hello", "world") actual := FromLabelAdaptersToLabelsWithCopy(input) @@ -199,7 +200,7 @@ func TestFromLabelAdaptersToLabelsWithCopy(t *testing.T) { } func BenchmarkFromLabelAdaptersToLabelsWithCopy(b *testing.B) { - input := []LabelAdapter{ + input := []mimirpb_custom.LabelAdapter{ {Name: "hello", Value: "world"}, {Name: "some label", Value: "and its value"}, {Name: "long long long long long label name", Value: "perhaps even longer label value, but who's counting anyway?"}} @@ -265,7 +266,7 @@ func BenchmarkFromHPointsToHistograms(b *testing.B) { func TestPreallocatingMetric(t *testing.T) { t.Run("should be unmarshallable from the bytes of a default Metric", func(t *testing.T) { metric := Metric{ - Labels: []LabelAdapter{ + Labels: []mimirpb_custom.LabelAdapter{ {Name: "l1", Value: "v1"}, {Name: "l2", Value: "v2"}, {Name: "l3", Value: "v3"}, @@ -289,7 +290,7 @@ func TestPreallocatingMetric(t *testing.T) { t.Run("should correctly preallocate Labels slice", func(t *testing.T) { metric := Metric{ - Labels: []LabelAdapter{ + Labels: []mimirpb_custom.LabelAdapter{ {Name: "l1", Value: "v1"}, {Name: "l2", Value: "v2"}, {Name: "l3", Value: "v3"}, @@ -310,7 +311,7 @@ func TestPreallocatingMetric(t *testing.T) { t.Run("should not allocate a slice when there are 0 Labels (same as Metric's behaviour)", func(t *testing.T) { metric := Metric{ - Labels: []LabelAdapter{}, + Labels: []mimirpb_custom.LabelAdapter{}, } metricBytes, err := metric.Marshal() @@ -324,7 +325,7 @@ func TestPreallocatingMetric(t *testing.T) { t.Run("should marshal to the same bytes as Metric", func(t *testing.T) { preallocMetric := &PreallocatingMetric{Metric{ - Labels: []LabelAdapter{ + Labels: []mimirpb_custom.LabelAdapter{ {Name: "l1", Value: "v1"}, {Name: "l2", Value: "v2"}, {Name: "l3", Value: "v3"}, @@ -334,7 +335,7 @@ func TestPreallocatingMetric(t *testing.T) { }} metric := Metric{ - Labels: []LabelAdapter{ + Labels: []mimirpb_custom.LabelAdapter{ {Name: "l1", Value: "v1"}, {Name: "l2", Value: "v2"}, {Name: "l3", Value: "v3"}, @@ -632,7 +633,7 @@ func TestPrometheusSampleHistogramInSyncWithMimirPbSampleHistogram(t *testing.T) // and https://go.dev/ref/spec#Assignability // More strict than necessary but is checked in compile time. func TestPrometheusLabelsInSyncWithMimirPbLabelAdapter(_ *testing.T) { - _ = labels.Label(LabelAdapter{}) + _ = labels.Label(mimirpb_custom.LabelAdapter{}) } // Check that Prometheus histogram.Span and MimirPb BucketSpan types @@ -642,65 +643,65 @@ func TestPrometheusHistogramSpanInSyncWithMimirPbBucketSpan(_ *testing.T) { } func TestCompareLabelAdapters(t *testing.T) { - labels := []LabelAdapter{ + labels := []mimirpb_custom.LabelAdapter{ {Name: "aaa", Value: "111"}, {Name: "bbb", Value: "222"}, } tests := []struct { - compared []LabelAdapter + compared []mimirpb_custom.LabelAdapter expected int }{ { - compared: []LabelAdapter{ + compared: []mimirpb_custom.LabelAdapter{ {Name: "aaa", Value: "110"}, {Name: "bbb", Value: "222"}, }, expected: 1, }, { - compared: []LabelAdapter{ + compared: []mimirpb_custom.LabelAdapter{ {Name: "aaa", Value: "111"}, {Name: "bbb", Value: "233"}, }, expected: -1, }, { - compared: []LabelAdapter{ + compared: []mimirpb_custom.LabelAdapter{ {Name: "aaa", Value: "111"}, {Name: "bar", Value: "222"}, }, expected: 1, }, { - compared: []LabelAdapter{ + compared: []mimirpb_custom.LabelAdapter{ {Name: "aaa", Value: "111"}, {Name: "bbc", Value: "222"}, }, expected: -1, }, { - compared: []LabelAdapter{ + compared: []mimirpb_custom.LabelAdapter{ {Name: "aaa", Value: "111"}, {Name: "bb", Value: "222"}, }, expected: 1, }, { - compared: []LabelAdapter{ + compared: []mimirpb_custom.LabelAdapter{ {Name: "aaa", Value: "111"}, {Name: "bbbb", Value: "222"}, }, expected: -1, }, { - compared: []LabelAdapter{ + compared: []mimirpb_custom.LabelAdapter{ {Name: "aaa", Value: "111"}, }, expected: 1, }, { - compared: []LabelAdapter{ + compared: []mimirpb_custom.LabelAdapter{ {Name: "aaa", Value: "111"}, {Name: "bbb", Value: "222"}, {Name: "ccc", Value: "333"}, @@ -709,14 +710,14 @@ func TestCompareLabelAdapters(t *testing.T) { expected: -2, }, { - compared: []LabelAdapter{ + compared: []mimirpb_custom.LabelAdapter{ {Name: "aaa", Value: "111"}, {Name: "bbb", Value: "222"}, }, expected: 0, }, { - compared: []LabelAdapter{}, + compared: []mimirpb_custom.LabelAdapter{}, expected: 1, }, } @@ -773,10 +774,10 @@ func benchmarkSeriesMap(numSeries int, b *testing.B) { } } -func makeSeries(n int) [][]LabelAdapter { - series := make([][]LabelAdapter, 0, n) +func makeSeries(n int) [][]mimirpb_custom.LabelAdapter { + series := make([][]mimirpb_custom.LabelAdapter, 0, n) for i := 0; i < n; i++ { - series = append(series, []LabelAdapter{ + series = append(series, []mimirpb_custom.LabelAdapter{ {Name: "label0", Value: "value0"}, {Name: "label1", Value: "value1"}, {Name: "label2", Value: "value2"}, diff --git a/pkg/mimirpb/mimir.pb.go b/pkg/mimirpb/mimir.pb.go index 2fcc5ccde1..c2385621b1 100644 --- a/pkg/mimirpb/mimir.pb.go +++ b/pkg/mimirpb/mimir.pb.go @@ -4,11 +4,11 @@ package mimirpb import ( - bytes "bytes" encoding_binary "encoding/binary" fmt "fmt" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" + mimirpb_custom "github.com/grafana/mimir/pkg/mimirpb_custom" github_com_prometheus_prometheus_model_histogram "github.com/prometheus/prometheus/model/histogram" io "io" math "math" @@ -140,7 +140,7 @@ var MetricMetadata_MetricType_value = map[string]int32{ } func (MetricMetadata_MetricType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_86d4d7485f544059, []int{6, 0} + return fileDescriptor_86d4d7485f544059, []int{5, 0} } type Histogram_ResetHint int32 @@ -167,7 +167,7 @@ var Histogram_ResetHint_value = map[string]int32{ } func (Histogram_ResetHint) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_86d4d7485f544059, []int{9, 0} + return fileDescriptor_86d4d7485f544059, []int{8, 0} } // These values correspond to the possible status values defined in https://github.com/prometheus/prometheus/blob/main/web/api/v1/api.go. @@ -189,7 +189,7 @@ var QueryResponse_Status_value = map[string]int32{ } func (QueryResponse_Status) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_86d4d7485f544059, []int{16, 0} + return fileDescriptor_86d4d7485f544059, []int{15, 0} } // These values correspond to the possible error type values defined in https://github.com/prometheus/prometheus/blob/main/web/api/v1/api.go. @@ -232,7 +232,7 @@ var QueryResponse_ErrorType_value = map[string]int32{ } func (QueryResponse_ErrorType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_86d4d7485f544059, []int{16, 1} + return fileDescriptor_86d4d7485f544059, []int{15, 1} } type WriteRequest struct { @@ -387,7 +387,7 @@ func (m *ErrorDetails) GetCause() ErrorCause { } type TimeSeries struct { - Labels []LabelAdapter `protobuf:"bytes,1,rep,name=labels,proto3,customtype=LabelAdapter" json:"labels"` + Labels []mimirpb_custom.LabelAdapter `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels"` // Sorted by time, oldest sample first. Samples []Sample `protobuf:"bytes,2,rep,name=samples,proto3" json:"samples"` Exemplars []Exemplar `protobuf:"bytes,3,rep,name=exemplars,proto3" json:"exemplars"` @@ -429,6 +429,13 @@ func (m *TimeSeries) XXX_DiscardUnknown() { var xxx_messageInfo_TimeSeries proto.InternalMessageInfo +func (m *TimeSeries) GetLabels() []mimirpb_custom.LabelAdapter { + if m != nil { + return m.Labels + } + return nil +} + func (m *TimeSeries) GetSamples() []Sample { if m != nil { return m.Samples @@ -450,57 +457,6 @@ func (m *TimeSeries) GetHistograms() []Histogram { return nil } -type LabelPair struct { - Name []byte `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (m *LabelPair) Reset() { *m = LabelPair{} } -func (*LabelPair) ProtoMessage() {} -func (*LabelPair) Descriptor() ([]byte, []int) { - return fileDescriptor_86d4d7485f544059, []int{4} -} -func (m *LabelPair) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LabelPair) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LabelPair.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *LabelPair) XXX_Merge(src proto.Message) { - xxx_messageInfo_LabelPair.Merge(m, src) -} -func (m *LabelPair) XXX_Size() int { - return m.Size() -} -func (m *LabelPair) XXX_DiscardUnknown() { - xxx_messageInfo_LabelPair.DiscardUnknown(m) -} - -var xxx_messageInfo_LabelPair proto.InternalMessageInfo - -func (m *LabelPair) GetName() []byte { - if m != nil { - return m.Name - } - return nil -} - -func (m *LabelPair) GetValue() []byte { - if m != nil { - return m.Value - } - return nil -} - type Sample struct { // Fields order MUST match promql.FPoint so that we can cast types between them. TimestampMs int64 `protobuf:"varint,2,opt,name=timestamp_ms,json=timestampMs,proto3" json:"timestamp_ms,omitempty"` @@ -510,7 +466,7 @@ type Sample struct { func (m *Sample) Reset() { *m = Sample{} } func (*Sample) ProtoMessage() {} func (*Sample) Descriptor() ([]byte, []int) { - return fileDescriptor_86d4d7485f544059, []int{5} + return fileDescriptor_86d4d7485f544059, []int{4} } func (m *Sample) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -563,7 +519,7 @@ type MetricMetadata struct { func (m *MetricMetadata) Reset() { *m = MetricMetadata{} } func (*MetricMetadata) ProtoMessage() {} func (*MetricMetadata) Descriptor() ([]byte, []int) { - return fileDescriptor_86d4d7485f544059, []int{6} + return fileDescriptor_86d4d7485f544059, []int{5} } func (m *MetricMetadata) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -621,13 +577,13 @@ func (m *MetricMetadata) GetUnit() string { } type Metric struct { - Labels []LabelAdapter `protobuf:"bytes,1,rep,name=labels,proto3,customtype=LabelAdapter" json:"labels"` + Labels []mimirpb_custom.LabelAdapter `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels"` } func (m *Metric) Reset() { *m = Metric{} } func (*Metric) ProtoMessage() {} func (*Metric) Descriptor() ([]byte, []int) { - return fileDescriptor_86d4d7485f544059, []int{7} + return fileDescriptor_86d4d7485f544059, []int{6} } func (m *Metric) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -656,17 +612,24 @@ func (m *Metric) XXX_DiscardUnknown() { var xxx_messageInfo_Metric proto.InternalMessageInfo +func (m *Metric) GetLabels() []mimirpb_custom.LabelAdapter { + if m != nil { + return m.Labels + } + return nil +} + type Exemplar struct { // Exemplar labels, different than series labels - Labels []LabelAdapter `protobuf:"bytes,1,rep,name=labels,proto3,customtype=LabelAdapter" json:"labels"` - Value float64 `protobuf:"fixed64,2,opt,name=value,proto3" json:"value,omitempty"` - TimestampMs int64 `protobuf:"varint,3,opt,name=timestamp_ms,json=timestampMs,proto3" json:"timestamp_ms,omitempty"` + Labels []mimirpb_custom.LabelAdapter `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels"` + Value float64 `protobuf:"fixed64,2,opt,name=value,proto3" json:"value,omitempty"` + TimestampMs int64 `protobuf:"varint,3,opt,name=timestamp_ms,json=timestampMs,proto3" json:"timestamp_ms,omitempty"` } func (m *Exemplar) Reset() { *m = Exemplar{} } func (*Exemplar) ProtoMessage() {} func (*Exemplar) Descriptor() ([]byte, []int) { - return fileDescriptor_86d4d7485f544059, []int{8} + return fileDescriptor_86d4d7485f544059, []int{7} } func (m *Exemplar) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -695,6 +658,13 @@ func (m *Exemplar) XXX_DiscardUnknown() { var xxx_messageInfo_Exemplar proto.InternalMessageInfo +func (m *Exemplar) GetLabels() []mimirpb_custom.LabelAdapter { + if m != nil { + return m.Labels + } + return nil +} + func (m *Exemplar) GetValue() float64 { if m != nil { return m.Value @@ -753,7 +723,7 @@ type Histogram struct { func (m *Histogram) Reset() { *m = Histogram{} } func (*Histogram) ProtoMessage() {} func (*Histogram) Descriptor() ([]byte, []int) { - return fileDescriptor_86d4d7485f544059, []int{9} + return fileDescriptor_86d4d7485f544059, []int{8} } func (m *Histogram) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -961,7 +931,7 @@ type FloatHistogram struct { func (m *FloatHistogram) Reset() { *m = FloatHistogram{} } func (*FloatHistogram) ProtoMessage() {} func (*FloatHistogram) Descriptor() ([]byte, []int) { - return fileDescriptor_86d4d7485f544059, []int{10} + return fileDescriptor_86d4d7485f544059, []int{9} } func (m *FloatHistogram) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1084,7 +1054,7 @@ type BucketSpan struct { func (m *BucketSpan) Reset() { *m = BucketSpan{} } func (*BucketSpan) ProtoMessage() {} func (*BucketSpan) Descriptor() ([]byte, []int) { - return fileDescriptor_86d4d7485f544059, []int{11} + return fileDescriptor_86d4d7485f544059, []int{10} } func (m *BucketSpan) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1136,7 +1106,7 @@ type FloatHistogramPair struct { func (m *FloatHistogramPair) Reset() { *m = FloatHistogramPair{} } func (*FloatHistogramPair) ProtoMessage() {} func (*FloatHistogramPair) Descriptor() ([]byte, []int) { - return fileDescriptor_86d4d7485f544059, []int{12} + return fileDescriptor_86d4d7485f544059, []int{11} } func (m *FloatHistogramPair) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1191,7 +1161,7 @@ type SampleHistogram struct { func (m *SampleHistogram) Reset() { *m = SampleHistogram{} } func (*SampleHistogram) ProtoMessage() {} func (*SampleHistogram) Descriptor() ([]byte, []int) { - return fileDescriptor_86d4d7485f544059, []int{13} + return fileDescriptor_86d4d7485f544059, []int{12} } func (m *SampleHistogram) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1252,7 +1222,7 @@ type HistogramBucket struct { func (m *HistogramBucket) Reset() { *m = HistogramBucket{} } func (*HistogramBucket) ProtoMessage() {} func (*HistogramBucket) Descriptor() ([]byte, []int) { - return fileDescriptor_86d4d7485f544059, []int{14} + return fileDescriptor_86d4d7485f544059, []int{13} } func (m *HistogramBucket) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1318,7 +1288,7 @@ type SampleHistogramPair struct { func (m *SampleHistogramPair) Reset() { *m = SampleHistogramPair{} } func (*SampleHistogramPair) ProtoMessage() {} func (*SampleHistogramPair) Descriptor() ([]byte, []int) { - return fileDescriptor_86d4d7485f544059, []int{15} + return fileDescriptor_86d4d7485f544059, []int{14} } func (m *SampleHistogramPair) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1379,7 +1349,7 @@ type QueryResponse struct { func (m *QueryResponse) Reset() { *m = QueryResponse{} } func (*QueryResponse) ProtoMessage() {} func (*QueryResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_86d4d7485f544059, []int{16} + return fileDescriptor_86d4d7485f544059, []int{15} } func (m *QueryResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1521,7 +1491,7 @@ type StringData struct { func (m *StringData) Reset() { *m = StringData{} } func (*StringData) ProtoMessage() {} func (*StringData) Descriptor() ([]byte, []int) { - return fileDescriptor_86d4d7485f544059, []int{17} + return fileDescriptor_86d4d7485f544059, []int{16} } func (m *StringData) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1572,7 +1542,7 @@ type VectorData struct { func (m *VectorData) Reset() { *m = VectorData{} } func (*VectorData) ProtoMessage() {} func (*VectorData) Descriptor() ([]byte, []int) { - return fileDescriptor_86d4d7485f544059, []int{18} + return fileDescriptor_86d4d7485f544059, []int{17} } func (m *VectorData) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1625,7 +1595,7 @@ type VectorSample struct { func (m *VectorSample) Reset() { *m = VectorSample{} } func (*VectorSample) ProtoMessage() {} func (*VectorSample) Descriptor() ([]byte, []int) { - return fileDescriptor_86d4d7485f544059, []int{19} + return fileDescriptor_86d4d7485f544059, []int{18} } func (m *VectorSample) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1685,7 +1655,7 @@ type VectorHistogram struct { func (m *VectorHistogram) Reset() { *m = VectorHistogram{} } func (*VectorHistogram) ProtoMessage() {} func (*VectorHistogram) Descriptor() ([]byte, []int) { - return fileDescriptor_86d4d7485f544059, []int{20} + return fileDescriptor_86d4d7485f544059, []int{19} } func (m *VectorHistogram) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1743,7 +1713,7 @@ type ScalarData struct { func (m *ScalarData) Reset() { *m = ScalarData{} } func (*ScalarData) ProtoMessage() {} func (*ScalarData) Descriptor() ([]byte, []int) { - return fileDescriptor_86d4d7485f544059, []int{21} + return fileDescriptor_86d4d7485f544059, []int{20} } func (m *ScalarData) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1793,7 +1763,7 @@ type MatrixData struct { func (m *MatrixData) Reset() { *m = MatrixData{} } func (*MatrixData) ProtoMessage() {} func (*MatrixData) Descriptor() ([]byte, []int) { - return fileDescriptor_86d4d7485f544059, []int{22} + return fileDescriptor_86d4d7485f544059, []int{21} } func (m *MatrixData) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1839,7 +1809,7 @@ type MatrixSeries struct { func (m *MatrixSeries) Reset() { *m = MatrixSeries{} } func (*MatrixSeries) ProtoMessage() {} func (*MatrixSeries) Descriptor() ([]byte, []int) { - return fileDescriptor_86d4d7485f544059, []int{23} + return fileDescriptor_86d4d7485f544059, []int{22} } func (m *MatrixSeries) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1900,7 +1870,6 @@ func init() { proto.RegisterType((*WriteResponse)(nil), "cortexpb.WriteResponse") proto.RegisterType((*ErrorDetails)(nil), "cortexpb.ErrorDetails") proto.RegisterType((*TimeSeries)(nil), "cortexpb.TimeSeries") - proto.RegisterType((*LabelPair)(nil), "cortexpb.LabelPair") proto.RegisterType((*Sample)(nil), "cortexpb.Sample") proto.RegisterType((*MetricMetadata)(nil), "cortexpb.MetricMetadata") proto.RegisterType((*Metric)(nil), "cortexpb.Metric") @@ -1925,134 +1894,135 @@ func init() { func init() { proto.RegisterFile("mimir.proto", fileDescriptor_86d4d7485f544059) } var fileDescriptor_86d4d7485f544059 = []byte{ - // 2029 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0xcf, 0x93, 0xdb, 0x48, - 0xf5, 0xb7, 0x6c, 0xf9, 0x87, 0xde, 0xd8, 0x33, 0x9d, 0x4e, 0x36, 0x5f, 0x6f, 0xbe, 0x1b, 0x27, - 0xd1, 0x16, 0xcb, 0x90, 0x82, 0x09, 0xb5, 0x81, 0x6c, 0x6d, 0x2a, 0xfc, 0x90, 0x6d, 0x25, 0xe3, - 0xc4, 0x96, 0x67, 0x5b, 0xf2, 0x84, 0x70, 0x51, 0x69, 0x3c, 0x3d, 0x33, 0xaa, 0xb5, 0x2c, 0x23, - 0xc9, 0xd9, 0x0c, 0x27, 0x2e, 0x50, 0x14, 0x27, 0x2e, 0x5c, 0x28, 0x6e, 0x5c, 0xa8, 0xe2, 0x1f, - 0x49, 0x15, 0x97, 0x1c, 0x17, 0x0e, 0x29, 0x32, 0xb9, 0x2c, 0x07, 0xaa, 0xb6, 0x28, 0x4e, 0x9c, - 0xa8, 0xee, 0xd6, 0x4f, 0xcf, 0x0c, 0x04, 0xc8, 0x4d, 0xef, 0xbd, 0xcf, 0x7b, 0xfd, 0xba, 0xdf, - 0x8f, 0x7e, 0x2d, 0x58, 0xf3, 0x5c, 0xcf, 0x0d, 0xb6, 0x16, 0x81, 0x1f, 0xf9, 0xb8, 0x31, 0xf5, - 0x83, 0x88, 0x3e, 0x5b, 0xec, 0x5d, 0xf9, 0xc6, 0xa1, 0x1b, 0x1d, 0x2d, 0xf7, 0xb6, 0xa6, 0xbe, - 0x77, 0xeb, 0xd0, 0x3f, 0xf4, 0x6f, 0x71, 0xc0, 0xde, 0xf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d, 0x54, 0x57, 0x1f, 0x41, - 0x4d, 0x2c, 0xfd, 0x16, 0x12, 0x51, 0xfd, 0x99, 0x04, 0x8d, 0x24, 0x79, 0xde, 0x46, 0x62, 0x17, - 0x52, 0x22, 0x89, 0xe7, 0xa9, 0x44, 0xa8, 0x9c, 0x4a, 0x04, 0xf5, 0x0f, 0x55, 0x50, 0xd2, 0x64, - 0xc4, 0x57, 0x41, 0x11, 0x4d, 0xc1, 0x9d, 0x47, 0x3c, 0xe4, 0xf2, 0x76, 0x89, 0x34, 0x38, 0x6b, - 0x30, 0x8f, 0xf0, 0x0d, 0x58, 0x13, 0xe2, 0x83, 0x99, 0xef, 0x44, 0x62, 0xad, 0xed, 0x12, 0x01, - 0xce, 0xbc, 0xcf, 0x78, 0x18, 0x41, 0x25, 0x5c, 0x7a, 0x7c, 0x25, 0x89, 0xb0, 0x4f, 0x7c, 0x19, - 0x6a, 0xe1, 0xf4, 0x88, 0x7a, 0x0e, 0x0f, 0xee, 0x05, 0x12, 0x53, 0xf8, 0x2b, 0xb0, 0xfe, 0x63, - 0x1a, 0xf8, 0x76, 0x74, 0x14, 0xd0, 0xf0, 0xc8, 0x9f, 0xed, 0xf3, 0x40, 0x4b, 0xa4, 0xc5, 0xb8, - 0x56, 0xc2, 0xc4, 0x1f, 0xc4, 0xb0, 0xcc, 0xaf, 0x1a, 0xf7, 0x4b, 0x22, 0x4d, 0xc6, 0xef, 0x25, - 0xbe, 0xdd, 0x04, 0x94, 0xc3, 0x09, 0x07, 0xeb, 0xdc, 0x41, 0x89, 0xac, 0xa7, 0x48, 0xe1, 0xa4, - 0x06, 0xeb, 0x73, 0x7a, 0xe8, 0x44, 0xee, 0x53, 0x6a, 0x87, 0x0b, 0x67, 0x1e, 0xb6, 0x1b, 0xab, - 0x17, 0x41, 0x77, 0x39, 0xfd, 0x94, 0x46, 0xe6, 0xc2, 0x99, 0xc7, 0x15, 0xda, 0x4a, 0x34, 0x18, - 0x2f, 0xc4, 0x5f, 0x85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 0x47, 0x7a, 0x71, 0xd2, 0x91, 0xfe, 0x7c, 0xd2, 0x91, 0xbe, 0x38, - 0xe9, 0x94, 0xbe, 0x3c, 0xe9, 0x48, 0xbf, 0x7c, 0xdd, 0x29, 0xbd, 0x78, 0xdd, 0x29, 0x7d, 0xfe, - 0xba, 0x53, 0xfa, 0x61, 0x9d, 0xff, 0x58, 0x5b, 0xec, 0xed, 0xd5, 0xf8, 0x2f, 0xb2, 0xdb, 0xff, - 0x0c, 0x00, 0x00, 0xff, 0xff, 0xc3, 0xd5, 0x81, 0xca, 0x6a, 0x13, 0x00, 0x00, + // 2033 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0xcd, 0x93, 0xdb, 0x48, + 0x15, 0xb7, 0x6c, 0x8d, 0x6d, 0xbd, 0xb1, 0x67, 0x3a, 0x9d, 0x6c, 0xf0, 0x0e, 0x1b, 0x27, 0xab, + 0x2d, 0x96, 0x21, 0x05, 0x13, 0x6a, 0x43, 0x65, 0x6b, 0x43, 0xf8, 0x90, 0x6d, 0x25, 0xe3, 0xac, + 0x2d, 0xcf, 0xb6, 0xe4, 0x84, 0x70, 0x51, 0x69, 0x3c, 0x3d, 0x33, 0xaa, 0x58, 0x92, 0x91, 0xe4, + 0x6c, 0xc2, 0x69, 0x2f, 0x54, 0x51, 0x9c, 0xb8, 0x70, 0xa1, 0xb8, 0x71, 0xa1, 0x8a, 0x7f, 0x24, + 0x55, 0x5c, 0x72, 0x5c, 0x38, 0xa4, 0xc8, 0xe4, 0xb2, 0x1c, 0xa0, 0xb6, 0x38, 0x72, 0xa2, 0xba, + 0x5b, 0x9f, 0x9e, 0x09, 0x04, 0xb2, 0x37, 0xbd, 0xf7, 0x7e, 0xaf, 0xfb, 0xa7, 0x7e, 0x1f, 0x7a, + 0x2d, 0x58, 0xf7, 0x5c, 0xcf, 0x0d, 0x77, 0x16, 0x61, 0x10, 0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, 0x1d, 0x23, 0x68, 0x59, 0xba, 0xa1, 0x19, 0x56, 0x42, + 0xa0, 0xd5, 0xfb, 0xc1, 0xb3, 0x17, 0xdd, 0xca, 0xe7, 0x2f, 0xba, 0x95, 0x2f, 0x5f, 0x74, 0xa5, + 0xcf, 0x4e, 0xba, 0xd2, 0x1f, 0x4e, 0xba, 0xd2, 0xd3, 0x93, 0xae, 0xf4, 0xec, 0xa4, 0x2b, 0xfd, + 0xf5, 0xa4, 0x2b, 0x7d, 0x71, 0xd2, 0xad, 0x7c, 0x79, 0xd2, 0x95, 0x7e, 0xfd, 0xb2, 0x5b, 0x79, + 0xf6, 0xb2, 0x5b, 0xf9, 0xfc, 0x65, 0xb7, 0xf2, 0xd3, 0x46, 0xf2, 0xcb, 0x6b, 0xbf, 0xce, 0xff, + 0x6c, 0x5d, 0xff, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0x76, 0x95, 0x60, 0x64, 0x67, 0x13, 0x00, + 0x00, } func (x ErrorCause) String() string { @@ -2211,7 +2181,7 @@ func (this *TimeSeries) Equal(that interface{}) bool { return false } for i := range this.Labels { - if !this.Labels[i].Equal(that1.Labels[i]) { + if !this.Labels[i].Equal(&that1.Labels[i]) { return false } } @@ -2241,33 +2211,6 @@ func (this *TimeSeries) Equal(that interface{}) bool { } return true } -func (this *LabelPair) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*LabelPair) - if !ok { - that2, ok := that.(LabelPair) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !bytes.Equal(this.Name, that1.Name) { - return false - } - if !bytes.Equal(this.Value, that1.Value) { - return false - } - return true -} func (this *Sample) Equal(that interface{}) bool { if that == nil { return this == nil @@ -2351,7 +2294,7 @@ func (this *Metric) Equal(that interface{}) bool { return false } for i := range this.Labels { - if !this.Labels[i].Equal(that1.Labels[i]) { + if !this.Labels[i].Equal(&that1.Labels[i]) { return false } } @@ -2380,7 +2323,7 @@ func (this *Exemplar) Equal(that interface{}) bool { return false } for i := range this.Labels { - if !this.Labels[i].Equal(that1.Labels[i]) { + if !this.Labels[i].Equal(&that1.Labels[i]) { return false } } @@ -3245,7 +3188,13 @@ func (this *TimeSeries) GoString() string { } s := make([]string, 0, 8) s = append(s, "&mimirpb.TimeSeries{") - s = append(s, "Labels: "+fmt.Sprintf("%#v", this.Labels)+",\n") + if this.Labels != nil { + vs := make([]*mimirpb_custom.LabelAdapter, len(this.Labels)) + for i := range vs { + vs[i] = &this.Labels[i] + } + s = append(s, "Labels: "+fmt.Sprintf("%#v", vs)+",\n") + } if this.Samples != nil { vs := make([]*Sample, len(this.Samples)) for i := range vs { @@ -3270,17 +3219,6 @@ func (this *TimeSeries) GoString() string { s = append(s, "}") return strings.Join(s, "") } -func (this *LabelPair) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&mimirpb.LabelPair{") - s = append(s, "Name: "+fmt.Sprintf("%#v", this.Name)+",\n") - s = append(s, "Value: "+fmt.Sprintf("%#v", this.Value)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} func (this *Sample) GoString() string { if this == nil { return "nil" @@ -3311,7 +3249,13 @@ func (this *Metric) GoString() string { } s := make([]string, 0, 5) s = append(s, "&mimirpb.Metric{") - s = append(s, "Labels: "+fmt.Sprintf("%#v", this.Labels)+",\n") + if this.Labels != nil { + vs := make([]*mimirpb_custom.LabelAdapter, len(this.Labels)) + for i := range vs { + vs[i] = &this.Labels[i] + } + s = append(s, "Labels: "+fmt.Sprintf("%#v", vs)+",\n") + } s = append(s, "}") return strings.Join(s, "") } @@ -3321,7 +3265,13 @@ func (this *Exemplar) GoString() string { } s := make([]string, 0, 7) s = append(s, "&mimirpb.Exemplar{") - s = append(s, "Labels: "+fmt.Sprintf("%#v", this.Labels)+",\n") + if this.Labels != nil { + vs := make([]*mimirpb_custom.LabelAdapter, len(this.Labels)) + for i := range vs { + vs[i] = &this.Labels[i] + } + s = append(s, "Labels: "+fmt.Sprintf("%#v", vs)+",\n") + } s = append(s, "Value: "+fmt.Sprintf("%#v", this.Value)+",\n") s = append(s, "TimestampMs: "+fmt.Sprintf("%#v", this.TimestampMs)+",\n") s = append(s, "}") @@ -3855,11 +3805,11 @@ func (m *TimeSeries) MarshalToSizedBuffer(dAtA []byte) (int, error) { if len(m.Labels) > 0 { for iNdEx := len(m.Labels) - 1; iNdEx >= 0; iNdEx-- { { - size := m.Labels[iNdEx].Size() - i -= size - if _, err := m.Labels[iNdEx].MarshalTo(dAtA[i:]); err != nil { + size, err := m.Labels[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { return 0, err } + i -= size i = encodeVarintMimir(dAtA, i, uint64(size)) } i-- @@ -3869,43 +3819,6 @@ func (m *TimeSeries) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *LabelPair) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *LabelPair) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LabelPair) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Value) > 0 { - i -= len(m.Value) - copy(dAtA[i:], m.Value) - i = encodeVarintMimir(dAtA, i, uint64(len(m.Value))) - i-- - dAtA[i] = 0x12 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintMimir(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - func (m *Sample) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -4012,11 +3925,11 @@ func (m *Metric) MarshalToSizedBuffer(dAtA []byte) (int, error) { if len(m.Labels) > 0 { for iNdEx := len(m.Labels) - 1; iNdEx >= 0; iNdEx-- { { - size := m.Labels[iNdEx].Size() - i -= size - if _, err := m.Labels[iNdEx].MarshalTo(dAtA[i:]); err != nil { + size, err := m.Labels[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { return 0, err } + i -= size i = encodeVarintMimir(dAtA, i, uint64(size)) } i-- @@ -4060,11 +3973,11 @@ func (m *Exemplar) MarshalToSizedBuffer(dAtA []byte) (int, error) { if len(m.Labels) > 0 { for iNdEx := len(m.Labels) - 1; iNdEx >= 0; iNdEx-- { { - size := m.Labels[iNdEx].Size() - i -= size - if _, err := m.Labels[iNdEx].MarshalTo(dAtA[i:]); err != nil { + size, err := m.Labels[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { return 0, err } + i -= size i = encodeVarintMimir(dAtA, i, uint64(size)) } i-- @@ -5148,23 +5061,6 @@ func (m *TimeSeries) Size() (n int) { return n } -func (m *LabelPair) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovMimir(uint64(l)) - } - l = len(m.Value) - if l > 0 { - n += 1 + l + sovMimir(uint64(l)) - } - return n -} - func (m *Sample) Size() (n int) { if m == nil { return 0 @@ -5740,6 +5636,11 @@ func (this *TimeSeries) String() string { if this == nil { return "nil" } + repeatedStringForLabels := "[]LabelAdapter{" + for _, f := range this.Labels { + repeatedStringForLabels += fmt.Sprintf("%v", f) + "," + } + repeatedStringForLabels += "}" repeatedStringForSamples := "[]Sample{" for _, f := range this.Samples { repeatedStringForSamples += strings.Replace(strings.Replace(f.String(), "Sample", "Sample", 1), `&`, ``, 1) + "," @@ -5756,7 +5657,7 @@ func (this *TimeSeries) String() string { } repeatedStringForHistograms += "}" s := strings.Join([]string{`&TimeSeries{`, - `Labels:` + fmt.Sprintf("%v", this.Labels) + `,`, + `Labels:` + repeatedStringForLabels + `,`, `Samples:` + repeatedStringForSamples + `,`, `Exemplars:` + repeatedStringForExemplars + `,`, `Histograms:` + repeatedStringForHistograms + `,`, @@ -5764,17 +5665,6 @@ func (this *TimeSeries) String() string { }, "") return s } -func (this *LabelPair) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&LabelPair{`, - `Name:` + fmt.Sprintf("%v", this.Name) + `,`, - `Value:` + fmt.Sprintf("%v", this.Value) + `,`, - `}`, - }, "") - return s -} func (this *Sample) String() string { if this == nil { return "nil" @@ -5803,8 +5693,13 @@ func (this *Metric) String() string { if this == nil { return "nil" } + repeatedStringForLabels := "[]LabelAdapter{" + for _, f := range this.Labels { + repeatedStringForLabels += fmt.Sprintf("%v", f) + "," + } + repeatedStringForLabels += "}" s := strings.Join([]string{`&Metric{`, - `Labels:` + fmt.Sprintf("%v", this.Labels) + `,`, + `Labels:` + repeatedStringForLabels + `,`, `}`, }, "") return s @@ -5813,8 +5708,13 @@ func (this *Exemplar) String() string { if this == nil { return "nil" } + repeatedStringForLabels := "[]LabelAdapter{" + for _, f := range this.Labels { + repeatedStringForLabels += fmt.Sprintf("%v", f) + "," + } + repeatedStringForLabels += "}" s := strings.Join([]string{`&Exemplar{`, - `Labels:` + fmt.Sprintf("%v", this.Labels) + `,`, + `Labels:` + repeatedStringForLabels + `,`, `Value:` + fmt.Sprintf("%v", this.Value) + `,`, `TimestampMs:` + fmt.Sprintf("%v", this.TimestampMs) + `,`, `}`, @@ -6517,7 +6417,7 @@ func (m *TimeSeries) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Labels = append(m.Labels, LabelAdapter{}) + m.Labels = append(m.Labels, mimirpb_custom.LabelAdapter{}) if err := m.Labels[len(m.Labels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -6650,127 +6550,6 @@ func (m *TimeSeries) Unmarshal(dAtA []byte) error { } return nil } -func (m *LabelPair) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMimir - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: LabelPair: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LabelPair: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMimir - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthMimir - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthMimir - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = append(m.Name[:0], dAtA[iNdEx:postIndex]...) - if m.Name == nil { - m.Name = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMimir - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthMimir - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthMimir - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) - if m.Value == nil { - m.Value = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipMimir(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMimir - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthMimir - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *Sample) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -7080,7 +6859,7 @@ func (m *Metric) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Labels = append(m.Labels, LabelAdapter{}) + m.Labels = append(m.Labels, mimirpb_custom.LabelAdapter{}) if err := m.Labels[len(m.Labels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -7167,7 +6946,7 @@ func (m *Exemplar) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Labels = append(m.Labels, LabelAdapter{}) + m.Labels = append(m.Labels, mimirpb_custom.LabelAdapter{}) if err := m.Labels[len(m.Labels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/pkg/mimirpb/mimir.proto b/pkg/mimirpb/mimir.proto index a22b619cdf..3e2e058928 100644 --- a/pkg/mimirpb/mimir.proto +++ b/pkg/mimirpb/mimir.proto @@ -13,6 +13,7 @@ package cortexpb; option go_package = "mimirpb"; import "github.com/gogo/protobuf/gogoproto/gogo.proto"; +import "github.com/grafana/mimir/pkg/mimirpb_custom/mimir_custom_types.proto"; option (gogoproto.marshaler_all) = true; option (gogoproto.unmarshaler_all) = true; @@ -58,17 +59,17 @@ message ErrorDetails { } message TimeSeries { - repeated LabelPair labels = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "LabelAdapter"]; + repeated cortexpb_custom.LabelAdapter labels = 1 [(gogoproto.nullable) = false]; // Sorted by time, oldest sample first. repeated Sample samples = 2 [(gogoproto.nullable) = false]; repeated Exemplar exemplars = 3 [(gogoproto.nullable) = false]; repeated Histogram histograms = 4 [(gogoproto.nullable) = false]; } -message LabelPair { - bytes name = 1; - bytes value = 2; -} +//message LabelPair { +// bytes name = 1; +// bytes value = 2; +//} message Sample { // Fields order MUST match promql.FPoint so that we can cast types between them. @@ -95,12 +96,12 @@ message MetricMetadata { } message Metric { - repeated LabelPair labels = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "LabelAdapter"]; + repeated cortexpb_custom.LabelAdapter labels = 1 [(gogoproto.nullable) = false]; } message Exemplar { // Exemplar labels, different than series labels - repeated LabelPair labels = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "LabelAdapter"]; + repeated cortexpb_custom.LabelAdapter labels = 1 [(gogoproto.nullable) = false]; double value = 2; int64 timestamp_ms = 3; } diff --git a/pkg/mimirpb/series_sharding.go b/pkg/mimirpb/series_sharding.go index 2c0f6d7259..5326bb1d59 100644 --- a/pkg/mimirpb/series_sharding.go +++ b/pkg/mimirpb/series_sharding.go @@ -7,6 +7,8 @@ package mimirpb import ( "github.com/prometheus/prometheus/model/labels" + + "github.com/grafana/mimir/pkg/mimirpb_custom" ) // ShardByMetricName returns the token for the given metric. The provided metricName @@ -36,7 +38,7 @@ func ShardByAllLabels(userID string, ls labels.Labels) uint32 { } // ShardByAllLabelAdapters is like ShardByAllLabel, but uses LabelAdapter type. -func ShardByAllLabelAdapters(userID string, ls []LabelAdapter) uint32 { +func ShardByAllLabelAdapters(userID string, ls []mimirpb_custom.LabelAdapter) uint32 { h := ShardByUser(userID) for _, l := range ls { h = HashAdd32(h, l.Name) diff --git a/pkg/mimirpb/series_sharding_test.go b/pkg/mimirpb/series_sharding_test.go index 971079922b..f214e8ba78 100644 --- a/pkg/mimirpb/series_sharding_test.go +++ b/pkg/mimirpb/series_sharding_test.go @@ -9,17 +9,19 @@ import ( "testing" "github.com/stretchr/testify/assert" + + "github.com/grafana/mimir/pkg/mimirpb_custom" ) // This is not great, but we deal with unsorted labels in prePushRelabelMiddleware. func TestShardByAllLabelAdaptersReturnsWrongResultsForUnsortedLabels(t *testing.T) { - val1 := ShardByAllLabelAdapters("test", []LabelAdapter{ + val1 := ShardByAllLabelAdapters("test", []mimirpb_custom.LabelAdapter{ {Name: "__name__", Value: "foo"}, {Name: "bar", Value: "baz"}, {Name: "sample", Value: "1"}, }) - val2 := ShardByAllLabelAdapters("test", []LabelAdapter{ + val2 := ShardByAllLabelAdapters("test", []mimirpb_custom.LabelAdapter{ {Name: "__name__", Value: "foo"}, {Name: "sample", Value: "1"}, {Name: "bar", Value: "baz"}, diff --git a/pkg/mimirpb/timeseries.go b/pkg/mimirpb/timeseries.go index 3726621775..7415c9c85f 100644 --- a/pkg/mimirpb/timeseries.go +++ b/pkg/mimirpb/timeseries.go @@ -6,16 +6,14 @@ package mimirpb import ( - "fmt" - "io" "slices" "sort" - "strings" "sync" "unsafe" - "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/util/zeropool" + + "github.com/grafana/mimir/pkg/mimirpb_custom" ) const ( @@ -37,7 +35,7 @@ var ( timeSeriesPool = sync.Pool{ New: func() interface{} { return &TimeSeries{ - Labels: make([]LabelAdapter, 0, minPreallocatedLabels), + Labels: make([]mimirpb_custom.LabelAdapter, 0, minPreallocatedLabels), Samples: make([]Sample, 0, minPreallocatedSamplesPerSeries), Exemplars: make([]Exemplar, 0, minPreallocatedExemplarsPerSeries), Histograms: nil, @@ -109,7 +107,7 @@ func (p *PreallocTimeseries) RemoveLabel(labelName string) { } } -func (p *PreallocTimeseries) SetLabels(lbls []LabelAdapter) { +func (p *PreallocTimeseries) SetLabels(lbls []mimirpb_custom.LabelAdapter) { p.Labels = lbls // We can't reuse raw unmarshalled data for the timeseries after setting new labels. @@ -149,7 +147,7 @@ func (p *PreallocTimeseries) SortLabelsIfNeeded() { return } - slices.SortFunc(p.Labels, func(a, b LabelAdapter) int { + slices.SortFunc(p.Labels, func(a, b mimirpb_custom.LabelAdapter) int { switch { case a.Name < b.Name: return -1 @@ -256,201 +254,10 @@ func (p *PreallocTimeseries) MarshalToSizedBuffer(buf []byte) (int, error) { return p.TimeSeries.MarshalToSizedBuffer(buf) } -// LabelAdapter is a labels.Label that can be marshalled to/from protos. -type LabelAdapter labels.Label - -// Marshal implements proto.Marshaller. -func (bs *LabelAdapter) Marshal() ([]byte, error) { - size := bs.Size() - buf := make([]byte, size) - n, err := bs.MarshalToSizedBuffer(buf[:size]) - if err != nil { - return nil, err - } - return buf[:n], err -} - -func (bs *LabelAdapter) MarshalTo(dAtA []byte) (int, error) { - size := bs.Size() - return bs.MarshalToSizedBuffer(dAtA[:size]) -} - -// MarshalTo implements proto.Marshaller. -func (bs *LabelAdapter) MarshalToSizedBuffer(buf []byte) (n int, err error) { - ls := (*labels.Label)(bs) - i := len(buf) - if len(ls.Value) > 0 { - i -= len(ls.Value) - copy(buf[i:], ls.Value) - i = encodeVarintMimir(buf, i, uint64(len(ls.Value))) - i-- - buf[i] = 0x12 - } - if len(ls.Name) > 0 { - i -= len(ls.Name) - copy(buf[i:], ls.Name) - i = encodeVarintMimir(buf, i, uint64(len(ls.Name))) - i-- - buf[i] = 0xa - } - return len(buf) - i, nil -} - -// Unmarshal a LabelAdapter, implements proto.Unmarshaller. -// NB this is a copy of the autogenerated code to unmarshal a LabelPair, -// with the byte copying replaced with a yoloString. -func (bs *LabelAdapter) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMimir - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: LabelPair: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LabelPair: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMimir - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthMimir - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthMimir - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - bs.Name = yoloString(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMimir - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthMimir - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthMimir - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - bs.Value = yoloString(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipMimir(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMimir - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthMimir - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - func yoloString(buf []byte) string { return *((*string)(unsafe.Pointer(&buf))) } -// Size implements proto.Sizer. -func (bs *LabelAdapter) Size() (n int) { - ls := (*labels.Label)(bs) - if bs == nil { - return 0 - } - var l int - _ = l - l = len(ls.Name) - if l > 0 { - n += 1 + l + sovMimir(uint64(l)) - } - l = len(ls.Value) - if l > 0 { - n += 1 + l + sovMimir(uint64(l)) - } - return n -} - -// Equal implements proto.Equaler. -func (bs *LabelAdapter) Equal(other LabelAdapter) bool { - return bs.Name == other.Name && bs.Value == other.Value -} - -// Compare implements proto.Comparer. -func (bs *LabelAdapter) Compare(other LabelAdapter) int { - if c := strings.Compare(bs.Name, other.Name); c != 0 { - return c - } - return strings.Compare(bs.Value, other.Value) -} - // PreallocTimeseriesSliceFromPool retrieves a slice of PreallocTimeseries from a sync.Pool. // ReuseSlice should be called once done. func PreallocTimeseriesSliceFromPool() []PreallocTimeseries { @@ -654,9 +461,9 @@ func countTotalLabelLen(ts *TimeSeries, includeExemplars bool) int { // copyToYoloLabels copies the values of src to dst, it uses the given buffer to store all the string values in it. // The returned buffer is the remainder of the given buffer, which remains unused after the copying is complete. -func copyToYoloLabels(buf []byte, dst, src []LabelAdapter) ([]LabelAdapter, []byte) { +func copyToYoloLabels(buf []byte, dst, src []mimirpb_custom.LabelAdapter) ([]mimirpb_custom.LabelAdapter, []byte) { if cap(dst) < len(src) { - dst = make([]LabelAdapter, len(src)) + dst = make([]mimirpb_custom.LabelAdapter, len(src)) } else { dst = dst[:len(src)] } diff --git a/pkg/mimirpb/timeseries_test.go b/pkg/mimirpb/timeseries_test.go index 0fb4888478..b3c8de15d5 100644 --- a/pkg/mimirpb/timeseries_test.go +++ b/pkg/mimirpb/timeseries_test.go @@ -17,22 +17,24 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + + "github.com/grafana/mimir/pkg/mimirpb_custom" ) func TestLabelAdapter_Marshal(t *testing.T) { tests := []struct { - bs *LabelAdapter + bs *mimirpb_custom.LabelAdapter }{ - {&LabelAdapter{Name: "foo", Value: "bar"}}, - {&LabelAdapter{Name: "very long label name", Value: "very long label value"}}, - {&LabelAdapter{Name: "", Value: "foo"}}, - {&LabelAdapter{}}, + {&mimirpb_custom.LabelAdapter{Name: "foo", Value: "bar"}}, + {&mimirpb_custom.LabelAdapter{Name: "very long label name", Value: "very long label value"}}, + {&mimirpb_custom.LabelAdapter{Name: "", Value: "foo"}}, + {&mimirpb_custom.LabelAdapter{}}, } for _, tt := range tests { t.Run(tt.bs.Name, func(t *testing.T) { bytes, err := tt.bs.Marshal() require.NoError(t, err) - lbs := &LabelAdapter{} + lbs := &mimirpb_custom.LabelAdapter{} require.NoError(t, lbs.Unmarshal(bytes)) require.EqualValues(t, tt.bs, lbs) }) @@ -67,7 +69,7 @@ func TestTimeseriesFromPool(t *testing.T) { t.Run("instance is cleaned before reusing", func(t *testing.T) { ts := TimeseriesFromPool() - ts.Labels = []LabelAdapter{{Name: "foo", Value: "bar"}} + ts.Labels = []mimirpb_custom.LabelAdapter{{Name: "foo", Value: "bar"}} ts.Samples = []Sample{{Value: 1, TimestampMs: 2}} ReuseTimeseries(ts) @@ -113,7 +115,7 @@ func TestCopyToYoloString(t *testing.T) { func TestDeepCopyTimeseries(t *testing.T) { src := PreallocTimeseries{ TimeSeries: &TimeSeries{ - Labels: []LabelAdapter{ + Labels: []mimirpb_custom.LabelAdapter{ {Name: "sampleLabel1", Value: "sampleValue1"}, {Name: "sampleLabel2", Value: "sampleValue2"}, }, @@ -138,7 +140,7 @@ func TestDeepCopyTimeseries(t *testing.T) { Exemplars: []Exemplar{{ Value: 1, TimestampMs: 2, - Labels: []LabelAdapter{ + Labels: []mimirpb_custom.LabelAdapter{ {Name: "exemplarLabel1", Value: "exemplarValue1"}, {Name: "exemplarLabel2", Value: "exemplarValue2"}, }, @@ -244,7 +246,7 @@ func TestDeepCopyTimeseries(t *testing.T) { func TestDeepCopyTimeseriesExemplars(t *testing.T) { src := PreallocTimeseries{ TimeSeries: &TimeSeries{ - Labels: []LabelAdapter{ + Labels: []mimirpb_custom.LabelAdapter{ {Name: "sampleLabel1", Value: "sampleValue1"}, {Name: "sampleLabel2", Value: "sampleValue2"}, }, @@ -259,7 +261,7 @@ func TestDeepCopyTimeseriesExemplars(t *testing.T) { src.Exemplars = append(src.Exemplars, Exemplar{ Value: 1, TimestampMs: 2, - Labels: []LabelAdapter{ + Labels: []mimirpb_custom.LabelAdapter{ {Name: "exemplarLabel1", Value: "exemplarValue1"}, {Name: "exemplarLabel2", Value: "exemplarValue2"}, }, @@ -286,7 +288,7 @@ func TestPreallocTimeseries_Unmarshal(t *testing.T) { { src := PreallocTimeseries{ TimeSeries: &TimeSeries{ - Labels: []LabelAdapter{ + Labels: []mimirpb_custom.LabelAdapter{ {Name: "sampleLabel1", Value: "sampleValue1"}, {Name: "sampleLabel2", Value: "sampleValue2"}, }, @@ -380,7 +382,7 @@ func TestPreallocTimeseries_SortLabelsIfNeeded(t *testing.T) { t.Run("sorted", func(t *testing.T) { sorted := PreallocTimeseries{ TimeSeries: &TimeSeries{ - Labels: []LabelAdapter{ + Labels: []mimirpb_custom.LabelAdapter{ {Name: "__name__", Value: "foo"}, {Name: "bar", Value: "baz"}, {Name: "cluster", Value: "cluster"}, @@ -399,7 +401,7 @@ func TestPreallocTimeseries_SortLabelsIfNeeded(t *testing.T) { t.Run("unsorted", func(t *testing.T) { unsorted := PreallocTimeseries{ TimeSeries: &TimeSeries{ - Labels: []LabelAdapter{ + Labels: []mimirpb_custom.LabelAdapter{ {Name: "__name__", Value: "foo"}, {Name: "sample", Value: "1"}, {Name: "cluster", Value: "cluster"}, @@ -422,7 +424,7 @@ func TestPreallocTimeseries_RemoveLabel(t *testing.T) { t.Run("with label", func(t *testing.T) { p := PreallocTimeseries{ TimeSeries: &TimeSeries{ - Labels: []LabelAdapter{ + Labels: []mimirpb_custom.LabelAdapter{ {Name: "__name__", Value: "foo"}, {Name: "bar", Value: "baz"}, }, @@ -431,14 +433,14 @@ func TestPreallocTimeseries_RemoveLabel(t *testing.T) { } p.RemoveLabel("bar") - require.Equal(t, []LabelAdapter{{Name: "__name__", Value: "foo"}}, p.Labels) + require.Equal(t, []mimirpb_custom.LabelAdapter{{Name: "__name__", Value: "foo"}}, p.Labels) require.Nil(t, p.marshalledData) }) t.Run("with no matching label", func(t *testing.T) { p := PreallocTimeseries{ TimeSeries: &TimeSeries{ - Labels: []LabelAdapter{ + Labels: []mimirpb_custom.LabelAdapter{ {Name: "__name__", Value: "foo"}, {Name: "bar", Value: "baz"}, }, @@ -447,7 +449,7 @@ func TestPreallocTimeseries_RemoveLabel(t *testing.T) { } p.RemoveLabel("foo") - require.Equal(t, []LabelAdapter{{Name: "__name__", Value: "foo"}, {Name: "bar", Value: "baz"}}, p.Labels) + require.Equal(t, []mimirpb_custom.LabelAdapter{{Name: "__name__", Value: "foo"}, {Name: "bar", Value: "baz"}}, p.Labels) require.NotNil(t, p.marshalledData) }) } @@ -456,7 +458,7 @@ func TestPreallocTimeseries_RemoveEmptyLabelValues(t *testing.T) { t.Run("with empty labels", func(t *testing.T) { p := PreallocTimeseries{ TimeSeries: &TimeSeries{ - Labels: []LabelAdapter{ + Labels: []mimirpb_custom.LabelAdapter{ {Name: "__name__", Value: "foo"}, {Name: "empty1", Value: ""}, {Name: "bar", Value: "baz"}, @@ -467,14 +469,14 @@ func TestPreallocTimeseries_RemoveEmptyLabelValues(t *testing.T) { } p.RemoveEmptyLabelValues() - require.Equal(t, []LabelAdapter{{Name: "__name__", Value: "foo"}, {Name: "bar", Value: "baz"}}, p.Labels) + require.Equal(t, []mimirpb_custom.LabelAdapter{{Name: "__name__", Value: "foo"}, {Name: "bar", Value: "baz"}}, p.Labels) require.Nil(t, p.marshalledData) }) t.Run("without empty labels", func(t *testing.T) { p := PreallocTimeseries{ TimeSeries: &TimeSeries{ - Labels: []LabelAdapter{ + Labels: []mimirpb_custom.LabelAdapter{ {Name: "__name__", Value: "foo"}, {Name: "bar", Value: "baz"}, }, @@ -483,7 +485,7 @@ func TestPreallocTimeseries_RemoveEmptyLabelValues(t *testing.T) { } p.RemoveLabel("foo") - require.Equal(t, []LabelAdapter{{Name: "__name__", Value: "foo"}, {Name: "bar", Value: "baz"}}, p.Labels) + require.Equal(t, []mimirpb_custom.LabelAdapter{{Name: "__name__", Value: "foo"}, {Name: "bar", Value: "baz"}}, p.Labels) require.NotNil(t, p.marshalledData) }) } @@ -491,14 +493,14 @@ func TestPreallocTimeseries_RemoveEmptyLabelValues(t *testing.T) { func TestPreallocTimeseries_SetLabels(t *testing.T) { p := PreallocTimeseries{ TimeSeries: &TimeSeries{ - Labels: []LabelAdapter{ + Labels: []mimirpb_custom.LabelAdapter{ {Name: "__name__", Value: "foo"}, {Name: "bar", Value: "baz"}, }, }, marshalledData: []byte{1, 2, 3}, } - expected := []LabelAdapter{{Name: "__name__", Value: "hello"}, {Name: "lbl", Value: "world"}} + expected := []mimirpb_custom.LabelAdapter{{Name: "__name__", Value: "hello"}, {Name: "lbl", Value: "world"}} p.SetLabels(expected) require.Equal(t, expected, p.Labels) @@ -515,7 +517,7 @@ func TestPreallocTimeseries_ResizeExemplars(t *testing.T) { } for i := range p.Exemplars { - p.Exemplars[i] = Exemplar{Labels: []LabelAdapter{{Name: "trace", Value: "1"}, {Name: "service", Value: "A"}}, Value: 1, TimestampMs: int64(i)} + p.Exemplars[i] = Exemplar{Labels: []mimirpb_custom.LabelAdapter{{Name: "trace", Value: "1"}, {Name: "service", Value: "A"}}, Value: 1, TimestampMs: int64(i)} } p.ResizeExemplars(5) require.Len(t, p.Exemplars, 5) @@ -529,16 +531,16 @@ func BenchmarkPreallocTimeseries_SortLabelsIfNeeded(b *testing.B) { for _, lbCount := range bcs { b.Run(fmt.Sprintf("num_labels=%d", lbCount), func(b *testing.B) { // Generate labels set in reverse order for worst case. - unorderedLabels := make([]LabelAdapter, 0, lbCount) + unorderedLabels := make([]mimirpb_custom.LabelAdapter, 0, lbCount) for i := 0; i < lbCount; i++ { lbName := fmt.Sprintf("lbl_%d", lbCount-i) lbValue := fmt.Sprintf("val_%d", lbCount-i) - unorderedLabels = append(unorderedLabels, LabelAdapter{Name: lbName, Value: lbValue}) + unorderedLabels = append(unorderedLabels, mimirpb_custom.LabelAdapter{Name: lbName, Value: lbValue}) } b.Run("unordered", benchmarkSortLabelsIfNeeded(unorderedLabels)) - slices.SortFunc(unorderedLabels, func(a, b LabelAdapter) int { + slices.SortFunc(unorderedLabels, func(a, b mimirpb_custom.LabelAdapter) int { switch { case a.Name < b.Name: return -1 @@ -553,12 +555,12 @@ func BenchmarkPreallocTimeseries_SortLabelsIfNeeded(b *testing.B) { } } -func benchmarkSortLabelsIfNeeded(inputLabels []LabelAdapter) func(b *testing.B) { +func benchmarkSortLabelsIfNeeded(inputLabels []mimirpb_custom.LabelAdapter) func(b *testing.B) { return func(b *testing.B) { // Copy unordered labels set for each benchmark iteration. - benchmarkUnorderedLabels := make([][]LabelAdapter, b.N) + benchmarkUnorderedLabels := make([][]mimirpb_custom.LabelAdapter, b.N) for i := 0; i < b.N; i++ { - benchmarkLabels := make([]LabelAdapter, len(inputLabels)) + benchmarkLabels := make([]mimirpb_custom.LabelAdapter, len(inputLabels)) copy(benchmarkLabels, inputLabels) benchmarkUnorderedLabels[i] = benchmarkLabels } @@ -579,8 +581,8 @@ func benchmarkSortLabelsIfNeeded(inputLabels []LabelAdapter) func(b *testing.B) func TestClearExemplars(t *testing.T) { t.Run("should reset TimeSeries.Exemplars keeping the slices if there are <= 10 entries", func(t *testing.T) { ts := &TimeSeries{Exemplars: []Exemplar{ - {Labels: []LabelAdapter{{Name: "trace", Value: "1"}, {Name: "service", Value: "A"}}, Value: 1, TimestampMs: 2}, - {Labels: []LabelAdapter{{Name: "trace", Value: "2"}, {Name: "service", Value: "B"}}, Value: 2, TimestampMs: 3}, + {Labels: []mimirpb_custom.LabelAdapter{{Name: "trace", Value: "1"}, {Name: "service", Value: "A"}}, Value: 1, TimestampMs: 2}, + {Labels: []mimirpb_custom.LabelAdapter{{Name: "trace", Value: "2"}, {Name: "service", Value: "B"}}, Value: 2, TimestampMs: 3}, }} ClearExemplars(ts) @@ -597,7 +599,7 @@ func TestClearExemplars(t *testing.T) { t.Run("should reset TimeSeries.Exemplars releasing the slices if there are > 10 entries", func(t *testing.T) { ts := &TimeSeries{Exemplars: make([]Exemplar, 11)} for i := range ts.Exemplars { - ts.Exemplars[i] = Exemplar{Labels: []LabelAdapter{{Name: "trace", Value: "1"}, {Name: "service", Value: "A"}}, Value: 1, TimestampMs: 2} + ts.Exemplars[i] = Exemplar{Labels: []mimirpb_custom.LabelAdapter{{Name: "trace", Value: "1"}, {Name: "service", Value: "A"}}, Value: 1, TimestampMs: 2} } ClearExemplars(ts) @@ -612,8 +614,8 @@ func TestSortExemplars(t *testing.T) { p := PreallocTimeseries{ TimeSeries: &TimeSeries{ Exemplars: []Exemplar{ - {Labels: []LabelAdapter{{Name: "trace", Value: "1"}, {Name: "service", Value: "A"}}, Value: 1, TimestampMs: 3}, - {Labels: []LabelAdapter{{Name: "trace", Value: "2"}, {Name: "service", Value: "B"}}, Value: 2, TimestampMs: 2}, + {Labels: []mimirpb_custom.LabelAdapter{{Name: "trace", Value: "1"}, {Name: "service", Value: "A"}}, Value: 1, TimestampMs: 3}, + {Labels: []mimirpb_custom.LabelAdapter{{Name: "trace", Value: "2"}, {Name: "service", Value: "B"}}, Value: 2, TimestampMs: 2}, }, }, marshalledData: []byte{1, 2, 3}, diff --git a/pkg/mimirpb_custom/mimir_custom_types.go b/pkg/mimirpb_custom/mimir_custom_types.go new file mode 100644 index 0000000000..2fd203dfd6 --- /dev/null +++ b/pkg/mimirpb_custom/mimir_custom_types.go @@ -0,0 +1,464 @@ +package mimirpb_custom + +import ( + fmt "fmt" + + proto "github.com/gogo/protobuf/proto" + labels "github.com/prometheus/prometheus/model/labels" + + io "io" + math "math" + math_bits "math/bits" + reflect "reflect" + strings "strings" + "unsafe" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// LabelAdapter is a labels.Label that can be marshalled to/from protos. +type LabelAdapter labels.Label + +func (m *LabelAdapter) Reset() { *m = LabelAdapter{} } +func (*LabelAdapter) ProtoMessage() {} +func (*LabelAdapter) Descriptor() ([]byte, []int) { + return fileDescriptor_c4ae32fdfdd30bf8, []int{0} +} +func (m *LabelAdapter) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LabelAdapter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_LabelAdapter.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *LabelAdapter) XXX_Merge(src proto.Message) { + xxx_messageInfo_LabelAdapter.Merge(m, src) +} +func (m *LabelAdapter) XXX_Size() int { + return m.Size() +} +func (m *LabelAdapter) XXX_DiscardUnknown() { + xxx_messageInfo_LabelAdapter.DiscardUnknown(m) +} + +var xxx_messageInfo_LabelAdapter proto.InternalMessageInfo + +func (m *LabelAdapter) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *LabelAdapter) GetValue() string { + if m != nil { + return m.Value + } + return "" +} + +func init() { + proto.RegisterType((*LabelAdapter)(nil), "cortexpb_custom.LabelAdapter") +} + +func init() { proto.RegisterFile("mimir_custom_types.proto", fileDescriptor_c4ae32fdfdd30bf8) } + +var fileDescriptor_c4ae32fdfdd30bf8 = []byte{ + // 178 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xc8, 0xcd, 0xcc, 0xcd, + 0x2c, 0x8a, 0x4f, 0x2e, 0x2d, 0x2e, 0xc9, 0xcf, 0x8d, 0x2f, 0xa9, 0x2c, 0x48, 0x2d, 0xd6, 0x2b, + 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x4f, 0xce, 0x2f, 0x2a, 0x49, 0xad, 0x28, 0x48, 0x82, 0x4a, + 0x2a, 0x59, 0x70, 0xf1, 0xf8, 0x24, 0x26, 0xa5, 0xe6, 0x38, 0xa6, 0x24, 0x16, 0x94, 0xa4, 0x16, + 0x09, 0x09, 0x71, 0xb1, 0xe4, 0x25, 0xe6, 0xa6, 0x4a, 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x06, 0x81, + 0xd9, 0x42, 0x22, 0x5c, 0xac, 0x65, 0x89, 0x39, 0xa5, 0xa9, 0x12, 0x4c, 0x60, 0x41, 0x08, 0xc7, + 0xc9, 0xe5, 0xc2, 0x43, 0x39, 0x86, 0x1b, 0x0f, 0xe5, 0x18, 0x3e, 0x3c, 0x94, 0x63, 0x6c, 0x78, + 0x24, 0xc7, 0xb8, 0xe2, 0x91, 0x1c, 0xe3, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, + 0x78, 0x24, 0xc7, 0xf8, 0xe2, 0x91, 0x1c, 0xc3, 0x87, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, + 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x14, 0x1f, 0xd8, 0x69, 0x70, 0xfb, 0x93, + 0xd8, 0xc0, 0xee, 0x32, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xb8, 0x5c, 0x1d, 0x91, 0xb3, 0x00, + 0x00, 0x00, +} + +func (this *LabelAdapter) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*LabelAdapter) + if !ok { + that2, ok := that.(LabelAdapter) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Name != that1.Name { + return false + } + if this.Value != that1.Value { + return false + } + return true +} +func (this *LabelAdapter) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 6) + s = append(s, "&mimirpb_custom.LabelAdapter{") + s = append(s, "Name: "+fmt.Sprintf("%#v", this.Name)+",\n") + s = append(s, "Value: "+fmt.Sprintf("%#v", this.Value)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func valueToGoStringMimirCustomTypes(v interface{}, typ string) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) +} +func (m *LabelAdapter) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LabelAdapter) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LabelAdapter) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Value) > 0 { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = encodeVarintMimirCustomTypes(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0x12 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintMimirCustomTypes(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintMimirCustomTypes(dAtA []byte, offset int, v uint64) int { + offset -= sovMimirCustomTypes(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *LabelAdapter) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovMimirCustomTypes(uint64(l)) + } + l = len(m.Value) + if l > 0 { + n += 1 + l + sovMimirCustomTypes(uint64(l)) + } + return n +} + +func sovMimirCustomTypes(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozMimirCustomTypes(x uint64) (n int) { + return sovMimirCustomTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (this *LabelAdapter) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&LabelAdapter{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `Value:` + fmt.Sprintf("%v", this.Value) + `,`, + `}`, + }, "") + return s +} +func valueToStringMimirCustomTypes(v interface{}) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("*%v", pv) +} +func (m *LabelAdapter) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMimirCustomTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LabelAdapter: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LabelAdapter: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMimirCustomTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMimirCustomTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMimirCustomTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = yoloString(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMimirCustomTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMimirCustomTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMimirCustomTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = yoloString(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMimirCustomTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMimirCustomTypes + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthMimirCustomTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipMimirCustomTypes(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowMimirCustomTypes + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowMimirCustomTypes + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + return iNdEx, nil + case 1: + iNdEx += 8 + return iNdEx, nil + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowMimirCustomTypes + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthMimirCustomTypes + } + iNdEx += length + if iNdEx < 0 { + return 0, ErrInvalidLengthMimirCustomTypes + } + return iNdEx, nil + case 3: + for { + var innerWire uint64 + var start int = iNdEx + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowMimirCustomTypes + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + innerWire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + innerWireType := int(innerWire & 0x7) + if innerWireType == 4 { + break + } + next, err := skipMimirCustomTypes(dAtA[start:]) + if err != nil { + return 0, err + } + iNdEx = start + next + if iNdEx < 0 { + return 0, ErrInvalidLengthMimirCustomTypes + } + } + return iNdEx, nil + case 4: + return iNdEx, nil + case 5: + iNdEx += 4 + return iNdEx, nil + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + } + panic("unreachable") +} + +var ( + ErrInvalidLengthMimirCustomTypes = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowMimirCustomTypes = fmt.Errorf("proto: integer overflow") +) + +func yoloString(buf []byte) string { + return *((*string)(unsafe.Pointer(&buf))) +} + +var ( + ErrInvalidLengthMimir = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowMimir = fmt.Errorf("proto: integer overflow") +) diff --git a/pkg/mimirpb_custom/mimir_custom_types.proto b/pkg/mimirpb_custom/mimir_custom_types.proto new file mode 100644 index 0000000000..8f51934643 --- /dev/null +++ b/pkg/mimirpb_custom/mimir_custom_types.proto @@ -0,0 +1,10 @@ +syntax = "proto3"; + +package cortexpb_custom; + +option go_package = "mimirpb_custom"; + +message LabelAdapter { + string name = 1; + string value = 2; +} \ No newline at end of file diff --git a/pkg/querier/block_test.go b/pkg/querier/block_test.go index 55ac10b5cd..fdedf51ba5 100644 --- a/pkg/querier/block_test.go +++ b/pkg/querier/block_test.go @@ -22,6 +22,7 @@ import ( "github.com/stretchr/testify/require" "github.com/grafana/mimir/pkg/mimirpb" + "github.com/grafana/mimir/pkg/mimirpb_custom" "github.com/grafana/mimir/pkg/storegateway/storepb" "github.com/grafana/mimir/pkg/util" "github.com/grafana/mimir/pkg/util/test" @@ -48,7 +49,7 @@ func TestBlockQuerierSeries(t *testing.T) { }, "should return float series on success": { series: &storepb.Series{ - Labels: []mimirpb.LabelAdapter{ + Labels: []mimirpb_custom.LabelAdapter{ {Name: "foo", Value: "bar"}, }, Chunks: []storepb.AggrChunk{ @@ -67,7 +68,7 @@ func TestBlockQuerierSeries(t *testing.T) { }, "should return histogram series on success": { series: &storepb.Series{ - Labels: []mimirpb.LabelAdapter{ + Labels: []mimirpb_custom.LabelAdapter{ {Name: "foo", Value: "bar"}, }, Chunks: []storepb.AggrChunk{ @@ -90,7 +91,7 @@ func TestBlockQuerierSeries(t *testing.T) { }, "should return float histogram series on success": { series: &storepb.Series{ - Labels: []mimirpb.LabelAdapter{ + Labels: []mimirpb_custom.LabelAdapter{ {Name: "foo", Value: "bar"}, }, Chunks: []storepb.AggrChunk{ @@ -113,7 +114,7 @@ func TestBlockQuerierSeries(t *testing.T) { }, "should return error on failure while reading encoded chunk data": { series: &storepb.Series{ - Labels: []mimirpb.LabelAdapter{{Name: "foo", Value: "bar"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "foo", Value: "bar"}}, Chunks: []storepb.AggrChunk{ {MinTime: minTimestamp.Unix() * 1000, MaxTime: maxTimestamp.Unix() * 1000, Raw: storepb.Chunk{Type: storepb.Chunk_XOR, Data: []byte{0, 1}}}, }, @@ -514,11 +515,11 @@ func createAggrFloatHistogramChunk(minTime, maxTime int64, samples ...promql.HPo } } -func mkZLabels(s ...string) []mimirpb.LabelAdapter { - var result []mimirpb.LabelAdapter +func mkZLabels(s ...string) []mimirpb_custom.LabelAdapter { + var result []mimirpb_custom.LabelAdapter for i := 0; i+1 < len(s); i = i + 2 { - result = append(result, mimirpb.LabelAdapter{ + result = append(result, mimirpb_custom.LabelAdapter{ Name: s[i], Value: s[i+1], }) diff --git a/pkg/querier/blocks_store_queryable_test.go b/pkg/querier/blocks_store_queryable_test.go index 1d1710cea5..b126b5ab0d 100644 --- a/pkg/querier/blocks_store_queryable_test.go +++ b/pkg/querier/blocks_store_queryable_test.go @@ -51,6 +51,7 @@ import ( "google.golang.org/grpc/status" "github.com/grafana/mimir/pkg/mimirpb" + "github.com/grafana/mimir/pkg/mimirpb_custom" "github.com/grafana/mimir/pkg/querier/stats" "github.com/grafana/mimir/pkg/storage/sharding" "github.com/grafana/mimir/pkg/storage/tsdb/bucketindex" @@ -3243,7 +3244,7 @@ func mockSeriesResponseWithChunks(lbls labels.Labels, chunks ...storepb.AggrChun } } -func mockStreamingSeriesBatchResponse(endOfStream bool, lbls ...[]mimirpb.LabelAdapter) *storepb.SeriesResponse { +func mockStreamingSeriesBatchResponse(endOfStream bool, lbls ...[]mimirpb_custom.LabelAdapter) *storepb.SeriesResponse { res := &storepb.StreamingSeriesBatch{} for _, l := range lbls { res.Series = append(res.Series, &storepb.StreamingSeries{Labels: l}) diff --git a/pkg/querier/distributor_queryable_test.go b/pkg/querier/distributor_queryable_test.go index 28a7775190..54cc6cf88b 100644 --- a/pkg/querier/distributor_queryable_test.go +++ b/pkg/querier/distributor_queryable_test.go @@ -28,6 +28,7 @@ import ( "github.com/grafana/mimir/pkg/cardinality" "github.com/grafana/mimir/pkg/ingester/client" "github.com/grafana/mimir/pkg/mimirpb" + "github.com/grafana/mimir/pkg/mimirpb_custom" "github.com/grafana/mimir/pkg/querier/stats" "github.com/grafana/mimir/pkg/storage/chunk" "github.com/grafana/mimir/pkg/util" @@ -145,13 +146,13 @@ func TestDistributorQuerier_Select(t *testing.T) { response: client.CombinedQueryStreamResponse{ Chunkseries: []client.TimeSeriesChunk{ { - Labels: []mimirpb.LabelAdapter{ + Labels: []mimirpb_custom.LabelAdapter{ {Name: "bar", Value: "baz"}, }, Chunks: clientChunks, }, { - Labels: []mimirpb.LabelAdapter{ + Labels: []mimirpb_custom.LabelAdapter{ {Name: "foo", Value: "bar"}, }, Chunks: clientChunks, @@ -250,22 +251,22 @@ func TestDistributorQuerier_Select_MixedChunkseriesTimeseriesAndStreamingResults client.CombinedQueryStreamResponse{ Chunkseries: []client.TimeSeriesChunk{ { - Labels: []mimirpb.LabelAdapter{{Name: labels.MetricName, Value: "one"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: labels.MetricName, Value: "one"}}, Chunks: convertToChunks(t, samplesToInterface(s1), false), }, { - Labels: []mimirpb.LabelAdapter{{Name: labels.MetricName, Value: "two"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: labels.MetricName, Value: "two"}}, Chunks: convertToChunks(t, samplesToInterface(s1), false), }, }, Timeseries: []mimirpb.TimeSeries{ { - Labels: []mimirpb.LabelAdapter{{Name: labels.MetricName, Value: "two"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: labels.MetricName, Value: "two"}}, Samples: s2, }, { - Labels: []mimirpb.LabelAdapter{{Name: labels.MetricName, Value: "three"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: labels.MetricName, Value: "three"}}, Samples: s1, }, }, @@ -376,22 +377,22 @@ func TestDistributorQuerier_Select_MixedFloatAndIntegerHistograms(t *testing.T) client.CombinedQueryStreamResponse{ Chunkseries: []client.TimeSeriesChunk{ { - Labels: []mimirpb.LabelAdapter{{Name: labels.MetricName, Value: "one"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: labels.MetricName, Value: "one"}}, Chunks: convertToChunks(t, histogramsToInterface(s1), false), }, { - Labels: []mimirpb.LabelAdapter{{Name: labels.MetricName, Value: "two"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: labels.MetricName, Value: "two"}}, Chunks: convertToChunks(t, histogramsToInterface(s1), false), }, }, Timeseries: []mimirpb.TimeSeries{ { - Labels: []mimirpb.LabelAdapter{{Name: labels.MetricName, Value: "two"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: labels.MetricName, Value: "two"}}, Histograms: s2, }, { - Labels: []mimirpb.LabelAdapter{{Name: labels.MetricName, Value: "three"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: labels.MetricName, Value: "three"}}, Histograms: s1, }, }, @@ -475,23 +476,23 @@ func TestDistributorQuerier_Select_MixedHistogramsAndFloatSamples(t *testing.T) client.CombinedQueryStreamResponse{ Chunkseries: []client.TimeSeriesChunk{ { - Labels: []mimirpb.LabelAdapter{{Name: labels.MetricName, Value: "one"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: labels.MetricName, Value: "one"}}, Chunks: convertToChunks(t, append(samplesToInterface(s1), histogramsToInterface(h1)...), false), }, { - Labels: []mimirpb.LabelAdapter{{Name: labels.MetricName, Value: "two"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: labels.MetricName, Value: "two"}}, Chunks: convertToChunks(t, append(samplesToInterface(s1), histogramsToInterface(h1)...), false), }, }, Timeseries: []mimirpb.TimeSeries{ { - Labels: []mimirpb.LabelAdapter{{Name: labels.MetricName, Value: "two"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: labels.MetricName, Value: "two"}}, Samples: s2, Histograms: h2, }, { - Labels: []mimirpb.LabelAdapter{{Name: labels.MetricName, Value: "three"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: labels.MetricName, Value: "three"}}, Samples: s1, Histograms: h1, }, @@ -593,7 +594,7 @@ func TestDistributorQuerier_Select_CounterResets(t *testing.T) { combinedResponse: client.CombinedQueryStreamResponse{ Chunkseries: []client.TimeSeriesChunk{ { - Labels: []mimirpb.LabelAdapter{{Name: labels.MetricName, Value: "one"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: labels.MetricName, Value: "one"}}, Chunks: tc.chunks, }, }, diff --git a/pkg/querier/duplicates_test.go b/pkg/querier/duplicates_test.go index 1b3d29e21a..7703142203 100644 --- a/pkg/querier/duplicates_test.go +++ b/pkg/querier/duplicates_test.go @@ -20,11 +20,12 @@ import ( "github.com/stretchr/testify/require" "github.com/grafana/mimir/pkg/mimirpb" + "github.com/grafana/mimir/pkg/mimirpb_custom" ) func TestDuplicatesSamples(t *testing.T) { ts := mimirpb.TimeSeries{ - Labels: []mimirpb.LabelAdapter{ + Labels: []mimirpb_custom.LabelAdapter{ { Name: "lbl", Value: "val", @@ -61,7 +62,7 @@ func TestDuplicatesSamples(t *testing.T) { // run same query, but with deduplicated samples deduped := mimirpb.TimeSeries{ - Labels: []mimirpb.LabelAdapter{ + Labels: []mimirpb_custom.LabelAdapter{ { Name: "lbl", Value: "val", diff --git a/pkg/querier/querier_test.go b/pkg/querier/querier_test.go index 35ff3a9b08..385c6955e9 100644 --- a/pkg/querier/querier_test.go +++ b/pkg/querier/querier_test.go @@ -35,6 +35,7 @@ import ( "github.com/grafana/mimir/pkg/cardinality" "github.com/grafana/mimir/pkg/ingester/client" "github.com/grafana/mimir/pkg/mimirpb" + "github.com/grafana/mimir/pkg/mimirpb_custom" "github.com/grafana/mimir/pkg/querier/stats" "github.com/grafana/mimir/pkg/storage/chunk" "github.com/grafana/mimir/pkg/util" @@ -272,7 +273,7 @@ func TestQuerier_QueryableReturnsChunksOutsideQueriedRange(t *testing.T) { Chunkseries: []client.TimeSeriesChunk{ // Series with data points only before queryStart. { - Labels: []mimirpb.LabelAdapter{{Name: labels.MetricName, Value: "one"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: labels.MetricName, Value: "one"}}, Chunks: convertToChunks(t, []interface{}{ mimirpb.Sample{TimestampMs: queryStart.Add(-9*time.Minute).Unix() * 1000, Value: 1}, mimirpb.Sample{TimestampMs: queryStart.Add(-8*time.Minute).Unix() * 1000, Value: 1}, @@ -281,7 +282,7 @@ func TestQuerier_QueryableReturnsChunksOutsideQueriedRange(t *testing.T) { }, // Series with data points before and after queryStart, but before queryEnd. { - Labels: []mimirpb.LabelAdapter{{Name: labels.MetricName, Value: "one"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: labels.MetricName, Value: "one"}}, Chunks: convertToChunks(t, []interface{}{ mimirpb.Sample{TimestampMs: queryStart.Add(-9*time.Minute).Unix() * 1000, Value: 1}, mimirpb.Sample{TimestampMs: queryStart.Add(-8*time.Minute).Unix() * 1000, Value: 3}, @@ -299,7 +300,7 @@ func TestQuerier_QueryableReturnsChunksOutsideQueriedRange(t *testing.T) { }, // Series with data points after queryEnd. { - Labels: []mimirpb.LabelAdapter{{Name: labels.MetricName, Value: "one"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: labels.MetricName, Value: "one"}}, Chunks: convertToChunks(t, []interface{}{ mimirpb.Sample{TimestampMs: queryStart.Add(+4*time.Minute).Unix() * 1000, Value: 41}, mimirpb.Sample{TimestampMs: queryStart.Add(+5*time.Minute).Unix() * 1000, Value: 43}, @@ -391,12 +392,12 @@ func TestBatchMergeChunks(t *testing.T) { Chunkseries: []client.TimeSeriesChunk{ // Series with chunks in the 1,2 order, that need merge { - Labels: []mimirpb.LabelAdapter{{Name: labels.MetricName, Value: "one"}, {Name: labels.InstanceName, Value: "foo"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: labels.MetricName, Value: "one"}, {Name: labels.InstanceName, Value: "foo"}}, Chunks: chunks12, }, // Series with chunks in the 2,1 order, that need merge { - Labels: []mimirpb.LabelAdapter{{Name: labels.MetricName, Value: "one"}, {Name: labels.InstanceName, Value: "bar"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: labels.MetricName, Value: "one"}, {Name: labels.InstanceName, Value: "bar"}}, Chunks: chunks21, }, }, @@ -468,7 +469,7 @@ func BenchmarkQueryExecute(b *testing.B) { client.CombinedQueryStreamResponse{ Chunkseries: []client.TimeSeriesChunk{ { - Labels: []mimirpb.LabelAdapter{{Name: labels.MetricName, Value: "one"}, {Name: labels.InstanceName, Value: "foo"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: labels.MetricName, Value: "one"}, {Name: labels.InstanceName, Value: "foo"}}, Chunks: chunks, }, }, diff --git a/pkg/querier/timeseries_series_set_test.go b/pkg/querier/timeseries_series_set_test.go index 931dccb791..2b487e8d06 100644 --- a/pkg/querier/timeseries_series_set_test.go +++ b/pkg/querier/timeseries_series_set_test.go @@ -15,6 +15,7 @@ import ( "github.com/stretchr/testify/require" "github.com/grafana/mimir/pkg/mimirpb" + "github.com/grafana/mimir/pkg/mimirpb_custom" "github.com/grafana/mimir/pkg/util/test" ) @@ -27,18 +28,18 @@ func TestTimeSeriesSeriesSet(t *testing.T) { timeseries := []mimirpb.TimeSeries{ { - Labels: []mimirpb.LabelAdapter{{Name: "label1", Value: "value3"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "label1", Value: "value3"}}, Samples: []mimirpb.Sample{{Value: 3.14, TimestampMs: 1234}}, }, { - Labels: []mimirpb.LabelAdapter{{Name: "label1", Value: "value2"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "label1", Value: "value2"}}, Samples: []mimirpb.Sample{ {Value: 3.14, TimestampMs: 1234}, {Value: 1.618, TimestampMs: 2345}, }, }, { - Labels: []mimirpb.LabelAdapter{{Name: "label1", Value: "value1"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "label1", Value: "value1"}}, Samples: []mimirpb.Sample{{Value: 3.14, TimestampMs: 1234}}, }, } @@ -100,7 +101,7 @@ func BenchmarkTimeSeriesSeriesSet(b *testing.B) { func TestTimeSeriesIterator(t *testing.T) { ts := timeseries{ series: mimirpb.TimeSeries{ - Labels: []mimirpb.LabelAdapter{ + Labels: []mimirpb_custom.LabelAdapter{ { Name: "label1", Value: "value1", diff --git a/pkg/ruler/compat.go b/pkg/ruler/compat.go index b27e60d47c..1e589d8e11 100644 --- a/pkg/ruler/compat.go +++ b/pkg/ruler/compat.go @@ -27,6 +27,7 @@ import ( "github.com/prometheus/prometheus/storage" "github.com/grafana/mimir/pkg/mimirpb" + "github.com/grafana/mimir/pkg/mimirpb_custom" "github.com/grafana/mimir/pkg/querier" querier_stats "github.com/grafana/mimir/pkg/querier/stats" util_log "github.com/grafana/mimir/pkg/util/log" @@ -43,9 +44,9 @@ type PusherAppender struct { ctx context.Context pusher Pusher - labels [][]mimirpb.LabelAdapter + labels [][]mimirpb_custom.LabelAdapter samples []mimirpb.Sample - histogramLabels [][]mimirpb.LabelAdapter + histogramLabels [][]mimirpb_custom.LabelAdapter histograms []mimirpb.Histogram userID string } diff --git a/pkg/ruler/ruler.pb.go b/pkg/ruler/ruler.pb.go index 73d87f439e..33066f66cb 100644 --- a/pkg/ruler/ruler.pb.go +++ b/pkg/ruler/ruler.pb.go @@ -11,7 +11,8 @@ import ( proto "github.com/gogo/protobuf/proto" github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" _ "github.com/grafana/mimir/pkg/mimirpb" - github_com_grafana_mimir_pkg_mimirpb "github.com/grafana/mimir/pkg/mimirpb" + _ "github.com/grafana/mimir/pkg/mimirpb_custom" + github_com_grafana_mimir_pkg_mimirpb_custom "github.com/grafana/mimir/pkg/mimirpb_custom" rulespb "github.com/grafana/mimir/pkg/ruler/rulespb" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" @@ -439,16 +440,16 @@ func (m *RuleStateDesc) GetEvaluationDuration() time.Duration { } type AlertStateDesc struct { - State string `protobuf:"bytes,1,opt,name=state,proto3" json:"state,omitempty"` - Labels []github_com_grafana_mimir_pkg_mimirpb.LabelAdapter `protobuf:"bytes,2,rep,name=labels,proto3,customtype=github.com/grafana/mimir/pkg/mimirpb.LabelAdapter" json:"labels"` - Annotations []github_com_grafana_mimir_pkg_mimirpb.LabelAdapter `protobuf:"bytes,3,rep,name=annotations,proto3,customtype=github.com/grafana/mimir/pkg/mimirpb.LabelAdapter" json:"annotations"` - Value float64 `protobuf:"fixed64,4,opt,name=value,proto3" json:"value,omitempty"` - ActiveAt time.Time `protobuf:"bytes,5,opt,name=active_at,json=activeAt,proto3,stdtime" json:"active_at"` - FiredAt time.Time `protobuf:"bytes,6,opt,name=fired_at,json=firedAt,proto3,stdtime" json:"fired_at"` - ResolvedAt time.Time `protobuf:"bytes,7,opt,name=resolved_at,json=resolvedAt,proto3,stdtime" json:"resolved_at"` - LastSentAt time.Time `protobuf:"bytes,8,opt,name=last_sent_at,json=lastSentAt,proto3,stdtime" json:"last_sent_at"` - ValidUntil time.Time `protobuf:"bytes,9,opt,name=valid_until,json=validUntil,proto3,stdtime" json:"valid_until"` - KeepFiringSince time.Time `protobuf:"bytes,10,opt,name=keep_firing_since,json=keepFiringSince,proto3,stdtime" json:"keep_firing_since"` + State string `protobuf:"bytes,1,opt,name=state,proto3" json:"state,omitempty"` + Labels []github_com_grafana_mimir_pkg_mimirpb_custom.LabelAdapter `protobuf:"bytes,2,rep,name=labels,proto3,customtype=github.com/grafana/mimir/pkg/mimirpb_custom.LabelAdapter" json:"labels"` + Annotations []github_com_grafana_mimir_pkg_mimirpb_custom.LabelAdapter `protobuf:"bytes,3,rep,name=annotations,proto3,customtype=github.com/grafana/mimir/pkg/mimirpb_custom.LabelAdapter" json:"annotations"` + Value float64 `protobuf:"fixed64,4,opt,name=value,proto3" json:"value,omitempty"` + ActiveAt time.Time `protobuf:"bytes,5,opt,name=active_at,json=activeAt,proto3,stdtime" json:"active_at"` + FiredAt time.Time `protobuf:"bytes,6,opt,name=fired_at,json=firedAt,proto3,stdtime" json:"fired_at"` + ResolvedAt time.Time `protobuf:"bytes,7,opt,name=resolved_at,json=resolvedAt,proto3,stdtime" json:"resolved_at"` + LastSentAt time.Time `protobuf:"bytes,8,opt,name=last_sent_at,json=lastSentAt,proto3,stdtime" json:"last_sent_at"` + ValidUntil time.Time `protobuf:"bytes,9,opt,name=valid_until,json=validUntil,proto3,stdtime" json:"valid_until"` + KeepFiringSince time.Time `protobuf:"bytes,10,opt,name=keep_firing_since,json=keepFiringSince,proto3,stdtime" json:"keep_firing_since"` } func (m *AlertStateDesc) Reset() { *m = AlertStateDesc{} } @@ -553,65 +554,66 @@ func init() { func init() { proto.RegisterFile("ruler.proto", fileDescriptor_9ecbec0a4cfddea6) } var fileDescriptor_9ecbec0a4cfddea6 = []byte{ - // 924 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0xcd, 0x6e, 0x23, 0x45, - 0x10, 0x9e, 0x71, 0xe2, 0x9f, 0x29, 0x27,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0x81, - 0x3d, 0x49, 0x1e, 0xc2, 0x9a, 0x5a, 0x66, 0x5f, 0xb0, 0x44, 0x2a, 0x9e, 0xc6, 0x32, 0x3c, 0x0a, - 0xd9, 0x67, 0x89, 0xd4, 0xd7, 0x39, 0xa3, 0x51, 0x38, 0xf2, 0xf3, 0x44, 0x86, 0x91, 0x6d, 0x2d, - 0x43, 0x83, 0xc0, 0x6f, 0x14, 0x8e, 0x3c, 0x82, 0xad, 0x53, 0xc6, 0x32, 0x7f, 0x1c, 0xf2, 0x30, - 0x09, 0x7c, 0x11, 0x26, 0x43, 0x66, 0xc3, 0x12, 0x64, 0x77, 0x14, 0xfc, 0x21, 0xa2, 0xfb, 0x0a, - 0x7c, 0xf0, 0x3d, 0x54, 0xd5, 0xe7, 0xcf, 0xc9, 0xa1, 0x3e, 0x08, 0xb2, 0x7d, 0xc3, 0xff, 0xbd, - 0xd6, 0xce, 0xa2, 0xb3, 0x78, 0x85, 0x0d, 0xf2, 0x39, 0x58, 0xd7, 0x8f, 0x33, 0x79, 0xa3, 0x48, - 0x7a, 0xf1, 0x75, 0x6f, 0xd9, 0x2f, 0x07, 0x4a, 0x86, 0xa3, 0xc3, 0x8b, 0x4b, 0xc7, 0x78, 0x7a, - 0xe9, 0x18, 0xcf, 0x2f, 0x1d, 0xf3, 0x87, 0xa9, 0x63, 0xfe, 0x3c, 0x75, 0xcc, 0x27, 0x53, 0xc7, - 0xbc, 0x98, 0x3a, 0xe6, 0x9f, 0x53, 0xc7, 0xfc, 0x6b, 0xea, 0x18, 0xcf, 0xa7, 0x8e, 0xf9, 0xf8, - 0xca, 0x31, 0x2e, 0xae, 0x1c, 0xe3, 0xe9, 0x95, 0x63, 0x0c, 0x6a, 0xd8, 0xe5, 0x07, 0x7f, 0x07, - 0x00, 0x00, 0xff, 0xff, 0x98, 0xb6, 0x46, 0xf9, 0xb4, 0x08, 0x00, 0x00, + // 944 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0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 0x05, 0xe1, 0x0f, 0x73, + 0x21, 0xd3, 0x58, 0x9b, 0xc6, 0xf0, 0xe5, 0x45, 0xc6, 0x84, 0x61, 0x79, 0xf7, 0x6f, 0x59, 0x50, + 0x0b, 0xfc, 0x15, 0xd9, 0x40, 0xff, 0x6b, 0x5c, 0xfb, 0xa7, 0x32, 0xac, 0x79, 0xca, 0xf6, 0xd8, + 0x57, 0x39, 0x13, 0x92, 0x1c, 0x42, 0x75, 0x1c, 0x46, 0x92, 0x71, 0xc7, 0x6a, 0x59, 0x9d, 0x8d, + 0x83, 0x7b, 0x5d, 0xad, 0xea, 0x7c, 0x12, 0x1a, 0x27, 0x17, 0x19, 0xf3, 0x4c, 0x2e, 0x79, 0x1d, + 0x6c, 0x95, 0xe6, 0x27, 0x34, 0x66, 0x4e, 0xb9, 0xb5, 0xd2, 0xb1, 0xbd, 0xba, 0x72, 0x7c, 0x46, + 0x63, 0x46, 0xee, 0x03, 0x60, 0x30, 0xe0, 0x69, 0x9e, 0x39, 0x2b, 0x18, 0xc5, 0xf4, 0x8f, 0x95, + 0x83, 0x10, 0x58, 0x1d, 0x87, 0x11, 0x73, 0x56, 0x31, 0x80, 0x6b, 0xf2, 0x26, 0x6c, 0xb0, 0xc9, + 0x30, 0xca, 0x47, 0xcc, 0xa7, 0x11, 0xe3, 0x52, 0x38, 0x95, 0x96, 0xd5, 0xa9, 0x7b, 0xeb, 0xc6, + 0xdb, 0x43, 0xa7, 0x62, 0x8e, 0xe9, 0x44, 0x13, 0x0b, 0xa7, 0xda, 0xb2, 0x3a, 0x15, 0xcf, 0x8e, + 0xe9, 0x04, 0x89, 0x31, 0x9c, 0xb0, 0x89, 0xf4, 0x65, 0x7a, 0xc6, 0x12, 0xa7, 0xd6, 0xb2, 0x54, + 0x61, 0xe5, 0x39, 0x51, 0x8e, 0xf6, 0x07, 0x50, 0x2f, 0x0e, 0x42, 0x1a, 0x50, 0xeb, 0x25, 0x17, + 0xca, 0xdc, 0x2c, 0x91, 0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xaf, 0xdd, 0xd2, 0xd3, 0x6b, 0xb7, 0x34, 0xa8, 0xe2, + 0x29, 0xdf, 0xf9, 0x33, 0x00, 0x00, 0xff, 0xff, 0xd1, 0x06, 0xe6, 0xa2, 0x1d, 0x09, 0x00, 0x00, } func (x RulesRequest_RuleType) String() string { @@ -2905,7 +2907,7 @@ func (m *AlertStateDesc) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Labels = append(m.Labels, github_com_grafana_mimir_pkg_mimirpb.LabelAdapter{}) + m.Labels = append(m.Labels, github_com_grafana_mimir_pkg_mimirpb_custom.LabelAdapter{}) if err := m.Labels[len(m.Labels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -2939,7 +2941,7 @@ func (m *AlertStateDesc) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Annotations = append(m.Annotations, github_com_grafana_mimir_pkg_mimirpb.LabelAdapter{}) + m.Annotations = append(m.Annotations, github_com_grafana_mimir_pkg_mimirpb_custom.LabelAdapter{}) if err := m.Annotations[len(m.Annotations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/pkg/ruler/ruler.proto b/pkg/ruler/ruler.proto index 0777b1f725..1e3eb24728 100644 --- a/pkg/ruler/ruler.proto +++ b/pkg/ruler/ruler.proto @@ -13,6 +13,7 @@ import "github.com/gogo/protobuf/gogoproto/gogo.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/timestamp.proto"; import "github.com/grafana/mimir/pkg/mimirpb/mimir.proto"; +import "github.com/grafana/mimir/pkg/mimirpb_custom/mimir_custom_types.proto"; import "github.com/grafana/mimir/pkg/ruler/rulespb/rules.proto"; @@ -76,13 +77,13 @@ message RuleStateDesc { message AlertStateDesc { string state = 1; - repeated cortexpb.LabelPair labels = 2 [ + repeated cortexpb_custom.LabelAdapter labels = 2 [ (gogoproto.nullable) = false, - (gogoproto.customtype) = "github.com/grafana/mimir/pkg/mimirpb.LabelAdapter" + (gogoproto.customtype) = "github.com/grafana/mimir/pkg/mimirpb_custom.LabelAdapter" ]; - repeated cortexpb.LabelPair annotations = 3 [ + repeated cortexpb_custom.LabelAdapter annotations = 3 [ (gogoproto.nullable) = false, - (gogoproto.customtype) = "github.com/grafana/mimir/pkg/mimirpb.LabelAdapter" + (gogoproto.customtype) = "github.com/grafana/mimir/pkg/mimirpb_custom.LabelAdapter" ]; double value = 4; google.protobuf.Timestamp active_at = 5 diff --git a/pkg/ruler/rulespb/rules.pb.go b/pkg/ruler/rulespb/rules.pb.go index f5f5a11dbf..75200c7dd1 100644 --- a/pkg/ruler/rulespb/rules.pb.go +++ b/pkg/ruler/rulespb/rules.pb.go @@ -10,7 +10,8 @@ import ( github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" types "github.com/gogo/protobuf/types" _ "github.com/grafana/mimir/pkg/mimirpb" - github_com_grafana_mimir_pkg_mimirpb "github.com/grafana/mimir/pkg/mimirpb" + _ "github.com/grafana/mimir/pkg/mimirpb_custom" + github_com_grafana_mimir_pkg_mimirpb_custom "github.com/grafana/mimir/pkg/mimirpb_custom" _ "google.golang.org/protobuf/types/known/durationpb" io "io" math "math" @@ -155,13 +156,13 @@ func (m *RuleGroupDesc) GetAlignEvaluationTimeOnInterval() bool { // RuleDesc is a proto representation of a Prometheus Rule type RuleDesc struct { - Expr string `protobuf:"bytes,1,opt,name=expr,proto3" json:"expr,omitempty"` - Record string `protobuf:"bytes,2,opt,name=record,proto3" json:"record,omitempty"` - Alert string `protobuf:"bytes,3,opt,name=alert,proto3" json:"alert,omitempty"` - For time.Duration `protobuf:"bytes,4,opt,name=for,proto3,stdduration" json:"for"` - KeepFiringFor time.Duration `protobuf:"bytes,13,opt,name=keep_firing_for,json=keepFiringFor,proto3,stdduration" json:"keep_firing_for"` - Labels []github_com_grafana_mimir_pkg_mimirpb.LabelAdapter `protobuf:"bytes,5,rep,name=labels,proto3,customtype=github.com/grafana/mimir/pkg/mimirpb.LabelAdapter" json:"labels"` - Annotations []github_com_grafana_mimir_pkg_mimirpb.LabelAdapter `protobuf:"bytes,6,rep,name=annotations,proto3,customtype=github.com/grafana/mimir/pkg/mimirpb.LabelAdapter" json:"annotations"` + Expr string `protobuf:"bytes,1,opt,name=expr,proto3" json:"expr,omitempty"` + Record string `protobuf:"bytes,2,opt,name=record,proto3" json:"record,omitempty"` + Alert string `protobuf:"bytes,3,opt,name=alert,proto3" json:"alert,omitempty"` + For time.Duration `protobuf:"bytes,4,opt,name=for,proto3,stdduration" json:"for"` + KeepFiringFor time.Duration `protobuf:"bytes,13,opt,name=keep_firing_for,json=keepFiringFor,proto3,stdduration" json:"keep_firing_for"` + Labels []github_com_grafana_mimir_pkg_mimirpb_custom.LabelAdapter `protobuf:"bytes,5,rep,name=labels,proto3,customtype=github.com/grafana/mimir/pkg/mimirpb_custom.LabelAdapter" json:"labels"` + Annotations []github_com_grafana_mimir_pkg_mimirpb_custom.LabelAdapter `protobuf:"bytes,6,rep,name=annotations,proto3,customtype=github.com/grafana/mimir/pkg/mimirpb_custom.LabelAdapter" json:"annotations"` } func (m *RuleDesc) Reset() { *m = RuleDesc{} } @@ -239,45 +240,47 @@ func init() { func init() { proto.RegisterFile("rules.proto", fileDescriptor_8e722d3e922f0937) } var fileDescriptor_8e722d3e922f0937 = []byte{ - // 608 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x53, 0x31, 0x6f, 0xd3, 0x40, - 0x14, 0xb6, 0x89, 0x93, 0x3a, 0x17, 0xa2, 0x56, 0x47, 0x85, 0xdc, 0x0a, 0xae, 0xa1, 0x02, 0x29, - 0x0b, 0x0e, 0x14, 0x31, 0x30, 0x20, 0xd4, 0xaa, 0x2d, 0x50, 0x40, 0x45, 0x56, 0x27, 0x96, 0xe8, - 0x9c, 0x3e, 0x1b, 0xab, 0xce, 0xdd, 0x71, 0xb6, 0xab, 0x66, 0x63, 0x61, 0x67, 0xe4, 0x27, 0x30, - 0xf2, 0x33, 0x3a, 0x76, 0xac, 0x18, 0x0a, 0x75, 0x17, 0xc6, 0xfe, 0x04, 0x74, 0x77, 0x4e, 0x1b, - 0xca, 0x12, 0x06, 0xa6, 0x7b, 0xef, 0xde, 0xfb, 0xde, 0xfb, 0xee, 0x7b, 0xef, 0x50, 0x4b, 0x16, - 0x29, 0x64, 0xbe, 0x90, 0x3c, 0xe7, 0xb8, 0xae, 0x9d, 0xc5, 0xfb, 0x71, 0x92, 0xbf, 0x2f, 0x42, - 0x7f, 0xc0, 0x87, 0xbd, 0x98, 0xc7, 0xbc, 0xa7, 0xa3, 0x61, 0x11, 0x69, 0x4f, 0x3b, 0xda, 0x32, - 0xa8, 0x45, 0x12, 0x73, 0x1e, 0xa7, 0x70, 0x99, 0xb5, 0x5b, 0x48, 0x9a, 0x27, 0x9c, 0x55, 0xf1, - 0x85, 0xab, 0x71, 0xca, 0x46, 0x55, 0xe8, 0xc1, 0x64, 0x27, 0x49, 0x23, 0xca, 0x68, 0x6f, 0x98, - 0x0c, 0x13, 0xd9, 0x13, 0x7b, 0xb1, 0xb1, 0x44, 0x68, 0x4e, 0x83, 0x58, 0xfe, 0xe4, 0xa0, 0x76, - 0x50, 0xa4, 0xf0, 0x5c, 0xf2, 0x42, 0xac, 0x43, 0x36, 0xc0, 0x18, 0x39, 0x8c, 0x0e, 0xc1, 0xb3, - 0x3b, 0x76, 0xb7, 0x19, 0x68, 0x1b, 0xdf, 0x42, 0x4d, 0x75, 0x66, 0x82, 0x0e, 0xc0, 0xbb, 0xa6, - 0x03, 0x97, 0x17, 0xf8, 0x19, 0x72, 0x13, 0x96, 0x83, 0xdc, 0xa7, 0xa9, 0x57, 0xeb, 0xd8, 0xdd, - 0xd6, 0xca, 0x82, 0x6f, 0x38, 0xfa, 0x63, 0x8e, 0xfe, 0x7a, 0xf5, 0x86, 0x35, 0xf7, 0xf0, 0x64, - 0xc9, 0xfa, 0xf2, 0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, 0x00, + // 625 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x53, 0x3f, 0x6f, 0xd4, 0x3e, + 0x18, 0x8e, 0x7f, 0x97, 0xbb, 0xe6, 0x7c, 0xbf, 0x53, 0x2b, 0xab, 0x42, 0x69, 0x45, 0xdd, 0xa3, + 0x02, 0xe9, 0x16, 0x72, 0xa8, 0x08, 0x89, 0x05, 0x41, 0xab, 0x6b, 0x81, 0x02, 0xaa, 0x14, 0x75, + 0x62, 0x89, 0x9c, 0xd4, 0x09, 0x51, 0x13, 0x3b, 0x38, 0x4e, 0xe9, 0x6d, 0x30, 0xb0, 0x33, 0xf2, + 0x11, 0xf8, 0x28, 0x1d, 0x2b, 0xb1, 0x54, 0x0c, 0x85, 0xa6, 0x0b, 0x63, 0x3f, 0x02, 0xb2, 0x93, + 0xbb, 0xfe, 0x61, 0xb9, 0x2e, 0x4c, 0x7e, 0x1f, 0x3f, 0xef, 0xf3, 0xfe, 0xb5, 0x61, 0x47, 0x14, + 0x09, 0xcd, 0x9d, 0x4c, 0x70, 0xc9, 0x51, 0x53, 0x83, 0xc5, 0xfb, 0x51, 0x2c, 0xdf, 0x15, 0xbe, + 0x13, 0xf0, 0x74, 0x10, 0xf1, 0x88, 0x0f, 0x34, 0xeb, 0x17, 0xa1, 0x46, 0x1a, 0x68, 0xab, 0x52, + 0x2d, 0xe2, 0x88, 0xf3, 0x28, 0xa1, 0x17, 0x5e, 0xbb, 0x85, 0x20, 0x32, 0xe6, 0xac, 0xe6, 0x17, + 0xae, 0xf3, 0x84, 0x8d, 0x6a, 0xea, 0xc1, 0xe5, 0x4c, 0x82, 0x84, 0x84, 0x91, 0x41, 0x1a, 0xa7, + 0xb1, 0x18, 0x64, 0x7b, 0x51, 0x65, 0x65, 0x7e, 0x75, 0xd6, 0x8a, 0xe1, 0x34, 0x0a, 0x2f, 0x28, + 0x72, 0xc9, 0xd3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+ 0x24, 0xd5, 0xc3, 0x6c, 0xfd, 0x9b, 0xf4, 0x97, 0x73, 0xea, 0xdd, 0x76, 0xd7, 0x9f, 0x1c, 0x9d, + 0x62, 0xe3, 0xf8, 0x14, 0x1b, 0xe7, 0xa7, 0x18, 0x7c, 0x2c, 0x31, 0xf8, 0x56, 0x62, 0x70, 0x58, + 0x62, 0x70, 0x54, 0x62, 0xf0, 0xab, 0xc4, 0xe0, 0x77, 0x89, 0x8d, 0xf3, 0x12, 0x83, 0x2f, 0x67, + 0xd8, 0x38, 0x3a, 0xc3, 0xc6, 0xf1, 0x19, 0x36, 0xde, 0xce, 0xe8, 0xef, 0x96, 0xf9, 0x7e, 0x4b, + 0x4f, 0xfb, 0xe1, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa5, 0x5d, 0x2e, 0xd5, 0x1b, 0x05, 0x00, + 0x00, } func (this *RuleGroupDesc) Equal(that interface{}) bool { @@ -1358,7 +1361,7 @@ func (m *RuleDesc) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Labels = append(m.Labels, github_com_grafana_mimir_pkg_mimirpb.LabelAdapter{}) + m.Labels = append(m.Labels, github_com_grafana_mimir_pkg_mimirpb_custom.LabelAdapter{}) if err := m.Labels[len(m.Labels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -1392,7 +1395,7 @@ func (m *RuleDesc) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Annotations = append(m.Annotations, github_com_grafana_mimir_pkg_mimirpb.LabelAdapter{}) + m.Annotations = append(m.Annotations, github_com_grafana_mimir_pkg_mimirpb_custom.LabelAdapter{}) if err := m.Annotations[len(m.Annotations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/pkg/ruler/rulespb/rules.proto b/pkg/ruler/rulespb/rules.proto index 0bcdfd05e5..43af738fbe 100644 --- a/pkg/ruler/rulespb/rules.proto +++ b/pkg/ruler/rulespb/rules.proto @@ -13,6 +13,7 @@ import "github.com/gogo/protobuf/gogoproto/gogo.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/any.proto"; import "github.com/grafana/mimir/pkg/mimirpb/mimir.proto"; +import "github.com/grafana/mimir/pkg/mimirpb_custom/mimir_custom_types.proto"; option (gogoproto.marshaler_all) = true; option (gogoproto.unmarshaler_all) = true; @@ -47,12 +48,12 @@ message RuleDesc { string alert = 3; google.protobuf.Duration for = 4 [(gogoproto.nullable) = false,(gogoproto.stdduration) = true]; google.protobuf.Duration keep_firing_for = 13 [(gogoproto.nullable) = false,(gogoproto.stdduration) = true]; - repeated cortexpb.LabelPair labels = 5 [ + repeated cortexpb_custom.LabelAdapter labels = 5 [ (gogoproto.nullable) = false, - (gogoproto.customtype) = "github.com/grafana/mimir/pkg/mimirpb.LabelAdapter" + (gogoproto.customtype) = "github.com/grafana/mimir/pkg/mimirpb_custom.LabelAdapter" ]; - repeated cortexpb.LabelPair annotations = 6 [ + repeated cortexpb_custom.LabelAdapter annotations = 6 [ (gogoproto.nullable) = false, - (gogoproto.customtype) = "github.com/grafana/mimir/pkg/mimirpb.LabelAdapter" + (gogoproto.customtype) = "github.com/grafana/mimir/pkg/mimirpb_custom.LabelAdapter" ]; } diff --git a/pkg/ruler/rulestore/bucketclient/bucket_client_test.go b/pkg/ruler/rulestore/bucketclient/bucket_client_test.go index acaea6db7b..774ebd9d33 100644 --- a/pkg/ruler/rulestore/bucketclient/bucket_client_test.go +++ b/pkg/ruler/rulestore/bucketclient/bucket_client_test.go @@ -23,7 +23,7 @@ import ( "github.com/stretchr/testify/require" "github.com/thanos-io/objstore" - "github.com/grafana/mimir/pkg/mimirpb" + "github.com/grafana/mimir/pkg/mimirpb_custom" "github.com/grafana/mimir/pkg/ruler/rulespb" "github.com/grafana/mimir/pkg/ruler/rulestore" "github.com/grafana/mimir/pkg/storage/tsdb/bucketcache" @@ -156,7 +156,7 @@ func TestLoadRules(t *testing.T) { { For: 5 * time.Minute, KeepFiringFor: 2 * time.Minute, - Labels: []mimirpb.LabelAdapter{{Name: "label1", Value: "value1"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "label1", Value: "value1"}}, }, }}, {User: "user1", Namespace: "hello", Name: "second testGroup", Interval: 2 * time.Minute}, diff --git a/pkg/storage/ingest/pusher_test.go b/pkg/storage/ingest/pusher_test.go index b7b1f8d61b..a609fc07e9 100644 --- a/pkg/storage/ingest/pusher_test.go +++ b/pkg/storage/ingest/pusher_test.go @@ -27,6 +27,7 @@ import ( "google.golang.org/grpc/codes" "github.com/grafana/mimir/pkg/mimirpb" + "github.com/grafana/mimir/pkg/mimirpb_custom" util_log "github.com/grafana/mimir/pkg/util/log" ) @@ -1120,7 +1121,7 @@ func TestBatchingQueue(t *testing.T) { timeSeries.Exemplars = append(timeSeries.Exemplars, mimirpb.Exemplar{ Value: 42.0, TimestampMs: timestamp, - Labels: []mimirpb.LabelAdapter{{Name: "trace_id", Value: "abc123"}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "trace_id", Value: "abc123"}}, }, ) diff --git a/pkg/storage/ingest/writer_test.go b/pkg/storage/ingest/writer_test.go index 55bd5fdae3..4bba3edc7c 100644 --- a/pkg/storage/ingest/writer_test.go +++ b/pkg/storage/ingest/writer_test.go @@ -24,6 +24,7 @@ import ( "go.uber.org/atomic" "github.com/grafana/mimir/pkg/mimirpb" + "github.com/grafana/mimir/pkg/mimirpb_custom" "github.com/grafana/mimir/pkg/util/test" "github.com/grafana/mimir/pkg/util/testkafka" ) @@ -1029,7 +1030,7 @@ func BenchmarkMarshalWriteRequestToRecords_NoSplitting(b *testing.B) { func mockPreallocTimeseries(metricName string) mimirpb.PreallocTimeseries { return mimirpb.PreallocTimeseries{ TimeSeries: &mimirpb.TimeSeries{ - Labels: []mimirpb.LabelAdapter{{Name: "__name__", Value: metricName}}, + Labels: []mimirpb_custom.LabelAdapter{{Name: "__name__", Value: metricName}}, Samples: []mimirpb.Sample{{TimestampMs: 1, Value: 2}}, Exemplars: []mimirpb.Exemplar{}, // Makes comparison with unmarshalled TimeSeries easy. }, @@ -1039,7 +1040,7 @@ func mockPreallocTimeseries(metricName string) mimirpb.PreallocTimeseries { func mockPreallocTimeseriesWithExemplar(metricName string) mimirpb.PreallocTimeseries { return mimirpb.PreallocTimeseries{ TimeSeries: &mimirpb.TimeSeries{ - Labels: []mimirpb.LabelAdapter{ + Labels: []mimirpb_custom.LabelAdapter{ {Name: "__name__", Value: metricName}, }, Samples: []mimirpb.Sample{{ @@ -1049,7 +1050,7 @@ func mockPreallocTimeseriesWithExemplar(metricName string) mimirpb.PreallocTimes Exemplars: []mimirpb.Exemplar{{ TimestampMs: 2, Value: 14, - Labels: []mimirpb.LabelAdapter{ + Labels: []mimirpb_custom.LabelAdapter{ {Name: "trace_id", Value: metricName + "_trace"}, }, }}, diff --git a/pkg/storage/soft_append_error_processor.go b/pkg/storage/soft_append_error_processor.go index 0f02131537..2028f71eb3 100644 --- a/pkg/storage/soft_append_error_processor.go +++ b/pkg/storage/soft_append_error_processor.go @@ -7,7 +7,7 @@ import ( "github.com/prometheus/prometheus/model/histogram" "github.com/prometheus/prometheus/storage" - "github.com/grafana/mimir/pkg/mimirpb" + "github.com/grafana/mimir/pkg/mimirpb_custom" "github.com/grafana/mimir/pkg/util/globalerror" ) @@ -17,36 +17,36 @@ import ( type SoftAppendErrorProcessor struct { // commonCallback is called irrespective of soft or hard error. commonCallback func() - errOutOfBounds func(int64, []mimirpb.LabelAdapter) - errOutOfOrderSample func(int64, []mimirpb.LabelAdapter) - errTooOldSample func(int64, []mimirpb.LabelAdapter) - sampleTooFarInFuture func(int64, []mimirpb.LabelAdapter) - errDuplicateSampleForTimestamp func(int64, []mimirpb.LabelAdapter) + errOutOfBounds func(int64, []mimirpb_custom.LabelAdapter) + errOutOfOrderSample func(int64, []mimirpb_custom.LabelAdapter) + errTooOldSample func(int64, []mimirpb_custom.LabelAdapter) + sampleTooFarInFuture func(int64, []mimirpb_custom.LabelAdapter) + errDuplicateSampleForTimestamp func(int64, []mimirpb_custom.LabelAdapter) maxSeriesPerUser func() - maxSeriesPerMetric func(labels []mimirpb.LabelAdapter) - errOOONativeHistogramsDisabled func(error, int64, []mimirpb.LabelAdapter) - errHistogramCountMismatch func(error, int64, []mimirpb.LabelAdapter) - errHistogramCountNotBigEnough func(error, int64, []mimirpb.LabelAdapter) - errHistogramNegativeBucketCount func(error, int64, []mimirpb.LabelAdapter) - errHistogramSpanNegativeOffset func(error, int64, []mimirpb.LabelAdapter) - errHistogramSpansBucketsMismatch func(error, int64, []mimirpb.LabelAdapter) + maxSeriesPerMetric func(labels []mimirpb_custom.LabelAdapter) + errOOONativeHistogramsDisabled func(error, int64, []mimirpb_custom.LabelAdapter) + errHistogramCountMismatch func(error, int64, []mimirpb_custom.LabelAdapter) + errHistogramCountNotBigEnough func(error, int64, []mimirpb_custom.LabelAdapter) + errHistogramNegativeBucketCount func(error, int64, []mimirpb_custom.LabelAdapter) + errHistogramSpanNegativeOffset func(error, int64, []mimirpb_custom.LabelAdapter) + errHistogramSpansBucketsMismatch func(error, int64, []mimirpb_custom.LabelAdapter) } func NewSoftAppendErrorProcessor( commonCallback func(), - errOutOfBounds func(int64, []mimirpb.LabelAdapter), - errOutOfOrderSample func(int64, []mimirpb.LabelAdapter), - errTooOldSample func(int64, []mimirpb.LabelAdapter), - sampleTooFarInFuture func(int64, []mimirpb.LabelAdapter), - errDuplicateSampleForTimestamp func(int64, []mimirpb.LabelAdapter), + errOutOfBounds func(int64, []mimirpb_custom.LabelAdapter), + errOutOfOrderSample func(int64, []mimirpb_custom.LabelAdapter), + errTooOldSample func(int64, []mimirpb_custom.LabelAdapter), + sampleTooFarInFuture func(int64, []mimirpb_custom.LabelAdapter), + errDuplicateSampleForTimestamp func(int64, []mimirpb_custom.LabelAdapter), maxSeriesPerUser func(), - maxSeriesPerMetric func(labels []mimirpb.LabelAdapter), - errOOONativeHistogramsDisabled func(error, int64, []mimirpb.LabelAdapter), - errHistogramCountMismatch func(error, int64, []mimirpb.LabelAdapter), - errHistogramCountNotBigEnough func(error, int64, []mimirpb.LabelAdapter), - errHistogramNegativeBucketCount func(error, int64, []mimirpb.LabelAdapter), - errHistogramSpanNegativeOffset func(error, int64, []mimirpb.LabelAdapter), - errHistogramSpansBucketsMismatch func(error, int64, []mimirpb.LabelAdapter), + maxSeriesPerMetric func(labels []mimirpb_custom.LabelAdapter), + errOOONativeHistogramsDisabled func(error, int64, []mimirpb_custom.LabelAdapter), + errHistogramCountMismatch func(error, int64, []mimirpb_custom.LabelAdapter), + errHistogramCountNotBigEnough func(error, int64, []mimirpb_custom.LabelAdapter), + errHistogramNegativeBucketCount func(error, int64, []mimirpb_custom.LabelAdapter), + errHistogramSpanNegativeOffset func(error, int64, []mimirpb_custom.LabelAdapter), + errHistogramSpansBucketsMismatch func(error, int64, []mimirpb_custom.LabelAdapter), ) SoftAppendErrorProcessor { return SoftAppendErrorProcessor{ commonCallback: commonCallback, @@ -70,7 +70,7 @@ func NewSoftAppendErrorProcessor( // In case a soft error is encountered, we can continue ingesting other samples without aborting // the whole request. ProcessErr always calls the commonCallback() if it exists. // err must be non-nil. -func (e *SoftAppendErrorProcessor) ProcessErr(err error, ts int64, labels []mimirpb.LabelAdapter) bool { +func (e *SoftAppendErrorProcessor) ProcessErr(err error, ts int64, labels []mimirpb_custom.LabelAdapter) bool { e.commonCallback() switch { case errors.Is(err, storage.ErrOutOfBounds): diff --git a/pkg/storegateway/bucket_e2e_test.go b/pkg/storegateway/bucket_e2e_test.go index bbd63c1c72..597333027b 100644 --- a/pkg/storegateway/bucket_e2e_test.go +++ b/pkg/storegateway/bucket_e2e_test.go @@ -33,7 +33,7 @@ import ( "github.com/thanos-io/objstore/providers/filesystem" "google.golang.org/grpc/codes" - "github.com/grafana/mimir/pkg/mimirpb" + "github.com/grafana/mimir/pkg/mimirpb_custom" mimir_tsdb "github.com/grafana/mimir/pkg/storage/tsdb" "github.com/grafana/mimir/pkg/storage/tsdb/block" "github.com/grafana/mimir/pkg/storegateway/indexcache" @@ -236,7 +236,7 @@ func prepareStoreWithTestBlocks(t testing.TB, bkt objstore.Bucket, cfg *prepareS type testBucketStoreCase struct { req *storepb.SeriesRequest - expected [][]mimirpb.LabelAdapter + expected [][]mimirpb_custom.LabelAdapter expectedChunkLen int } @@ -271,7 +271,7 @@ func testBucketStore_e2e(t *testing.T, ctx context.Context, s *storeSuite, addit MaxTime: maxt, }, expectedChunkLen: 3, - expected: [][]mimirpb.LabelAdapter{ + expected: [][]mimirpb_custom.LabelAdapter{ {{Name: "a", Value: "1"}, {Name: "b", Value: "1"}}, {{Name: "a", Value: "1"}, {Name: "b", Value: "2"}}, {{Name: "a", Value: "1"}, {Name: "c", Value: "1"}}, @@ -291,7 +291,7 @@ func testBucketStore_e2e(t *testing.T, ctx context.Context, s *storeSuite, addit MaxTime: maxt, }, expectedChunkLen: 3, - expected: [][]mimirpb.LabelAdapter{ + expected: [][]mimirpb_custom.LabelAdapter{ {{Name: "a", Value: "1"}, {Name: "b", Value: "1"}}, {{Name: "a", Value: "1"}, {Name: "b", Value: "2"}}, {{Name: "a", Value: "1"}, {Name: "c", Value: "1"}}, @@ -307,7 +307,7 @@ func testBucketStore_e2e(t *testing.T, ctx context.Context, s *storeSuite, addit MaxTime: maxt, }, expectedChunkLen: 3, - expected: [][]mimirpb.LabelAdapter{ + expected: [][]mimirpb_custom.LabelAdapter{ {{Name: "a", Value: "1"}, {Name: "b", Value: "1"}}, {{Name: "a", Value: "1"}, {Name: "b", Value: "2"}}, {{Name: "a", Value: "1"}, {Name: "c", Value: "1"}}, @@ -323,7 +323,7 @@ func testBucketStore_e2e(t *testing.T, ctx context.Context, s *storeSuite, addit MaxTime: maxt, }, expectedChunkLen: 3, - expected: [][]mimirpb.LabelAdapter{ + expected: [][]mimirpb_custom.LabelAdapter{ {{Name: "a", Value: "1"}, {Name: "b", Value: "1"}}, {{Name: "a", Value: "1"}, {Name: "b", Value: "2"}}, {{Name: "a", Value: "1"}, {Name: "c", Value: "1"}}, @@ -343,7 +343,7 @@ func testBucketStore_e2e(t *testing.T, ctx context.Context, s *storeSuite, addit MaxTime: maxt, }, expectedChunkLen: 3, - expected: [][]mimirpb.LabelAdapter{ + expected: [][]mimirpb_custom.LabelAdapter{ {{Name: "a", Value: "1"}, {Name: "b", Value: "1"}}, {{Name: "a", Value: "1"}, {Name: "b", Value: "2"}}, {{Name: "a", Value: "1"}, {Name: "c", Value: "1"}}, @@ -363,7 +363,7 @@ func testBucketStore_e2e(t *testing.T, ctx context.Context, s *storeSuite, addit MaxTime: maxt, }, expectedChunkLen: 3, - expected: [][]mimirpb.LabelAdapter{ + expected: [][]mimirpb_custom.LabelAdapter{ {{Name: "a", Value: "1"}, {Name: "b", Value: "2"}}, {{Name: "a", Value: "2"}, {Name: "b", Value: "2"}}, }, @@ -377,7 +377,7 @@ func testBucketStore_e2e(t *testing.T, ctx context.Context, s *storeSuite, addit MaxTime: maxt, }, expectedChunkLen: 3, - expected: [][]mimirpb.LabelAdapter{ + expected: [][]mimirpb_custom.LabelAdapter{ {{Name: "a", Value: "1"}, {Name: "b", Value: "1"}}, {{Name: "a", Value: "1"}, {Name: "b", Value: "2"}}, {{Name: "a", Value: "1"}, {Name: "c", Value: "1"}}, @@ -393,7 +393,7 @@ func testBucketStore_e2e(t *testing.T, ctx context.Context, s *storeSuite, addit MaxTime: maxt, }, expectedChunkLen: 3, - expected: [][]mimirpb.LabelAdapter{ + expected: [][]mimirpb_custom.LabelAdapter{ {{Name: "a", Value: "1"}, {Name: "b", Value: "1"}}, {{Name: "a", Value: "1"}, {Name: "b", Value: "2"}}, {{Name: "a", Value: "1"}, {Name: "c", Value: "1"}}, @@ -427,7 +427,7 @@ func testBucketStore_e2e(t *testing.T, ctx context.Context, s *storeSuite, addit SkipChunks: true, }, expectedChunkLen: 0, - expected: [][]mimirpb.LabelAdapter{ + expected: [][]mimirpb_custom.LabelAdapter{ {{Name: "a", Value: "1"}, {Name: "b", Value: "1"}}, {{Name: "a", Value: "1"}, {Name: "b", Value: "2"}}, {{Name: "a", Value: "1"}, {Name: "c", Value: "1"}}, @@ -540,7 +540,7 @@ func TestBucketStore_e2e_StreamingEdgeCases(t *testing.T) { MaxTime: maxt, }, expectedChunkLen: 1, - expected: [][]mimirpb.LabelAdapter{ + expected: [][]mimirpb_custom.LabelAdapter{ {{Name: "a", Value: "1"}, {Name: "c", Value: "1"}}, {{Name: "a", Value: "1"}, {Name: "c", Value: "2"}}, {{Name: "a", Value: "2"}, {Name: "c", Value: "1"}}, diff --git a/pkg/storegateway/bucket_stores_test.go b/pkg/storegateway/bucket_stores_test.go index 60523731fe..ba7d73ee51 100644 --- a/pkg/storegateway/bucket_stores_test.go +++ b/pkg/storegateway/bucket_stores_test.go @@ -41,6 +41,7 @@ import ( grpc_metadata "google.golang.org/grpc/metadata" "github.com/grafana/mimir/pkg/mimirpb" + "github.com/grafana/mimir/pkg/mimirpb_custom" "github.com/grafana/mimir/pkg/storage/bucket" "github.com/grafana/mimir/pkg/storage/bucket/filesystem" mimir_tsdb "github.com/grafana/mimir/pkg/storage/tsdb" @@ -101,7 +102,7 @@ func TestBucketStores_InitialSync(t *testing.T) { require.NoError(t, err) assert.Empty(t, warnings) require.Len(t, seriesSet, 1) - assert.Equal(t, []mimirpb.LabelAdapter{{Name: labels.MetricName, Value: metricName}}, seriesSet[0].Labels) + assert.Equal(t, []mimirpb_custom.LabelAdapter{{Name: labels.MetricName, Value: metricName}}, seriesSet[0].Labels) } // Query series of another user. @@ -175,7 +176,7 @@ func TestBucketStores_InitialSyncShouldRetryOnFailure(t *testing.T) { require.NoError(t, err) assert.Empty(t, warnings) require.Len(t, seriesSet, 1) - assert.Equal(t, []mimirpb.LabelAdapter{{Name: labels.MetricName, Value: "series_1"}}, seriesSet[0].Labels) + assert.Equal(t, []mimirpb_custom.LabelAdapter{{Name: labels.MetricName, Value: "series_1"}}, seriesSet[0].Labels) assert.NoError(t, testutil.GatherAndCompare(reg, strings.NewReader(` # HELP cortex_blocks_meta_syncs_total Total blocks metadata synchronization attempts @@ -250,7 +251,7 @@ func TestBucketStores_SyncBlocks(t *testing.T) { require.NoError(t, err) assert.Empty(t, warnings) assert.Len(t, seriesSet, 1) - assert.Equal(t, []mimirpb.LabelAdapter{{Name: labels.MetricName, Value: metricName}}, seriesSet[0].Labels) + assert.Equal(t, []mimirpb_custom.LabelAdapter{{Name: labels.MetricName, Value: metricName}}, seriesSet[0].Labels) assert.NoError(t, testutil.GatherAndCompare(reg, strings.NewReader(` # HELP cortex_bucket_store_blocks_loaded Number of currently loaded blocks. diff --git a/pkg/storegateway/gateway_test.go b/pkg/storegateway/gateway_test.go index c91693f568..d671187ccd 100644 --- a/pkg/storegateway/gateway_test.go +++ b/pkg/storegateway/gateway_test.go @@ -44,6 +44,7 @@ import ( "google.golang.org/grpc/status" "github.com/grafana/mimir/pkg/mimirpb" + "github.com/grafana/mimir/pkg/mimirpb_custom" "github.com/grafana/mimir/pkg/storage/bucket" "github.com/grafana/mimir/pkg/storage/bucket/filesystem" "github.com/grafana/mimir/pkg/storage/sharding" @@ -1078,7 +1079,7 @@ func TestStoreGateway_SeriesQueryingShouldRemoveExternalLabels(t *testing.T) { actual := seriesSet[seriesID] // Ensure Mimir external labels have been removed. - assert.Equal(t, []mimirpb.LabelAdapter{{Name: "series_id", Value: strconv.Itoa(seriesID)}}, actual.Labels) + assert.Equal(t, []mimirpb_custom.LabelAdapter{{Name: "series_id", Value: strconv.Itoa(seriesID)}}, actual.Labels) // Ensure samples have been correctly queried. The store-gateway doesn't deduplicate chunks, // so the same sample is returned twice because in this test we query two identical blocks. diff --git a/pkg/storegateway/storepb/types.pb.go b/pkg/storegateway/storepb/types.pb.go index 59b78b88a1..1cf309b981 100644 --- a/pkg/storegateway/storepb/types.pb.go +++ b/pkg/storegateway/storepb/types.pb.go @@ -9,6 +9,8 @@ import ( proto "github.com/gogo/protobuf/proto" _ "github.com/grafana/mimir/pkg/mimirpb" github_com_grafana_mimir_pkg_mimirpb "github.com/grafana/mimir/pkg/mimirpb" + _ "github.com/grafana/mimir/pkg/mimirpb_custom" + github_com_grafana_mimir_pkg_mimirpb_custom "github.com/grafana/mimir/pkg/mimirpb_custom" io "io" math "math" math_bits "math/bits" @@ -117,8 +119,8 @@ func (m *Chunk) XXX_DiscardUnknown() { var xxx_messageInfo_Chunk proto.InternalMessageInfo type Series struct { - Labels []github_com_grafana_mimir_pkg_mimirpb.LabelAdapter `protobuf:"bytes,1,rep,name=labels,proto3,customtype=github.com/grafana/mimir/pkg/mimirpb.LabelAdapter" json:"labels"` - Chunks []AggrChunk `protobuf:"bytes,2,rep,name=chunks,proto3" json:"chunks"` + Labels []github_com_grafana_mimir_pkg_mimirpb_custom.LabelAdapter `protobuf:"bytes,1,rep,name=labels,proto3,customtype=github.com/grafana/mimir/pkg/mimirpb_custom.LabelAdapter" json:"labels"` + Chunks []AggrChunk `protobuf:"bytes,2,rep,name=chunks,proto3" json:"chunks"` } func (m *Series) Reset() { *m = Series{} } @@ -154,7 +156,7 @@ func (m *Series) XXX_DiscardUnknown() { var xxx_messageInfo_Series proto.InternalMessageInfo type StreamingSeries struct { - Labels []github_com_grafana_mimir_pkg_mimirpb.LabelAdapter `protobuf:"bytes,1,rep,name=labels,proto3,customtype=github.com/grafana/mimir/pkg/mimirpb.LabelAdapter" json:"labels"` + Labels []github_com_grafana_mimir_pkg_mimirpb_custom.LabelAdapter `protobuf:"bytes,1,rep,name=labels,proto3,customtype=github.com/grafana/mimir/pkg/mimirpb_custom.LabelAdapter" json:"labels"` } func (m *StreamingSeries) Reset() { *m = StreamingSeries{} } @@ -429,52 +431,53 @@ func init() { func init() { proto.RegisterFile("types.proto", fileDescriptor_d938547f84707355) } var fileDescriptor_d938547f84707355 = []byte{ - // 715 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x54, 0x4d, 0x6f, 0xd3, 0x4a, - 0x14, 0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c, 0x17, 0x12, 0xa1, 0xf5, 0x2b, 0xcf, 0x7f, 0x65, - 0xd6, 0x76, 0x9e, 0x63, 0x1d, 0x8e, 0x43, 0x92, 0xfc, 0x01, 0x10, 0x54, 0x7d, 0x9c, 0x78, 0xcb, - 0xdb, 0xe2, 0x8c, 0x4a, 0x30, 0xf3, 0x16, 0x0f, 0x86, 0x44, 0x58, 0xcb, 0xdb, 0x32, 0x30, 0xdf, - 0x40, 0x35, 0xae, 0x8b, 0x9f, 0xf1, 0x7c, 0x33, 0xa7, 0xb9, 0xaf, 0x2b, 0xa8, 0x04, 0xf5, 0x2b, - 0xc9, 0x17, 0xcd, 0x7d, 0x1d, 0xdc, 0xa0, 0xda, 0x4d, 0x3d, 0x75, 0x93, 0x6a, 0x37, 0xf5, 0x74, - 0x63, 0xf3, 0x78, 0x62, 0x28, 0x27, 0x13, 0x43, 0x39, 0x9d, 0x18, 0xca, 0xc5, 0xc4, 0x00, 0x1f, - 0xa6, 0x06, 0xf8, 0x32, 0x35, 0xc0, 0xf1, 0xd4, 0x00, 0x27, 0x53, 0x03, 0xfc, 0x98, 0x1a, 0xe0, - 0xe7, 0xd4, 0x50, 0x2e, 0xa6, 0x06, 0xf8, 0x74, 0x6e, 0x28, 0x27, 0xe7, 0x86, 0x72, 0x7a, 0x6e, - 0x28, 0xaf, 0x73, 0x8c, 0x07, 0x11, 0x09, 0xdb, 0xed, 0xac, 0xf8, 0x13, 0x3e, 0xfc, 0x15, 0x00, - 0x00, 0xff, 0xff, 0x58, 0xdc, 0x9c, 0x04, 0x81, 0x05, 0x00, 0x00, + // 733 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x54, 0x41, 0x6f, 0xd3, 0x48, + 0x14, 0xf6, 0x24, 0x4e, 0xe2, 0x4c, 0xda, 0xad, 0x77, 0x9a, 0xdd, 0xa6, 0x95, 0xd6, 0xcd, 0x5a, + 0x5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fc, 0x1f, 0xdb, 0xb1, 0x2f, 0x24, 0x42, 0x6b, 0x33, 0x2f, + 0xc4, 0xf2, 0xa4, 0xed, 0x34, 0xc7, 0xda, 0x3f, 0xea, 0x93, 0xe4, 0x91, 0x40, 0x50, 0x0d, 0x70, + 0xa2, 0x2d, 0x6f, 0x8b, 0x33, 0x2a, 0xc2, 0xcc, 0x1b, 0xdc, 0x1b, 0x10, 0x21, 0x2d, 0x6f, 0xcb, + 0xc0, 0x7c, 0x0d, 0xd5, 0xb8, 0x2e, 0xbe, 0xe9, 0xd3, 0xcd, 0x9c, 0xc6, 0xae, 0xae, 0xa0, 0x22, + 0xd4, 0x67, 0x92, 0xcf, 0x1a, 0xbb, 0x3a, 0xb8, 0x46, 0xb5, 0x1b, 0x7a, 0xea, 0x3a, 0xd5, 0x6e, + 0xe8, 0xe9, 0xfa, 0xc6, 0xf1, 0xc8, 0x50, 0x4e, 0x46, 0x86, 0x72, 0x3a, 0x32, 0x94, 0x8b, 0x91, + 0x01, 0xde, 0x8d, 0x0d, 0xf0, 0x69, 0x6c, 0x80, 0xe3, 0xb1, 0x01, 0x4e, 0xc6, 0x06, 0xf8, 0x3e, + 0x36, 0xc0, 0x8f, 0xb1, 0xa1, 0x5c, 0x8c, 0x0d, 0xf0, 0xf1, 0xdc, 0x50, 0x4e, 0xce, 0x0d, 0xe5, + 0xf4, 0xdc, 0x50, 0x5e, 0xe5, 0x18, 0x0f, 0x23, 0xd2, 0x6f, 0xb5, 0xb2, 0xe2, 0xb1, 0xbc, 0xfb, + 0x33, 0x00, 0x00, 0xff, 0xff, 0xd8, 0x3f, 0xfd, 0xb3, 0xea, 0x05, 0x00, 0x00, } func (x Chunk_Encoding) String() string { @@ -1704,7 +1707,7 @@ func (m *Series) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Labels = append(m.Labels, github_com_grafana_mimir_pkg_mimirpb.LabelAdapter{}) + m.Labels = append(m.Labels, github_com_grafana_mimir_pkg_mimirpb_custom.LabelAdapter{}) if err := m.Labels[len(m.Labels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -1825,7 +1828,7 @@ func (m *StreamingSeries) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Labels = append(m.Labels, github_com_grafana_mimir_pkg_mimirpb.LabelAdapter{}) + m.Labels = append(m.Labels, github_com_grafana_mimir_pkg_mimirpb_custom.LabelAdapter{}) if err := m.Labels[len(m.Labels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/pkg/storegateway/storepb/types.proto b/pkg/storegateway/storepb/types.proto index 0baeaf78d8..6b65678e05 100644 --- a/pkg/storegateway/storepb/types.proto +++ b/pkg/storegateway/storepb/types.proto @@ -10,6 +10,7 @@ option go_package = "storepb"; import "github.com/gogo/protobuf/gogoproto/gogo.proto"; import "github.com/grafana/mimir/pkg/mimirpb/mimir.proto"; +import "github.com/grafana/mimir/pkg/mimirpb_custom/mimir_custom_types.proto"; option (gogoproto.sizer_all) = true; option (gogoproto.marshaler_all) = true; @@ -33,12 +34,12 @@ message Chunk { } message Series { - repeated cortexpb.LabelPair labels = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/grafana/mimir/pkg/mimirpb.LabelAdapter"]; + repeated cortexpb_custom.LabelAdapter labels = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/grafana/mimir/pkg/mimirpb_custom.LabelAdapter"]; repeated AggrChunk chunks = 2 [(gogoproto.nullable) = false]; } message StreamingSeries { - repeated cortexpb.LabelPair labels = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/grafana/mimir/pkg/mimirpb.LabelAdapter"]; + repeated cortexpb_custom.LabelAdapter labels = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/grafana/mimir/pkg/mimirpb_custom.LabelAdapter"]; } message StreamingSeriesBatch { diff --git a/pkg/util/extract/extract.go b/pkg/util/extract/extract.go index 672e319b4f..2ee8af4cef 100644 --- a/pkg/util/extract/extract.go +++ b/pkg/util/extract/extract.go @@ -11,7 +11,7 @@ import ( "github.com/prometheus/common/model" "github.com/prometheus/prometheus/model/labels" - "github.com/grafana/mimir/pkg/mimirpb" + "github.com/grafana/mimir/pkg/mimirpb_custom" ) var ( @@ -20,7 +20,7 @@ var ( // UnsafeMetricNameFromLabelAdapters extracts the metric name from a list of LabelPairs. // The returned metric name string is a reference to the label value (no copy). -func UnsafeMetricNameFromLabelAdapters(labels []mimirpb.LabelAdapter) (string, error) { +func UnsafeMetricNameFromLabelAdapters(labels []mimirpb_custom.LabelAdapter) (string, error) { for _, label := range labels { if label.Name == model.MetricNameLabel { return label.Value, nil