From d86403f1d8d3f87692602c46180376b227ecf628 Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Thu, 3 Nov 2022 11:09:06 +0000 Subject: [PATCH] Remove Thanos ZLabel type in favour of identical LabelAdapter type (#3345) * labelpb: remove unused LabelSet type * Replace ZLabel with alias to LabelAdapter The implementations are identical. * Remove unused storegateway/prompb * storegateway: convert uses of ZLabel to LabelAdapter Avoid having two names for the same thing. * go mod tidy: xxhash dependency is now indirect * Make imports of gogo.proto consistent So everything compiles and lint errors go away. --- Makefile | 2 - go.mod | 2 +- pkg/querier/block.go | 6 +- pkg/querier/block_test.go | 16 +- pkg/querier/blocks_store_queryable.go | 3 +- pkg/querier/blocks_store_queryable_test.go | 4 +- pkg/storegateway/bucket.go | 4 +- pkg/storegateway/bucket_e2e_test.go | 22 +- pkg/storegateway/bucket_stores_test.go | 8 +- pkg/storegateway/bucket_test.go | 4 +- pkg/storegateway/gateway_test.go | 4 +- pkg/storegateway/hintspb/hints.pb.go | 45 +- pkg/storegateway/hintspb/hints.proto | 2 +- pkg/storegateway/labelpb/label.go | 292 -- pkg/storegateway/labelpb/types.pb.go | 913 ------ pkg/storegateway/labelpb/types.proto | 35 - pkg/storegateway/prompb/types.pb.go | 3099 -------------------- pkg/storegateway/prompb/types.proto | 110 - pkg/storegateway/storepb/custom.go | 8 +- pkg/storegateway/storepb/rpc.pb.go | 103 +- pkg/storegateway/storepb/rpc.proto | 2 +- pkg/storegateway/storepb/types.pb.go | 81 +- pkg/storegateway/storepb/types.proto | 6 +- 23 files changed, 161 insertions(+), 4610 deletions(-) delete mode 100644 pkg/storegateway/labelpb/label.go delete mode 100644 pkg/storegateway/labelpb/types.pb.go delete mode 100644 pkg/storegateway/labelpb/types.proto delete mode 100644 pkg/storegateway/prompb/types.pb.go delete mode 100644 pkg/storegateway/prompb/types.proto diff --git a/Makefile b/Makefile index cc67b67f7c5..66963baf68a 100644 --- a/Makefile +++ b/Makefile @@ -181,8 +181,6 @@ pkg/distributor/ha_tracker.pb.go: pkg/distributor/ha_tracker.proto pkg/ruler/rulespb/rules.pb.go: pkg/ruler/rulespb/rules.proto pkg/ruler/ruler.pb.go: pkg/ruler/ruler.proto pkg/scheduler/schedulerpb/scheduler.pb.go: pkg/scheduler/schedulerpb/scheduler.proto -pkg/storegateway/labelpb/types.pb.go: pkg/storegateway/labelpb/types.proto -pkg/storegateway/prompb/types.pb.go: pkg/storegateway/prompb/types.proto pkg/storegateway/hintspb/hints.pb.go: pkg/storegateway/hintspb/hints.proto pkg/storegateway/storegatewaypb/gateway.pb.go: pkg/storegateway/storegatewaypb/gateway.proto pkg/storegateway/storepb/rpc.pb.go: pkg/storegateway/storepb/rpc.proto diff --git a/go.mod b/go.mod index 91673905519..64d8d49208c 100644 --- a/go.mod +++ b/go.mod @@ -54,7 +54,6 @@ require ( github.com/alecthomas/chroma v0.10.0 github.com/bradfitz/gomemcache v0.0.0-20190913173617-a41fca850d0b github.com/cespare/xxhash v1.1.0 - github.com/cespare/xxhash/v2 v2.1.2 github.com/facette/natsort v0.0.0-20181210072756-2cd4dd1e2dcb github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da github.com/google/go-cmp v0.5.9 @@ -103,6 +102,7 @@ require ( github.com/benbjohnson/clock v1.3.0 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cenkalti/backoff/v4 v4.1.3 // indirect + github.com/cespare/xxhash/v2 v2.1.2 // indirect github.com/chromedp/cdproto v0.0.0-20220629234738-4cfc9cdeeb92 // indirect github.com/chromedp/chromedp v0.8.2 // indirect github.com/coreos/go-semver v0.3.0 // indirect diff --git a/pkg/querier/block.go b/pkg/querier/block.go index dcdfd4b2d2c..97c96a56132 100644 --- a/pkg/querier/block.go +++ b/pkg/querier/block.go @@ -14,8 +14,8 @@ import ( "github.com/prometheus/prometheus/storage" "github.com/prometheus/prometheus/tsdb/chunkenc" + "github.com/grafana/mimir/pkg/mimirpb" "github.com/grafana/mimir/pkg/storage/series" - "github.com/grafana/mimir/pkg/storegateway/labelpb" "github.com/grafana/mimir/pkg/storegateway/storepb" ) @@ -61,7 +61,7 @@ func (bqss *blockQuerierSeriesSet) Next() bool { return false } - currLabels := labelpb.ZLabelsToPromLabels(bqss.series[bqss.next].Labels) + currLabels := mimirpb.FromLabelAdaptersToLabels(bqss.series[bqss.next].Labels) currChunks := bqss.series[bqss.next].Chunks bqss.next++ @@ -69,7 +69,7 @@ func (bqss *blockQuerierSeriesSet) Next() bool { // Merge chunks for current series. Chunks may come in multiple responses, but as soon // as the response has chunks for a new series, we can stop searching. Series are sorted. // See documentation for StoreClient.Series call for details. - for bqss.next < len(bqss.series) && labels.Compare(currLabels, labelpb.ZLabelsToPromLabels(bqss.series[bqss.next].Labels)) == 0 { + for bqss.next < len(bqss.series) && labels.Compare(currLabels, mimirpb.FromLabelAdaptersToLabels(bqss.series[bqss.next].Labels)) == 0 { currChunks = append(currChunks, bqss.series[bqss.next].Chunks...) bqss.next++ } diff --git a/pkg/querier/block_test.go b/pkg/querier/block_test.go index a930875e022..e89196c3569 100644 --- a/pkg/querier/block_test.go +++ b/pkg/querier/block_test.go @@ -21,7 +21,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/grafana/mimir/pkg/storegateway/labelpb" + "github.com/grafana/mimir/pkg/mimirpb" "github.com/grafana/mimir/pkg/storegateway/storepb" "github.com/grafana/mimir/pkg/util" ) @@ -46,7 +46,7 @@ func TestBlockQuerierSeries(t *testing.T) { }, "should return series on success": { series: &storepb.Series{ - Labels: []labelpb.ZLabel{ + Labels: []mimirpb.LabelAdapter{ {Name: "foo", Value: "bar"}, }, Chunks: []storepb.AggrChunk{ @@ -61,7 +61,7 @@ func TestBlockQuerierSeries(t *testing.T) { }, "should return error on failure while reading encoded chunk data": { series: &storepb.Series{ - Labels: []labelpb.ZLabel{{Name: "foo", Value: "bar"}}, + Labels: []mimirpb.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}}}, }, @@ -75,7 +75,7 @@ func TestBlockQuerierSeries(t *testing.T) { testData := testData t.Run(testName, func(t *testing.T) { - series := newBlockQuerierSeries(labelpb.ZLabelsToPromLabels(testData.series.Labels), testData.series.Chunks) + series := newBlockQuerierSeries(mimirpb.FromLabelAdaptersToLabels(testData.series.Labels), testData.series.Chunks) assert.Equal(t, testData.expectedMetric, series.Labels()) @@ -412,11 +412,11 @@ func createAggrChunk(minTime, maxTime int64, samples ...promql.Point) storepb.Ag } } -func mkZLabels(s ...string) []labelpb.ZLabel { - var result []labelpb.ZLabel +func mkZLabels(s ...string) []mimirpb.LabelAdapter { + var result []mimirpb.LabelAdapter for i := 0; i+1 < len(s); i = i + 2 { - result = append(result, labelpb.ZLabel{ + result = append(result, mimirpb.LabelAdapter{ Name: s[i], Value: s[i+1], }) @@ -426,7 +426,7 @@ func mkZLabels(s ...string) []labelpb.ZLabel { } func mkLabels(s ...string) []labels.Label { - return labelpb.ZLabelsToPromLabels(mkZLabels(s...)) + return mimirpb.FromLabelAdaptersToLabels(mkZLabels(s...)) } func Benchmark_newBlockQuerierSeries(b *testing.B) { diff --git a/pkg/querier/blocks_store_queryable.go b/pkg/querier/blocks_store_queryable.go index 56832b637b9..1f445319736 100644 --- a/pkg/querier/blocks_store_queryable.go +++ b/pkg/querier/blocks_store_queryable.go @@ -33,7 +33,6 @@ import ( "golang.org/x/sync/errgroup" grpc_metadata "google.golang.org/grpc/metadata" - "github.com/grafana/mimir/pkg/mimirpb" "github.com/grafana/mimir/pkg/querier/stats" "github.com/grafana/mimir/pkg/storage/bucket" "github.com/grafana/mimir/pkg/storage/series" @@ -749,7 +748,7 @@ func (q *blocksStoreQuerier) fetchSeriesFromStores( mySeries = append(mySeries, s) // Add series fingerprint to query limiter; will return error if we are over the limit - limitErr := queryLimiter.AddSeries(mimirpb.FromLabelsToLabelAdapters(s.PromLabels())) + limitErr := queryLimiter.AddSeries(s.Labels) if limitErr != nil { return validation.LimitError(limitErr.Error()) } diff --git a/pkg/querier/blocks_store_queryable_test.go b/pkg/querier/blocks_store_queryable_test.go index 045d7f3b379..52368b387a7 100644 --- a/pkg/querier/blocks_store_queryable_test.go +++ b/pkg/querier/blocks_store_queryable_test.go @@ -32,10 +32,10 @@ import ( "github.com/weaveworks/common/user" "google.golang.org/grpc" + "github.com/grafana/mimir/pkg/mimirpb" "github.com/grafana/mimir/pkg/storage/sharding" "github.com/grafana/mimir/pkg/storage/tsdb/bucketindex" "github.com/grafana/mimir/pkg/storegateway/hintspb" - "github.com/grafana/mimir/pkg/storegateway/labelpb" "github.com/grafana/mimir/pkg/storegateway/storegatewaypb" "github.com/grafana/mimir/pkg/storegateway/storepb" "github.com/grafana/mimir/pkg/util" @@ -1922,7 +1922,7 @@ func mockSeriesResponseWithChunks(lbls labels.Labels, chunks ...storepb.AggrChun return &storepb.SeriesResponse{ Result: &storepb.SeriesResponse_Series{ Series: &storepb.Series{ - Labels: labelpb.ZLabelsFromPromLabels(lbls), + Labels: mimirpb.FromLabelsToLabelAdapters(lbls), Chunks: chunks, }, }, diff --git a/pkg/storegateway/bucket.go b/pkg/storegateway/bucket.go index 3dd54aa3bcc..7726b66491e 100644 --- a/pkg/storegateway/bucket.go +++ b/pkg/storegateway/bucket.go @@ -45,6 +45,7 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + "github.com/grafana/mimir/pkg/mimirpb" "github.com/grafana/mimir/pkg/storage/sharding" mimir_tsdb "github.com/grafana/mimir/pkg/storage/tsdb" "github.com/grafana/mimir/pkg/storage/tsdb/block" @@ -52,7 +53,6 @@ import ( "github.com/grafana/mimir/pkg/storegateway/hintspb" "github.com/grafana/mimir/pkg/storegateway/indexcache" "github.com/grafana/mimir/pkg/storegateway/indexheader" - "github.com/grafana/mimir/pkg/storegateway/labelpb" "github.com/grafana/mimir/pkg/storegateway/storepb" "github.com/grafana/mimir/pkg/util" "github.com/grafana/mimir/pkg/util/gate" @@ -1033,7 +1033,7 @@ func (s *BucketStore) Series(req *storepb.SeriesRequest, srv storepb.Store_Serie stats.mergedChunksCount += len(series.Chunks) s.metrics.chunkSizeBytes.Observe(float64(chunksSize(series.Chunks))) } - series.Labels = labelpb.ZLabelsFromPromLabels(lset) + series.Labels = mimirpb.FromLabelsToLabelAdapters(lset) if err = srv.Send(storepb.NewSeriesResponse(&series)); err != nil { err = status.Error(codes.Unknown, errors.Wrap(err, "send series response").Error()) return diff --git a/pkg/storegateway/bucket_e2e_test.go b/pkg/storegateway/bucket_e2e_test.go index 9887b34689c..75536dcfb54 100644 --- a/pkg/storegateway/bucket_e2e_test.go +++ b/pkg/storegateway/bucket_e2e_test.go @@ -26,12 +26,12 @@ import ( "github.com/weaveworks/common/httpgrpc" "google.golang.org/grpc/codes" + "github.com/grafana/mimir/pkg/mimirpb" mimir_tsdb "github.com/grafana/mimir/pkg/storage/tsdb" "github.com/grafana/mimir/pkg/storage/tsdb/block" "github.com/grafana/mimir/pkg/storage/tsdb/metadata" "github.com/grafana/mimir/pkg/storegateway/indexcache" "github.com/grafana/mimir/pkg/storegateway/indexheader" - "github.com/grafana/mimir/pkg/storegateway/labelpb" "github.com/grafana/mimir/pkg/storegateway/storepb" "github.com/grafana/mimir/pkg/storegateway/testhelper" ) @@ -216,7 +216,7 @@ func testBucketStore_e2e(t *testing.T, ctx context.Context, s *storeSuite) { // TODO(bwplotka): Add those test cases to TSDB querier_test.go as well, there are no tests for matching. for i, tcase := range []struct { req *storepb.SeriesRequest - expected [][]labelpb.ZLabel + expected [][]mimirpb.LabelAdapter expectedChunkLen int }{ { @@ -228,7 +228,7 @@ func testBucketStore_e2e(t *testing.T, ctx context.Context, s *storeSuite) { MaxTime: maxt, }, expectedChunkLen: 3, - expected: [][]labelpb.ZLabel{ + expected: [][]mimirpb.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"}}, @@ -248,7 +248,7 @@ func testBucketStore_e2e(t *testing.T, ctx context.Context, s *storeSuite) { MaxTime: maxt, }, expectedChunkLen: 3, - expected: [][]labelpb.ZLabel{ + expected: [][]mimirpb.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"}}, @@ -264,7 +264,7 @@ func testBucketStore_e2e(t *testing.T, ctx context.Context, s *storeSuite) { MaxTime: maxt, }, expectedChunkLen: 3, - expected: [][]labelpb.ZLabel{ + expected: [][]mimirpb.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"}}, @@ -280,7 +280,7 @@ func testBucketStore_e2e(t *testing.T, ctx context.Context, s *storeSuite) { MaxTime: maxt, }, expectedChunkLen: 3, - expected: [][]labelpb.ZLabel{ + expected: [][]mimirpb.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"}}, @@ -300,7 +300,7 @@ func testBucketStore_e2e(t *testing.T, ctx context.Context, s *storeSuite) { MaxTime: maxt, }, expectedChunkLen: 3, - expected: [][]labelpb.ZLabel{ + expected: [][]mimirpb.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"}}, @@ -320,7 +320,7 @@ func testBucketStore_e2e(t *testing.T, ctx context.Context, s *storeSuite) { MaxTime: maxt, }, expectedChunkLen: 3, - expected: [][]labelpb.ZLabel{ + expected: [][]mimirpb.LabelAdapter{ {{Name: "a", Value: "1"}, {Name: "b", Value: "2"}}, {{Name: "a", Value: "2"}, {Name: "b", Value: "2"}}, }, @@ -334,7 +334,7 @@ func testBucketStore_e2e(t *testing.T, ctx context.Context, s *storeSuite) { MaxTime: maxt, }, expectedChunkLen: 3, - expected: [][]labelpb.ZLabel{ + expected: [][]mimirpb.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"}}, @@ -350,7 +350,7 @@ func testBucketStore_e2e(t *testing.T, ctx context.Context, s *storeSuite) { MaxTime: maxt, }, expectedChunkLen: 3, - expected: [][]labelpb.ZLabel{ + expected: [][]mimirpb.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"}}, @@ -384,7 +384,7 @@ func testBucketStore_e2e(t *testing.T, ctx context.Context, s *storeSuite) { SkipChunks: true, }, expectedChunkLen: 0, - expected: [][]labelpb.ZLabel{ + expected: [][]mimirpb.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"}}, diff --git a/pkg/storegateway/bucket_stores_test.go b/pkg/storegateway/bucket_stores_test.go index af4a432be15..3ab8a92921f 100644 --- a/pkg/storegateway/bucket_stores_test.go +++ b/pkg/storegateway/bucket_stores_test.go @@ -39,6 +39,7 @@ import ( "go.uber.org/atomic" grpc_metadata "google.golang.org/grpc/metadata" + "github.com/grafana/mimir/pkg/mimirpb" "github.com/grafana/mimir/pkg/storage/bucket" "github.com/grafana/mimir/pkg/storage/bucket/filesystem" mimir_tsdb "github.com/grafana/mimir/pkg/storage/tsdb" @@ -46,7 +47,6 @@ import ( "github.com/grafana/mimir/pkg/storage/tsdb/metadata" mimir_testutil "github.com/grafana/mimir/pkg/storage/tsdb/testutil" "github.com/grafana/mimir/pkg/storegateway/indexcache" - "github.com/grafana/mimir/pkg/storegateway/labelpb" "github.com/grafana/mimir/pkg/storegateway/storepb" "github.com/grafana/mimir/pkg/util" "github.com/grafana/mimir/pkg/util/test" @@ -92,7 +92,7 @@ func TestBucketStores_InitialSync(t *testing.T) { require.NoError(t, err) assert.Empty(t, warnings) require.Len(t, seriesSet, 1) - assert.Equal(t, []labelpb.ZLabel{{Name: labels.MetricName, Value: metricName}}, seriesSet[0].Labels) + assert.Equal(t, []mimirpb.LabelAdapter{{Name: labels.MetricName, Value: metricName}}, seriesSet[0].Labels) } // Query series of another user. @@ -161,7 +161,7 @@ func TestBucketStores_InitialSyncShouldRetryOnFailure(t *testing.T) { require.NoError(t, err) assert.Empty(t, warnings) require.Len(t, seriesSet, 1) - assert.Equal(t, []labelpb.ZLabel{{Name: labels.MetricName, Value: "series_1"}}, seriesSet[0].Labels) + assert.Equal(t, []mimirpb.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 @@ -232,7 +232,7 @@ func TestBucketStores_SyncBlocks(t *testing.T) { require.NoError(t, err) assert.Empty(t, warnings) assert.Len(t, seriesSet, 1) - assert.Equal(t, []labelpb.ZLabel{{Name: labels.MetricName, Value: metricName}}, seriesSet[0].Labels) + assert.Equal(t, []mimirpb.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/bucket_test.go b/pkg/storegateway/bucket_test.go index 9915a91b2f0..19f9dccc31d 100644 --- a/pkg/storegateway/bucket_test.go +++ b/pkg/storegateway/bucket_test.go @@ -47,6 +47,7 @@ import ( "github.com/thanos-io/objstore/providers/filesystem" "go.uber.org/atomic" + "github.com/grafana/mimir/pkg/mimirpb" "github.com/grafana/mimir/pkg/storage/sharding" mimir_tsdb "github.com/grafana/mimir/pkg/storage/tsdb" "github.com/grafana/mimir/pkg/storage/tsdb/block" @@ -54,7 +55,6 @@ import ( "github.com/grafana/mimir/pkg/storegateway/hintspb" "github.com/grafana/mimir/pkg/storegateway/indexcache" "github.com/grafana/mimir/pkg/storegateway/indexheader" - "github.com/grafana/mimir/pkg/storegateway/labelpb" "github.com/grafana/mimir/pkg/storegateway/storepb" "github.com/grafana/mimir/pkg/util/gate" "github.com/grafana/mimir/pkg/util/pool" @@ -2268,7 +2268,7 @@ func createHeadWithSeries(t testing.TB, j int, opts headGenOptions) (*tsdb.Head, var lset labels.Labels assert.NoError(t, ir.Series(all.At(), &lset, &chunkMetas)) - expected = append(expected, &storepb.Series{Labels: labelpb.ZLabelsFromPromLabels(lset)}) + expected = append(expected, &storepb.Series{Labels: mimirpb.FromLabelsToLabelAdapters(lset)}) if opts.SkipChunks { continue diff --git a/pkg/storegateway/gateway_test.go b/pkg/storegateway/gateway_test.go index 04d11277be9..dfe5309bafd 100644 --- a/pkg/storegateway/gateway_test.go +++ b/pkg/storegateway/gateway_test.go @@ -41,6 +41,7 @@ import ( "github.com/thanos-io/objstore" "google.golang.org/grpc/status" + "github.com/grafana/mimir/pkg/mimirpb" "github.com/grafana/mimir/pkg/storage/bucket" "github.com/grafana/mimir/pkg/storage/bucket/filesystem" "github.com/grafana/mimir/pkg/storage/sharding" @@ -49,7 +50,6 @@ import ( "github.com/grafana/mimir/pkg/storage/tsdb/bucketindex" "github.com/grafana/mimir/pkg/storage/tsdb/metadata" mimir_testutil "github.com/grafana/mimir/pkg/storage/tsdb/testutil" - "github.com/grafana/mimir/pkg/storegateway/labelpb" "github.com/grafana/mimir/pkg/storegateway/storepb" "github.com/grafana/mimir/pkg/util" "github.com/grafana/mimir/pkg/util/test" @@ -1062,7 +1062,7 @@ func TestStoreGateway_SeriesQueryingShouldRemoveExternalLabels(t *testing.T) { actual := srv.SeriesSet[seriesID] // Ensure Mimir external labels have been removed. - assert.Equal(t, []labelpb.ZLabel{{Name: "series_id", Value: strconv.Itoa(seriesID)}}, actual.Labels) + assert.Equal(t, []mimirpb.LabelAdapter{{Name: "series_id", Value: strconv.Itoa(seriesID)}}, actual.Labels) // Ensure samples have been correctly queried. The Thanos store also deduplicate samples // in most cases, but it's not strictly required guaranteeing deduplication at this stage. diff --git a/pkg/storegateway/hintspb/hints.pb.go b/pkg/storegateway/hintspb/hints.pb.go index 6e68f1c80cc..f4eca23af54 100644 --- a/pkg/storegateway/hintspb/hints.pb.go +++ b/pkg/storegateway/hintspb/hints.pb.go @@ -303,29 +303,30 @@ func init() { func init() { proto.RegisterFile("hints.proto", fileDescriptor_522be8e0d2634375) } var fileDescriptor_522be8e0d2634375 = []byte{ - // 350 bytes of a gzipped FileDescriptorProto + // 358 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x92, 0xb1, 0x4e, 0xfb, 0x30, - 0x10, 0xc6, 0xed, 0xfe, 0xff, 0x80, 0x70, 0x45, 0x86, 0x50, 0xd1, 0xaa, 0xc3, 0x51, 0x65, 0xea, - 0x94, 0x48, 0x30, 0x22, 0x86, 0x76, 0x62, 0x00, 0x86, 0x20, 0xb5, 0x12, 0x20, 0x55, 0x4e, 0x6b, - 0x92, 0xa8, 0x4d, 0x9c, 0xc6, 0x8e, 0x50, 0x37, 0x1e, 0x81, 0xc7, 0xe0, 0x51, 0x3a, 0x76, 0xec, - 0x84, 0x48, 0xba, 0x30, 0xf6, 0x11, 0x50, 0x9c, 0x44, 0x82, 0x3d, 0xdb, 0xdd, 0x77, 0xe7, 0x9f, - 0xbf, 0x4f, 0x3a, 0xd2, 0xf4, 0xfc, 0x50, 0x0a, 0x33, 0x8a, 0xb9, 0xe4, 0xfa, 0x91,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c, 0x11, 0x5d, 0x24, 0xf5, 0xbb, 0x1e, 0x93, 0xce, 0x1f, 0x7a, 0x5d, 0xb6, 0x87, - 0x83, 0x75, 0x0a, 0x68, 0x93, 0x02, 0xda, 0xa6, 0x80, 0xf6, 0x29, 0xe0, 0xb7, 0x0c, 0xf0, 0x47, - 0x06, 0x78, 0x9d, 0x01, 0xde, 0x64, 0x80, 0xbf, 0x32, 0xc0, 0xdf, 0x19, 0xa0, 0x7d, 0x06, 0xf8, - 0x7d, 0x07, 0x68, 0xb3, 0x03, 0xb4, 0xdd, 0x01, 0x7a, 0xac, 0x2e, 0xd9, 0x39, 0x54, 0xb7, 0x77, - 0xf9, 0x13, 0x00, 0x00, 0xff, 0xff, 0xa1, 0x7f, 0x87, 0x85, 0xe8, 0x02, 0x00, 0x00, + 0x10, 0xc6, 0xed, 0xfe, 0xff, 0x80, 0x70, 0x45, 0x86, 0x80, 0x68, 0xd5, 0xe1, 0xa8, 0x32, 0x75, + 0x21, 0x91, 0x60, 0x44, 0x0c, 0xed, 0xc4, 0x00, 0x0c, 0x41, 0x6a, 0x25, 0x40, 0xaa, 0x9c, 0xd6, + 0x4d, 0xa2, 0x36, 0x71, 0x1a, 0x3b, 0x42, 0xdd, 0x78, 0x04, 0x1e, 0x83, 0x47, 0xe9, 0xd8, 0xb1, + 0x13, 0x22, 0xe9, 0xc2, 0xd8, 0x47, 0x40, 0x75, 0x12, 0xa9, 0xec, 0xd9, 0xfc, 0x7d, 0x77, 0xf7, + 0xf3, 0x77, 0xd2, 0x91, 0xba, 0xe7, 0x87, 0x52, 0x98, 0x51, 0xcc, 0x25, 0xd7, 0x8f, 0x94, 0x88, + 0x9c, 0xd6, 0xa5, 0xeb, 0x4b, 0x2f, 0x71, 0xcc, 0x11, 0x0f, 0x2c, 0x97, 0xbb, 0xdc, 0x52, 0x75, + 0x27, 0x99, 0x28, 0xa5, 0x84, 0x7a, 0xe5, 0x73, 0xad, 0xdb, 0xfd, 0xf6, 0x98, 0x4e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7e, 0xcf, 0x00, 0x7f, 0x66, 0x80, 0x97, 0x19, 0xe0, 0x55, 0x06, 0xf8, 0x3b, + 0x03, 0xfc, 0x93, 0x01, 0xda, 0x66, 0x80, 0x3f, 0x36, 0x80, 0x56, 0x1b, 0x40, 0xeb, 0x0d, 0xa0, + 0xe7, 0xf2, 0xc4, 0x9d, 0x43, 0x75, 0x7b, 0xd7, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xe1, 0x13, + 0x56, 0x30, 0x01, 0x03, 0x00, 0x00, } func (this *SeriesRequestHints) Equal(that interface{}) bool { diff --git a/pkg/storegateway/hintspb/hints.proto b/pkg/storegateway/hintspb/hints.proto index e3fb1c5bc55..032b5f5a373 100644 --- a/pkg/storegateway/hintspb/hints.proto +++ b/pkg/storegateway/hintspb/hints.proto @@ -6,7 +6,7 @@ syntax = "proto3"; package hintspb; -import "gogoproto/gogo.proto"; +import "github.com/gogo/protobuf/gogoproto/gogo.proto"; import "github.com/grafana/mimir/pkg/storegateway/storepb/types.proto"; option go_package = "hintspb"; diff --git a/pkg/storegateway/labelpb/label.go b/pkg/storegateway/labelpb/label.go deleted file mode 100644 index 223fa193a6c..00000000000 --- a/pkg/storegateway/labelpb/label.go +++ /dev/null @@ -1,292 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-only -// Provenance-includes-location: https://github.com/thanos-io/thanos/blob/main/pkg/store/labelpb/label.go -// Provenance-includes-license: Apache-2.0 -// Provenance-includes-copyright: The Thanos Authors. - -// Package containing proto and JSON serializable Labels and ZLabels (no copy) structs used to -// identify series. This package expose no-copy converters to Prometheus labels.Labels. - -package labelpb - -import ( - "encoding/json" - "fmt" - "io" - "sort" - "strings" - "unsafe" - - "github.com/cespare/xxhash/v2" - "github.com/pkg/errors" - "github.com/prometheus/prometheus/model/labels" -) - -var ( - sep = []byte{'\xff'} -) - -func noAllocString(buf []byte) string { - return *(*string)(unsafe.Pointer(&buf)) -} - -// ZLabelsFromPromLabels converts Prometheus labels to slice of labelpb.ZLabel in type unsafe manner. -// It reuses the same memory. Caller should abort using passed labels.Labels. -func ZLabelsFromPromLabels(lset labels.Labels) []ZLabel { - return *(*[]ZLabel)(unsafe.Pointer(&lset)) -} - -// ZLabelsToPromLabels convert slice of labelpb.ZLabel to Prometheus labels in type unsafe manner. -// It reuses the same memory. Caller should abort using passed []ZLabel. -// NOTE: Use with care. ZLabels holds memory from the whole protobuf unmarshal, so the returned -// Prometheus Labels will hold this memory as well. -func ZLabelsToPromLabels(lset []ZLabel) labels.Labels { - return *(*labels.Labels)(unsafe.Pointer(&lset)) -} - -// ZLabel is a Label (also easily transformable to Prometheus labels.Labels) that can be unmarshalled from protobuf -// reusing the same memory address for string bytes. -// NOTE: While unmarshalling it uses exactly same bytes that were allocated for protobuf. This mean that *whole* protobuf -// bytes will be not GC-ed as long as ZLabels are referenced somewhere. Use it carefully, only for short living -// protobuf message processing. -type ZLabel Label - -func (m *ZLabel) MarshalTo(data []byte) (int, error) { - f := Label(*m) - return f.MarshalTo(data) -} - -func (m *ZLabel) MarshalToSizedBuffer(data []byte) (int, error) { - f := Label(*m) - return f.MarshalToSizedBuffer(data) -} - -// Unmarshal unmarshalls gRPC protobuf into ZLabel struct. ZLabel string is directly using bytes passed in `data`. -// To use it add (gogoproto.customtype) = "github.com/grafana/mimir/pkg/storegateway/labelpb.ZLabel" to proto field tag. -// NOTE: This exists in internal Google protobuf implementation, but not in open source one: https://news.ycombinator.com/item?id=23588882 -func (m *ZLabel) 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 ErrIntOverflowTypes - } - 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: ZLabel: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ZLabel: 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 ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = noAllocString(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 ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Value = noAllocString(data[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(data[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *ZLabel) UnmarshalJSON(entry []byte) error { - f := Label(*m) - if err := json.Unmarshal(entry, &f); err != nil { - return errors.Wrapf(err, "labels: label field unmarshal: %v", string(entry)) - } - *m = ZLabel(f) - return nil -} - -func (m *ZLabel) Marshal() ([]byte, error) { - f := Label(*m) - return f.Marshal() -} - -func (m *ZLabel) MarshalJSON() ([]byte, error) { - return json.Marshal(Label(*m)) -} - -// Size implements proto.Sizer. -func (m *ZLabel) Size() (n int) { - f := Label(*m) - return f.Size() -} - -// Equal implements proto.Equaler. -func (m *ZLabel) Equal(other ZLabel) bool { - return m.Name == other.Name && m.Value == other.Value -} - -// Compare implements proto.Comparer. -func (m *ZLabel) Compare(other ZLabel) int { - if c := strings.Compare(m.Name, other.Name); c != 0 { - return c - } - return strings.Compare(m.Value, other.Value) -} - -func (m *ZLabelSet) UnmarshalJSON(entry []byte) error { - lbls := labels.Labels{} - if err := lbls.UnmarshalJSON(entry); err != nil { - return errors.Wrapf(err, "labels: labels field unmarshal: %v", string(entry)) - } - sort.Sort(lbls) - m.Labels = ZLabelsFromPromLabels(lbls) - return nil -} - -func (m *ZLabelSet) MarshalJSON() ([]byte, error) { - return m.PromLabels().MarshalJSON() -} - -// PromLabels return Prometheus labels.Labels without extra allocation. -func (m *ZLabelSet) PromLabels() labels.Labels { - return ZLabelsToPromLabels(m.Labels) -} - -// HashWithPrefix returns a hash for the given prefix and labels. -func HashWithPrefix(prefix string, lbls []ZLabel) uint64 { - // Use xxhash.Sum64(b) for fast path as it's faster. - b := make([]byte, 0, 1024) - b = append(b, prefix...) - b = append(b, sep[0]) - - for i, v := range lbls { - if len(b)+len(v.Name)+len(v.Value)+2 >= cap(b) { - // If labels entry is 1KB allocate do not allocate whole entry. - h := xxhash.New() - _, _ = h.Write(b) - for _, v := range lbls[i:] { - _, _ = h.WriteString(v.Name) - _, _ = h.Write(sep) - _, _ = h.WriteString(v.Value) - _, _ = h.Write(sep) - } - return h.Sum64() - } - b = append(b, v.Name...) - b = append(b, sep[0]) - b = append(b, v.Value...) - b = append(b, sep[0]) - } - return xxhash.Sum64(b) -} - -// ZLabelSets is a sortable list of ZLabelSet. It assumes the label pairs in each ZLabelSet element are already sorted. -type ZLabelSets []ZLabelSet - -func (z ZLabelSets) Len() int { return len(z) } - -func (z ZLabelSets) Swap(i, j int) { z[i], z[j] = z[j], z[i] } - -func (z ZLabelSets) Less(i, j int) bool { - l := 0 - r := 0 - var result int - lenI, lenJ := len(z[i].Labels), len(z[j].Labels) - for l < lenI && r < lenJ { - result = z[i].Labels[l].Compare(z[j].Labels[r]) - if result == 0 { - l++ - r++ - continue - } - return result < 0 - } - - return l == lenI -} diff --git a/pkg/storegateway/labelpb/types.pb.go b/pkg/storegateway/labelpb/types.pb.go deleted file mode 100644 index c37b0577c5f..00000000000 --- a/pkg/storegateway/labelpb/types.pb.go +++ /dev/null @@ -1,913 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: types.proto - -package labelpb - -import ( - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" - reflect "reflect" - strings "strings" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type Label struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (m *Label) Reset() { *m = Label{} } -func (*Label) ProtoMessage() {} -func (*Label) Descriptor() ([]byte, []int) { - return fileDescriptor_d938547f84707355, []int{0} -} -func (m *Label) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Label) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Label.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 *Label) XXX_Merge(src proto.Message) { - xxx_messageInfo_Label.Merge(m, src) -} -func (m *Label) XXX_Size() int { - return m.Size() -} -func (m *Label) XXX_DiscardUnknown() { - xxx_messageInfo_Label.DiscardUnknown(m) -} - -var xxx_messageInfo_Label proto.InternalMessageInfo - -type LabelSet struct { - Labels []Label `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels"` -} - -func (m *LabelSet) Reset() { *m = LabelSet{} } -func (*LabelSet) ProtoMessage() {} -func (*LabelSet) Descriptor() ([]byte, []int) { - return fileDescriptor_d938547f84707355, []int{1} -} -func (m *LabelSet) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LabelSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LabelSet.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 *LabelSet) XXX_Merge(src proto.Message) { - xxx_messageInfo_LabelSet.Merge(m, src) -} -func (m *LabelSet) XXX_Size() int { - return m.Size() -} -func (m *LabelSet) XXX_DiscardUnknown() { - xxx_messageInfo_LabelSet.DiscardUnknown(m) -} - -var xxx_messageInfo_LabelSet proto.InternalMessageInfo - -type ZLabelSet struct { - Labels []ZLabel `protobuf:"bytes,1,rep,name=labels,proto3,customtype=ZLabel" json:"labels"` -} - -func (m *ZLabelSet) Reset() { *m = ZLabelSet{} } -func (*ZLabelSet) ProtoMessage() {} -func (*ZLabelSet) Descriptor() ([]byte, []int) { - return fileDescriptor_d938547f84707355, []int{2} -} -func (m *ZLabelSet) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ZLabelSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ZLabelSet.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 *ZLabelSet) XXX_Merge(src proto.Message) { - xxx_messageInfo_ZLabelSet.Merge(m, src) -} -func (m *ZLabelSet) XXX_Size() int { - return m.Size() -} -func (m *ZLabelSet) XXX_DiscardUnknown() { - xxx_messageInfo_ZLabelSet.DiscardUnknown(m) -} - -var xxx_messageInfo_ZLabelSet proto.InternalMessageInfo - -func init() { - proto.RegisterType((*Label)(nil), "thanos.Label") - proto.RegisterType((*LabelSet)(nil), "thanos.LabelSet") - proto.RegisterType((*ZLabelSet)(nil), "thanos.ZLabelSet") -} - -func init() { proto.RegisterFile("types.proto", fileDescriptor_d938547f84707355) } - -var fileDescriptor_d938547f84707355 = []byte{ - // 232 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x2e, 0xa9, 0x2c, 0x48, - 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x2b, 0xc9, 0x48, 0xcc, 0xcb, 0x2f, 0x96, - 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0x0b, 0xe9, 0x83, 0x58, 0x10, 0x59, 0x25, 0x43, 0x2e, 0x56, - 0x9f, 0xc4, 0xa4, 0xd4, 0x1c, 0x21, 0x21, 0x2e, 0x96, 0xbc, 0xc4, 0xdc, 0x54, 0x09, 0x46, 0x05, - 0x46, 0x0d, 0xce, 0x20, 0x30, 0x5b, 0x48, 0x84, 0x8b, 0xb5, 0x2c, 0x31, 0xa7, 0x34, 0x55, 0x82, - 0x09, 0x2c, 0x08, 0xe1, 0x28, 0x99, 0x73, 0x71, 0x80, 0xb5, 0x04, 0xa7, 0x96, 0x08, 0x69, 0x73, - 0xb1, 0xe5, 0x80, 0xd8, 0xc5, 0x12, 0x8c, 0x0a, 0xcc, 0x1a, 0xdc, 0x46, 0xbc, 0x7a, 0x10, 0xdb, - 0xf4, 0xc0, 0x2a, 0x9c, 0x58, 0x4e, 0xdc, 0x93, 0x67, 0x08, 0x82, 0x2a, 0x51, 0x72, 0xe2, 0xe2, - 0x8c, 0x82, 0xeb, 0x34, 0xc5, 0xaf, 0x93, 0x0f, 0xa4, 0xf3, 0xd6, 0x3d, 0x79, 0x36, 0x88, 0x0e, - 0x98, 0x19, 0x4e, 0x8e, 0x27, 0x1e, 0xca, 0x31, 0x5c, 0x78, 0x28, 0xc7, 0x70, 0xe3, 0xa1, 0x1c, - 0xc3, 0x87, 0x87, 0x72, 0x8c, 0x0d, 0x8f, 0xe4, 0x18, 0x57, 0x3c, 0x92, 0x63, 0x3c, 0xf1, 0x48, - 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x5f, 0x3c, 0x92, 0x63, 0xf8, 0xf0, - 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, 0x96, 0x63, 0x88, - 0x62, 0x07, 0x9b, 0x50, 0x90, 0x94, 0xc4, 0x06, 0xf6, 0xb9, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, - 0x1b, 0x46, 0xcf, 0xa2, 0x26, 0x01, 0x00, 0x00, -} - -func (this *Label) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Label) - if !ok { - that2, ok := that.(Label) - 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 *LabelSet) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*LabelSet) - if !ok { - that2, ok := that.(LabelSet) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if len(this.Labels) != len(that1.Labels) { - return false - } - for i := range this.Labels { - if !this.Labels[i].Equal(&that1.Labels[i]) { - return false - } - } - return true -} -func (this *ZLabelSet) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*ZLabelSet) - if !ok { - that2, ok := that.(ZLabelSet) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if len(this.Labels) != len(that1.Labels) { - return false - } - for i := range this.Labels { - if !this.Labels[i].Equal(that1.Labels[i]) { - return false - } - } - return true -} -func (this *Label) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&labelpb.Label{") - 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 *LabelSet) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&labelpb.LabelSet{") - if this.Labels != nil { - vs := make([]*Label, 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, "") -} -func (this *ZLabelSet) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 5) - s = append(s, "&labelpb.ZLabelSet{") - s = append(s, "Labels: "+fmt.Sprintf("%#v", this.Labels)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func valueToGoStringTypes(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 *Label) 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 *Label) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Label) 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 = encodeVarintTypes(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 = encodeVarintTypes(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *LabelSet) 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 *LabelSet) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LabelSet) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Labels) > 0 { - for iNdEx := len(m.Labels) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Labels[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *ZLabelSet) 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 *ZLabelSet) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ZLabelSet) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - 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 { - return 0, err - } - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { - offset -= sovTypes(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Label) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Value) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *LabelSet) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Labels) > 0 { - for _, e := range m.Labels { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - return n -} - -func (m *ZLabelSet) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Labels) > 0 { - for _, e := range m.Labels { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - return n -} - -func sovTypes(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozTypes(x uint64) (n int) { - return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *Label) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Label{`, - `Name:` + fmt.Sprintf("%v", this.Name) + `,`, - `Value:` + fmt.Sprintf("%v", this.Value) + `,`, - `}`, - }, "") - return s -} -func (this *LabelSet) String() string { - if this == nil { - return "nil" - } - repeatedStringForLabels := "[]Label{" - for _, f := range this.Labels { - repeatedStringForLabels += strings.Replace(strings.Replace(f.String(), "Label", "Label", 1), `&`, ``, 1) + "," - } - repeatedStringForLabels += "}" - s := strings.Join([]string{`&LabelSet{`, - `Labels:` + repeatedStringForLabels + `,`, - `}`, - }, "") - return s -} -func (this *ZLabelSet) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ZLabelSet{`, - `Labels:` + fmt.Sprintf("%v", this.Labels) + `,`, - `}`, - }, "") - return s -} -func valueToStringTypes(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *Label) 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 ErrIntOverflowTypes - } - 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: Label: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Label: 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 ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(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 ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Value = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *LabelSet) 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 ErrIntOverflowTypes - } - 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: LabelSet: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LabelSet: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Labels = append(m.Labels, Label{}) - if err := m.Labels[len(m.Labels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ZLabelSet) 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 ErrIntOverflowTypes - } - 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: ZLabelSet: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ZLabelSet: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Labels = append(m.Labels, ZLabel{}) - if err := m.Labels[len(m.Labels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipTypes(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, ErrIntOverflowTypes - } - 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, ErrIntOverflowTypes - } - 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, ErrIntOverflowTypes - } - 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, ErrInvalidLengthTypes - } - iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthTypes - } - return iNdEx, nil - case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTypes - } - 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 := skipTypes(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthTypes - } - } - 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 ( - ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") -) diff --git a/pkg/storegateway/labelpb/types.proto b/pkg/storegateway/labelpb/types.proto deleted file mode 100644 index 68939fdf547..00000000000 --- a/pkg/storegateway/labelpb/types.proto +++ /dev/null @@ -1,35 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-only -// Provenance-includes-location: https://github.com/thanos-io/thanos/blob/main/pkg/store/labelpb/types.proto -// Provenance-includes-license: Apache-2.0 -// Provenance-includes-copyright: The Thanos Authors. - -syntax = "proto3"; -package thanos; - -option go_package = "labelpb"; - -import "gogoproto/gogo.proto"; - -option (gogoproto.sizer_all) = true; -option (gogoproto.marshaler_all) = true; -option (gogoproto.unmarshaler_all) = true; -option (gogoproto.goproto_getters_all) = false; - -// Do not generate XXX fields to reduce memory footprint and opening a door -// for zero-copy casts to/from prometheus data types. -option (gogoproto.goproto_unkeyed_all) = false; -option (gogoproto.goproto_unrecognized_all) = false; -option (gogoproto.goproto_sizecache_all) = false; - -message Label { - string name = 1; - string value = 2; -} - -message LabelSet { - repeated Label labels = 1 [(gogoproto.nullable) = false]; -} - -message ZLabelSet { - repeated Label labels = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "ZLabel"]; -} diff --git a/pkg/storegateway/prompb/types.pb.go b/pkg/storegateway/prompb/types.pb.go deleted file mode 100644 index 1b7a984007c..00000000000 --- a/pkg/storegateway/prompb/types.pb.go +++ /dev/null @@ -1,3099 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: types.proto - -package prompb - -import ( - bytes "bytes" - encoding_binary "encoding/binary" - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - _ "github.com/grafana/mimir/pkg/storegateway/labelpb" - github_com_grafana_mimir_pkg_storegateway_labelpb "github.com/grafana/mimir/pkg/storegateway/labelpb" - io "io" - math "math" - math_bits "math/bits" - reflect "reflect" - strconv "strconv" - strings "strings" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type MetricMetadata_MetricType int32 - -const ( - MetricType_UNKNOWN MetricMetadata_MetricType = 0 - MetricType_COUNTER MetricMetadata_MetricType = 1 - MetricType_GAUGE MetricMetadata_MetricType = 2 - MetricType_HISTOGRAM MetricMetadata_MetricType = 3 - MetricType_GAUGEHISTOGRAM MetricMetadata_MetricType = 4 - MetricType_SUMMARY MetricMetadata_MetricType = 5 - MetricType_INFO MetricMetadata_MetricType = 6 - MetricType_STATESET MetricMetadata_MetricType = 7 -) - -var MetricMetadata_MetricType_name = map[int32]string{ - 0: "MetricType_UNKNOWN", - 1: "MetricType_COUNTER", - 2: "MetricType_GAUGE", - 3: "MetricType_HISTOGRAM", - 4: "MetricType_GAUGEHISTOGRAM", - 5: "MetricType_SUMMARY", - 6: "MetricType_INFO", - 7: "MetricType_STATESET", -} - -var MetricMetadata_MetricType_value = map[string]int32{ - "MetricType_UNKNOWN": 0, - "MetricType_COUNTER": 1, - "MetricType_GAUGE": 2, - "MetricType_HISTOGRAM": 3, - "MetricType_GAUGEHISTOGRAM": 4, - "MetricType_SUMMARY": 5, - "MetricType_INFO": 6, - "MetricType_STATESET": 7, -} - -func (MetricMetadata_MetricType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_d938547f84707355, []int{0, 0} -} - -type LabelMatcher_Type int32 - -const ( - LabelMatcher_EQ LabelMatcher_Type = 0 - LabelMatcher_NEQ LabelMatcher_Type = 1 - LabelMatcher_RE LabelMatcher_Type = 2 - LabelMatcher_NRE LabelMatcher_Type = 3 -) - -var LabelMatcher_Type_name = map[int32]string{ - 0: "LabelMatcher_EQ", - 1: "LabelMatcher_NEQ", - 2: "LabelMatcher_RE", - 3: "LabelMatcher_NRE", -} - -var LabelMatcher_Type_value = map[string]int32{ - "LabelMatcher_EQ": 0, - "LabelMatcher_NEQ": 1, - "LabelMatcher_RE": 2, - "LabelMatcher_NRE": 3, -} - -func (LabelMatcher_Type) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_d938547f84707355, []int{4, 0} -} - -// We require this to match chunkenc.Encoding. -type Chunk_Encoding int32 - -const ( - Chunk_UNKNOWN Chunk_Encoding = 0 - Chunk_XOR Chunk_Encoding = 1 -) - -var Chunk_Encoding_name = map[int32]string{ - 0: "Chunk_UNKNOWN", - 1: "Chunk_XOR", -} - -var Chunk_Encoding_value = map[string]int32{ - "Chunk_UNKNOWN": 0, - "Chunk_XOR": 1, -} - -func (Chunk_Encoding) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_d938547f84707355, []int{6, 0} -} - -type MetricMetadata struct { - // Represents the metric type, these match the set from Prometheus. - // Refer to pkg/textparse/interface.go for details. - Type MetricMetadata_MetricType `protobuf:"varint,1,opt,name=type,proto3,enum=prometheus_copy.MetricMetadata_MetricType" json:"type,omitempty"` - MetricFamilyName string `protobuf:"bytes,2,opt,name=metric_family_name,json=metricFamilyName,proto3" json:"metric_family_name,omitempty"` - Help string `protobuf:"bytes,4,opt,name=help,proto3" json:"help,omitempty"` - Unit string `protobuf:"bytes,5,opt,name=unit,proto3" json:"unit,omitempty"` -} - -func (m *MetricMetadata) Reset() { *m = MetricMetadata{} } -func (*MetricMetadata) ProtoMessage() {} -func (*MetricMetadata) Descriptor() ([]byte, []int) { - return fileDescriptor_d938547f84707355, []int{0} -} -func (m *MetricMetadata) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MetricMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MetricMetadata.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 *MetricMetadata) XXX_Merge(src proto.Message) { - xxx_messageInfo_MetricMetadata.Merge(m, src) -} -func (m *MetricMetadata) XXX_Size() int { - return m.Size() -} -func (m *MetricMetadata) XXX_DiscardUnknown() { - xxx_messageInfo_MetricMetadata.DiscardUnknown(m) -} - -var xxx_messageInfo_MetricMetadata proto.InternalMessageInfo - -func (m *MetricMetadata) GetType() MetricMetadata_MetricType { - if m != nil { - return m.Type - } - return MetricType_UNKNOWN -} - -func (m *MetricMetadata) GetMetricFamilyName() string { - if m != nil { - return m.MetricFamilyName - } - return "" -} - -func (m *MetricMetadata) GetHelp() string { - if m != nil { - return m.Help - } - return "" -} - -func (m *MetricMetadata) GetUnit() string { - if m != nil { - return m.Unit - } - return "" -} - -type Sample struct { - Value float64 `protobuf:"fixed64,1,opt,name=value,proto3" json:"value,omitempty"` - Timestamp int64 `protobuf:"varint,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` -} - -func (m *Sample) Reset() { *m = Sample{} } -func (*Sample) ProtoMessage() {} -func (*Sample) Descriptor() ([]byte, []int) { - return fileDescriptor_d938547f84707355, []int{1} -} -func (m *Sample) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Sample) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Sample.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 *Sample) XXX_Merge(src proto.Message) { - xxx_messageInfo_Sample.Merge(m, src) -} -func (m *Sample) XXX_Size() int { - return m.Size() -} -func (m *Sample) XXX_DiscardUnknown() { - xxx_messageInfo_Sample.DiscardUnknown(m) -} - -var xxx_messageInfo_Sample proto.InternalMessageInfo - -func (m *Sample) GetValue() float64 { - if m != nil { - return m.Value - } - return 0 -} - -func (m *Sample) GetTimestamp() int64 { - if m != nil { - return m.Timestamp - } - return 0 -} - -type Exemplar struct { - // Optional, can be empty. - Labels []github_com_grafana_mimir_pkg_storegateway_labelpb.ZLabel `protobuf:"bytes,1,rep,name=labels,proto3,customtype=github.com/grafana/mimir/pkg/storegateway/labelpb.ZLabel" json:"labels"` - Value float64 `protobuf:"fixed64,2,opt,name=value,proto3" json:"value,omitempty"` - // timestamp is in ms format, see pkg/timestamp/timestamp.go for - // conversion from time.Time to Prometheus timestamp. - Timestamp int64 `protobuf:"varint,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` -} - -func (m *Exemplar) Reset() { *m = Exemplar{} } -func (*Exemplar) ProtoMessage() {} -func (*Exemplar) Descriptor() ([]byte, []int) { - return fileDescriptor_d938547f84707355, []int{2} -} -func (m *Exemplar) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Exemplar) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Exemplar.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 *Exemplar) XXX_Merge(src proto.Message) { - xxx_messageInfo_Exemplar.Merge(m, src) -} -func (m *Exemplar) XXX_Size() int { - return m.Size() -} -func (m *Exemplar) XXX_DiscardUnknown() { - xxx_messageInfo_Exemplar.DiscardUnknown(m) -} - -var xxx_messageInfo_Exemplar proto.InternalMessageInfo - -func (m *Exemplar) GetValue() float64 { - if m != nil { - return m.Value - } - return 0 -} - -func (m *Exemplar) GetTimestamp() int64 { - if m != nil { - return m.Timestamp - } - return 0 -} - -// TimeSeries represents samples and labels for a single time series. -type TimeSeries struct { - // Labels have to be sorted by label names and without duplicated label names. - // TODO(bwplotka): Don't use zero copy ZLabels, see https://github.com/thanos-io/thanos/pull/3279 for details. - Labels []github_com_grafana_mimir_pkg_storegateway_labelpb.ZLabel `protobuf:"bytes,1,rep,name=labels,proto3,customtype=github.com/grafana/mimir/pkg/storegateway/labelpb.ZLabel" json:"labels"` - Samples []Sample `protobuf:"bytes,2,rep,name=samples,proto3" json:"samples"` - Exemplars []Exemplar `protobuf:"bytes,3,rep,name=exemplars,proto3" json:"exemplars"` -} - -func (m *TimeSeries) Reset() { *m = TimeSeries{} } -func (*TimeSeries) ProtoMessage() {} -func (*TimeSeries) Descriptor() ([]byte, []int) { - return fileDescriptor_d938547f84707355, []int{3} -} -func (m *TimeSeries) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TimeSeries) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TimeSeries.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 *TimeSeries) XXX_Merge(src proto.Message) { - xxx_messageInfo_TimeSeries.Merge(m, src) -} -func (m *TimeSeries) XXX_Size() int { - return m.Size() -} -func (m *TimeSeries) XXX_DiscardUnknown() { - xxx_messageInfo_TimeSeries.DiscardUnknown(m) -} - -var xxx_messageInfo_TimeSeries proto.InternalMessageInfo - -func (m *TimeSeries) GetSamples() []Sample { - if m != nil { - return m.Samples - } - return nil -} - -func (m *TimeSeries) GetExemplars() []Exemplar { - if m != nil { - return m.Exemplars - } - return nil -} - -// Matcher specifies a rule, which can match or set of labels or not. -type LabelMatcher struct { - Type LabelMatcher_Type `protobuf:"varint,1,opt,name=type,proto3,enum=prometheus_copy.LabelMatcher_Type" json:"type,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` -} - -func (m *LabelMatcher) Reset() { *m = LabelMatcher{} } -func (*LabelMatcher) ProtoMessage() {} -func (*LabelMatcher) Descriptor() ([]byte, []int) { - return fileDescriptor_d938547f84707355, []int{4} -} -func (m *LabelMatcher) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LabelMatcher) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LabelMatcher.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 *LabelMatcher) XXX_Merge(src proto.Message) { - xxx_messageInfo_LabelMatcher.Merge(m, src) -} -func (m *LabelMatcher) XXX_Size() int { - return m.Size() -} -func (m *LabelMatcher) XXX_DiscardUnknown() { - xxx_messageInfo_LabelMatcher.DiscardUnknown(m) -} - -var xxx_messageInfo_LabelMatcher proto.InternalMessageInfo - -func (m *LabelMatcher) GetType() LabelMatcher_Type { - if m != nil { - return m.Type - } - return LabelMatcher_EQ -} - -func (m *LabelMatcher) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *LabelMatcher) GetValue() string { - if m != nil { - return m.Value - } - return "" -} - -type ReadHints struct { - StepMs int64 `protobuf:"varint,1,opt,name=step_ms,json=stepMs,proto3" json:"step_ms,omitempty"` - Func string `protobuf:"bytes,2,opt,name=func,proto3" json:"func,omitempty"` - StartMs int64 `protobuf:"varint,3,opt,name=start_ms,json=startMs,proto3" json:"start_ms,omitempty"` - EndMs int64 `protobuf:"varint,4,opt,name=end_ms,json=endMs,proto3" json:"end_ms,omitempty"` - Grouping []string `protobuf:"bytes,5,rep,name=grouping,proto3" json:"grouping,omitempty"` - By bool `protobuf:"varint,6,opt,name=by,proto3" json:"by,omitempty"` - RangeMs int64 `protobuf:"varint,7,opt,name=range_ms,json=rangeMs,proto3" json:"range_ms,omitempty"` -} - -func (m *ReadHints) Reset() { *m = ReadHints{} } -func (*ReadHints) ProtoMessage() {} -func (*ReadHints) Descriptor() ([]byte, []int) { - return fileDescriptor_d938547f84707355, []int{5} -} -func (m *ReadHints) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ReadHints) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ReadHints.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 *ReadHints) XXX_Merge(src proto.Message) { - xxx_messageInfo_ReadHints.Merge(m, src) -} -func (m *ReadHints) XXX_Size() int { - return m.Size() -} -func (m *ReadHints) XXX_DiscardUnknown() { - xxx_messageInfo_ReadHints.DiscardUnknown(m) -} - -var xxx_messageInfo_ReadHints proto.InternalMessageInfo - -func (m *ReadHints) GetStepMs() int64 { - if m != nil { - return m.StepMs - } - return 0 -} - -func (m *ReadHints) GetFunc() string { - if m != nil { - return m.Func - } - return "" -} - -func (m *ReadHints) GetStartMs() int64 { - if m != nil { - return m.StartMs - } - return 0 -} - -func (m *ReadHints) GetEndMs() int64 { - if m != nil { - return m.EndMs - } - return 0 -} - -func (m *ReadHints) GetGrouping() []string { - if m != nil { - return m.Grouping - } - return nil -} - -func (m *ReadHints) GetBy() bool { - if m != nil { - return m.By - } - return false -} - -func (m *ReadHints) GetRangeMs() int64 { - if m != nil { - return m.RangeMs - } - return 0 -} - -// Chunk represents a TSDB chunk. -// Time range [min, max] is inclusive. -type Chunk struct { - MinTimeMs int64 `protobuf:"varint,1,opt,name=min_time_ms,json=minTimeMs,proto3" json:"min_time_ms,omitempty"` - MaxTimeMs int64 `protobuf:"varint,2,opt,name=max_time_ms,json=maxTimeMs,proto3" json:"max_time_ms,omitempty"` - Type Chunk_Encoding `protobuf:"varint,3,opt,name=type,proto3,enum=prometheus_copy.Chunk_Encoding" json:"type,omitempty"` - Data []byte `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"` -} - -func (m *Chunk) Reset() { *m = Chunk{} } -func (*Chunk) ProtoMessage() {} -func (*Chunk) Descriptor() ([]byte, []int) { - return fileDescriptor_d938547f84707355, []int{6} -} -func (m *Chunk) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Chunk) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Chunk.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 *Chunk) XXX_Merge(src proto.Message) { - xxx_messageInfo_Chunk.Merge(m, src) -} -func (m *Chunk) XXX_Size() int { - return m.Size() -} -func (m *Chunk) XXX_DiscardUnknown() { - xxx_messageInfo_Chunk.DiscardUnknown(m) -} - -var xxx_messageInfo_Chunk proto.InternalMessageInfo - -func (m *Chunk) GetMinTimeMs() int64 { - if m != nil { - return m.MinTimeMs - } - return 0 -} - -func (m *Chunk) GetMaxTimeMs() int64 { - if m != nil { - return m.MaxTimeMs - } - return 0 -} - -func (m *Chunk) GetType() Chunk_Encoding { - if m != nil { - return m.Type - } - return Chunk_UNKNOWN -} - -func (m *Chunk) GetData() []byte { - if m != nil { - return m.Data - } - return nil -} - -// ChunkedSeries represents single, encoded time series. -type ChunkedSeries struct { - // Labels should be sorted. - Labels []github_com_grafana_mimir_pkg_storegateway_labelpb.ZLabel `protobuf:"bytes,1,rep,name=labels,proto3,customtype=github.com/grafana/mimir/pkg/storegateway/labelpb.ZLabel" json:"labels"` - // Chunks will be in start time order and may overlap. - Chunks []Chunk `protobuf:"bytes,2,rep,name=chunks,proto3" json:"chunks"` -} - -func (m *ChunkedSeries) Reset() { *m = ChunkedSeries{} } -func (*ChunkedSeries) ProtoMessage() {} -func (*ChunkedSeries) Descriptor() ([]byte, []int) { - return fileDescriptor_d938547f84707355, []int{7} -} -func (m *ChunkedSeries) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ChunkedSeries) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ChunkedSeries.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 *ChunkedSeries) XXX_Merge(src proto.Message) { - xxx_messageInfo_ChunkedSeries.Merge(m, src) -} -func (m *ChunkedSeries) XXX_Size() int { - return m.Size() -} -func (m *ChunkedSeries) XXX_DiscardUnknown() { - xxx_messageInfo_ChunkedSeries.DiscardUnknown(m) -} - -var xxx_messageInfo_ChunkedSeries proto.InternalMessageInfo - -func (m *ChunkedSeries) GetChunks() []Chunk { - if m != nil { - return m.Chunks - } - return nil -} - -func init() { - proto.RegisterEnum("prometheus_copy.MetricMetadata_MetricType", MetricMetadata_MetricType_name, MetricMetadata_MetricType_value) - proto.RegisterEnum("prometheus_copy.LabelMatcher_Type", LabelMatcher_Type_name, LabelMatcher_Type_value) - proto.RegisterEnum("prometheus_copy.Chunk_Encoding", Chunk_Encoding_name, Chunk_Encoding_value) - proto.RegisterType((*MetricMetadata)(nil), "prometheus_copy.MetricMetadata") - proto.RegisterType((*Sample)(nil), "prometheus_copy.Sample") - proto.RegisterType((*Exemplar)(nil), "prometheus_copy.Exemplar") - proto.RegisterType((*TimeSeries)(nil), "prometheus_copy.TimeSeries") - proto.RegisterType((*LabelMatcher)(nil), "prometheus_copy.LabelMatcher") - proto.RegisterType((*ReadHints)(nil), "prometheus_copy.ReadHints") - proto.RegisterType((*Chunk)(nil), "prometheus_copy.Chunk") - proto.RegisterType((*ChunkedSeries)(nil), "prometheus_copy.ChunkedSeries") -} - -func init() { proto.RegisterFile("types.proto", fileDescriptor_d938547f84707355) } - -var fileDescriptor_d938547f84707355 = []byte{ - // 859 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x55, 0x4f, 0x6f, 0x1b, 0x45, - 0x14, 0xf7, 0x78, 0xed, 0xb5, 0xfd, 0xd2, 0x24, 0xcb, 0x24, 0x34, 0x9b, 0x08, 0x36, 0xd6, 0x9e, -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x7d, 0xd5, 0x75, 0x35, 0x64, 0xfe, 0x8c, 0x32, 0x0a, 0x1d, 0xdf, - 0xf4, 0xe1, 0x7c, 0x08, 0xea, 0x48, 0x64, 0x5e, 0xde, 0xcd, 0xed, 0xff, 0x7e, 0x73, 0xb6, 0xf9, - 0x19, 0xf7, 0xf8, 0xfe, 0xc5, 0xa5, 0x51, 0x7a, 0x79, 0x69, 0x94, 0x5e, 0x5f, 0x1a, 0xe8, 0xfb, - 0x85, 0x81, 0x7e, 0x5a, 0x18, 0xe8, 0xc5, 0xc2, 0x40, 0x17, 0x0b, 0x03, 0xfd, 0xb9, 0x30, 0xd0, - 0x5f, 0x0b, 0xa3, 0xf4, 0x7a, 0x61, 0xa0, 0x1f, 0xae, 0x8c, 0xd2, 0xc5, 0x95, 0x51, 0x7a, 0x79, - 0x65, 0x94, 0x9e, 0xa9, 0x22, 0x74, 0x3c, 0x1c, 0xaa, 0xf2, 0x87, 0x74, 0xef, 0xdf, 0x00, 0x00, - 0x00, 0xff, 0xff, 0x54, 0x2b, 0xb6, 0x83, 0x05, 0x07, 0x00, 0x00, -} - -func (x MetricMetadata_MetricType) String() string { - s, ok := MetricMetadata_MetricType_name[int32(x)] - if ok { - return s - } - return strconv.Itoa(int(x)) -} -func (x LabelMatcher_Type) String() string { - s, ok := LabelMatcher_Type_name[int32(x)] - if ok { - return s - } - return strconv.Itoa(int(x)) -} -func (x Chunk_Encoding) String() string { - s, ok := Chunk_Encoding_name[int32(x)] - if ok { - return s - } - return strconv.Itoa(int(x)) -} -func (this *MetricMetadata) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*MetricMetadata) - if !ok { - that2, ok := that.(MetricMetadata) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Type != that1.Type { - return false - } - if this.MetricFamilyName != that1.MetricFamilyName { - return false - } - if this.Help != that1.Help { - return false - } - if this.Unit != that1.Unit { - return false - } - return true -} -func (this *Sample) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Sample) - if !ok { - that2, ok := that.(Sample) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Value != that1.Value { - return false - } - if this.Timestamp != that1.Timestamp { - return false - } - return true -} -func (this *Exemplar) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Exemplar) - if !ok { - that2, ok := that.(Exemplar) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if len(this.Labels) != len(that1.Labels) { - return false - } - for i := range this.Labels { - if !this.Labels[i].Equal(that1.Labels[i]) { - return false - } - } - if this.Value != that1.Value { - return false - } - if this.Timestamp != that1.Timestamp { - return false - } - return true -} -func (this *TimeSeries) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*TimeSeries) - if !ok { - that2, ok := that.(TimeSeries) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if len(this.Labels) != len(that1.Labels) { - return false - } - for i := range this.Labels { - if !this.Labels[i].Equal(that1.Labels[i]) { - return false - } - } - if len(this.Samples) != len(that1.Samples) { - return false - } - for i := range this.Samples { - if !this.Samples[i].Equal(&that1.Samples[i]) { - return false - } - } - if len(this.Exemplars) != len(that1.Exemplars) { - return false - } - for i := range this.Exemplars { - if !this.Exemplars[i].Equal(&that1.Exemplars[i]) { - return false - } - } - return true -} -func (this *LabelMatcher) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*LabelMatcher) - if !ok { - that2, ok := that.(LabelMatcher) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Type != that1.Type { - return false - } - if this.Name != that1.Name { - return false - } - if this.Value != that1.Value { - return false - } - return true -} -func (this *ReadHints) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*ReadHints) - if !ok { - that2, ok := that.(ReadHints) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.StepMs != that1.StepMs { - return false - } - if this.Func != that1.Func { - return false - } - if this.StartMs != that1.StartMs { - return false - } - if this.EndMs != that1.EndMs { - return false - } - if len(this.Grouping) != len(that1.Grouping) { - return false - } - for i := range this.Grouping { - if this.Grouping[i] != that1.Grouping[i] { - return false - } - } - if this.By != that1.By { - return false - } - if this.RangeMs != that1.RangeMs { - return false - } - return true -} -func (this *Chunk) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Chunk) - if !ok { - that2, ok := that.(Chunk) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.MinTimeMs != that1.MinTimeMs { - return false - } - if this.MaxTimeMs != that1.MaxTimeMs { - return false - } - if this.Type != that1.Type { - return false - } - if !bytes.Equal(this.Data, that1.Data) { - return false - } - return true -} -func (this *ChunkedSeries) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*ChunkedSeries) - if !ok { - that2, ok := that.(ChunkedSeries) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if len(this.Labels) != len(that1.Labels) { - return false - } - for i := range this.Labels { - if !this.Labels[i].Equal(that1.Labels[i]) { - return false - } - } - if len(this.Chunks) != len(that1.Chunks) { - return false - } - for i := range this.Chunks { - if !this.Chunks[i].Equal(&that1.Chunks[i]) { - return false - } - } - return true -} -func (this *MetricMetadata) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 8) - s = append(s, "&prompb.MetricMetadata{") - s = append(s, "Type: "+fmt.Sprintf("%#v", this.Type)+",\n") - s = append(s, "MetricFamilyName: "+fmt.Sprintf("%#v", this.MetricFamilyName)+",\n") - s = append(s, "Help: "+fmt.Sprintf("%#v", this.Help)+",\n") - s = append(s, "Unit: "+fmt.Sprintf("%#v", this.Unit)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Sample) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&prompb.Sample{") - s = append(s, "Value: "+fmt.Sprintf("%#v", this.Value)+",\n") - s = append(s, "Timestamp: "+fmt.Sprintf("%#v", this.Timestamp)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Exemplar) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 7) - s = append(s, "&prompb.Exemplar{") - s = append(s, "Labels: "+fmt.Sprintf("%#v", this.Labels)+",\n") - s = append(s, "Value: "+fmt.Sprintf("%#v", this.Value)+",\n") - s = append(s, "Timestamp: "+fmt.Sprintf("%#v", this.Timestamp)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *TimeSeries) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 7) - s = append(s, "&prompb.TimeSeries{") - s = append(s, "Labels: "+fmt.Sprintf("%#v", this.Labels)+",\n") - if this.Samples != nil { - vs := make([]*Sample, len(this.Samples)) - for i := range vs { - vs[i] = &this.Samples[i] - } - s = append(s, "Samples: "+fmt.Sprintf("%#v", vs)+",\n") - } - if this.Exemplars != nil { - vs := make([]*Exemplar, len(this.Exemplars)) - for i := range vs { - vs[i] = &this.Exemplars[i] - } - s = append(s, "Exemplars: "+fmt.Sprintf("%#v", vs)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func (this *LabelMatcher) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 7) - s = append(s, "&prompb.LabelMatcher{") - s = append(s, "Type: "+fmt.Sprintf("%#v", this.Type)+",\n") - 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 *ReadHints) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 11) - s = append(s, "&prompb.ReadHints{") - s = append(s, "StepMs: "+fmt.Sprintf("%#v", this.StepMs)+",\n") - s = append(s, "Func: "+fmt.Sprintf("%#v", this.Func)+",\n") - s = append(s, "StartMs: "+fmt.Sprintf("%#v", this.StartMs)+",\n") - s = append(s, "EndMs: "+fmt.Sprintf("%#v", this.EndMs)+",\n") - s = append(s, "Grouping: "+fmt.Sprintf("%#v", this.Grouping)+",\n") - s = append(s, "By: "+fmt.Sprintf("%#v", this.By)+",\n") - s = append(s, "RangeMs: "+fmt.Sprintf("%#v", this.RangeMs)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Chunk) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 8) - s = append(s, "&prompb.Chunk{") - s = append(s, "MinTimeMs: "+fmt.Sprintf("%#v", this.MinTimeMs)+",\n") - s = append(s, "MaxTimeMs: "+fmt.Sprintf("%#v", this.MaxTimeMs)+",\n") - s = append(s, "Type: "+fmt.Sprintf("%#v", this.Type)+",\n") - s = append(s, "Data: "+fmt.Sprintf("%#v", this.Data)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *ChunkedSeries) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&prompb.ChunkedSeries{") - s = append(s, "Labels: "+fmt.Sprintf("%#v", this.Labels)+",\n") - if this.Chunks != nil { - vs := make([]*Chunk, len(this.Chunks)) - for i := range vs { - vs[i] = &this.Chunks[i] - } - s = append(s, "Chunks: "+fmt.Sprintf("%#v", vs)+",\n") - } - s = append(s, "}") - return strings.Join(s, "") -} -func valueToGoStringTypes(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 *MetricMetadata) 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 *MetricMetadata) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MetricMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Unit) > 0 { - i -= len(m.Unit) - copy(dAtA[i:], m.Unit) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Unit))) - i-- - dAtA[i] = 0x2a - } - if len(m.Help) > 0 { - i -= len(m.Help) - copy(dAtA[i:], m.Help) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Help))) - i-- - dAtA[i] = 0x22 - } - if len(m.MetricFamilyName) > 0 { - i -= len(m.MetricFamilyName) - copy(dAtA[i:], m.MetricFamilyName) - i = encodeVarintTypes(dAtA, i, uint64(len(m.MetricFamilyName))) - i-- - dAtA[i] = 0x12 - } - if m.Type != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Type)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Sample) 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 *Sample) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Sample) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Timestamp != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Timestamp)) - i-- - dAtA[i] = 0x10 - } - if m.Value != 0 { - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Value)))) - i-- - dAtA[i] = 0x9 - } - return len(dAtA) - i, nil -} - -func (m *Exemplar) 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 *Exemplar) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Exemplar) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Timestamp != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Timestamp)) - i-- - dAtA[i] = 0x18 - } - if m.Value != 0 { - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Value)))) - i-- - dAtA[i] = 0x11 - } - 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 { - return 0, err - } - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *TimeSeries) 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 *TimeSeries) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TimeSeries) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Exemplars) > 0 { - for iNdEx := len(m.Exemplars) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Exemplars[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if len(m.Samples) > 0 { - for iNdEx := len(m.Samples) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Samples[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - 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 { - return 0, err - } - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *LabelMatcher) 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 *LabelMatcher) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LabelMatcher) 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 = encodeVarintTypes(dAtA, i, uint64(len(m.Value))) - i-- - dAtA[i] = 0x1a - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x12 - } - if m.Type != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Type)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *ReadHints) 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 *ReadHints) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ReadHints) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.RangeMs != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.RangeMs)) - i-- - dAtA[i] = 0x38 - } - if m.By { - i-- - if m.By { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x30 - } - if len(m.Grouping) > 0 { - for iNdEx := len(m.Grouping) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Grouping[iNdEx]) - copy(dAtA[i:], m.Grouping[iNdEx]) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Grouping[iNdEx]))) - i-- - dAtA[i] = 0x2a - } - } - if m.EndMs != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.EndMs)) - i-- - dAtA[i] = 0x20 - } - if m.StartMs != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.StartMs)) - i-- - dAtA[i] = 0x18 - } - if len(m.Func) > 0 { - i -= len(m.Func) - copy(dAtA[i:], m.Func) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Func))) - i-- - dAtA[i] = 0x12 - } - if m.StepMs != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.StepMs)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Chunk) 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 *Chunk) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Chunk) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Data) > 0 { - i -= len(m.Data) - copy(dAtA[i:], m.Data) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Data))) - i-- - dAtA[i] = 0x22 - } - if m.Type != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Type)) - i-- - dAtA[i] = 0x18 - } - if m.MaxTimeMs != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.MaxTimeMs)) - i-- - dAtA[i] = 0x10 - } - if m.MinTimeMs != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.MinTimeMs)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *ChunkedSeries) 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 *ChunkedSeries) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ChunkedSeries) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Chunks) > 0 { - for iNdEx := len(m.Chunks) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Chunks[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - 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 { - return 0, err - } - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { - offset -= sovTypes(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *MetricMetadata) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Type != 0 { - n += 1 + sovTypes(uint64(m.Type)) - } - l = len(m.MetricFamilyName) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Help) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Unit) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *Sample) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Value != 0 { - n += 9 - } - if m.Timestamp != 0 { - n += 1 + sovTypes(uint64(m.Timestamp)) - } - return n -} - -func (m *Exemplar) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Labels) > 0 { - for _, e := range m.Labels { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - if m.Value != 0 { - n += 9 - } - if m.Timestamp != 0 { - n += 1 + sovTypes(uint64(m.Timestamp)) - } - return n -} - -func (m *TimeSeries) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Labels) > 0 { - for _, e := range m.Labels { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - if len(m.Samples) > 0 { - for _, e := range m.Samples { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - if len(m.Exemplars) > 0 { - for _, e := range m.Exemplars { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - return n -} - -func (m *LabelMatcher) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Type != 0 { - n += 1 + sovTypes(uint64(m.Type)) - } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Value) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *ReadHints) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.StepMs != 0 { - n += 1 + sovTypes(uint64(m.StepMs)) - } - l = len(m.Func) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.StartMs != 0 { - n += 1 + sovTypes(uint64(m.StartMs)) - } - if m.EndMs != 0 { - n += 1 + sovTypes(uint64(m.EndMs)) - } - if len(m.Grouping) > 0 { - for _, s := range m.Grouping { - l = len(s) - n += 1 + l + sovTypes(uint64(l)) - } - } - if m.By { - n += 2 - } - if m.RangeMs != 0 { - n += 1 + sovTypes(uint64(m.RangeMs)) - } - return n -} - -func (m *Chunk) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.MinTimeMs != 0 { - n += 1 + sovTypes(uint64(m.MinTimeMs)) - } - if m.MaxTimeMs != 0 { - n += 1 + sovTypes(uint64(m.MaxTimeMs)) - } - if m.Type != 0 { - n += 1 + sovTypes(uint64(m.Type)) - } - l = len(m.Data) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *ChunkedSeries) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Labels) > 0 { - for _, e := range m.Labels { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - if len(m.Chunks) > 0 { - for _, e := range m.Chunks { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - return n -} - -func sovTypes(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozTypes(x uint64) (n int) { - return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *MetricMetadata) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&MetricMetadata{`, - `Type:` + fmt.Sprintf("%v", this.Type) + `,`, - `MetricFamilyName:` + fmt.Sprintf("%v", this.MetricFamilyName) + `,`, - `Help:` + fmt.Sprintf("%v", this.Help) + `,`, - `Unit:` + fmt.Sprintf("%v", this.Unit) + `,`, - `}`, - }, "") - return s -} -func (this *Sample) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Sample{`, - `Value:` + fmt.Sprintf("%v", this.Value) + `,`, - `Timestamp:` + fmt.Sprintf("%v", this.Timestamp) + `,`, - `}`, - }, "") - return s -} -func (this *Exemplar) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Exemplar{`, - `Labels:` + fmt.Sprintf("%v", this.Labels) + `,`, - `Value:` + fmt.Sprintf("%v", this.Value) + `,`, - `Timestamp:` + fmt.Sprintf("%v", this.Timestamp) + `,`, - `}`, - }, "") - return s -} -func (this *TimeSeries) String() string { - if this == nil { - return "nil" - } - repeatedStringForSamples := "[]Sample{" - for _, f := range this.Samples { - repeatedStringForSamples += strings.Replace(strings.Replace(f.String(), "Sample", "Sample", 1), `&`, ``, 1) + "," - } - repeatedStringForSamples += "}" - repeatedStringForExemplars := "[]Exemplar{" - for _, f := range this.Exemplars { - repeatedStringForExemplars += strings.Replace(strings.Replace(f.String(), "Exemplar", "Exemplar", 1), `&`, ``, 1) + "," - } - repeatedStringForExemplars += "}" - s := strings.Join([]string{`&TimeSeries{`, - `Labels:` + fmt.Sprintf("%v", this.Labels) + `,`, - `Samples:` + repeatedStringForSamples + `,`, - `Exemplars:` + repeatedStringForExemplars + `,`, - `}`, - }, "") - return s -} -func (this *LabelMatcher) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&LabelMatcher{`, - `Type:` + fmt.Sprintf("%v", this.Type) + `,`, - `Name:` + fmt.Sprintf("%v", this.Name) + `,`, - `Value:` + fmt.Sprintf("%v", this.Value) + `,`, - `}`, - }, "") - return s -} -func (this *ReadHints) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ReadHints{`, - `StepMs:` + fmt.Sprintf("%v", this.StepMs) + `,`, - `Func:` + fmt.Sprintf("%v", this.Func) + `,`, - `StartMs:` + fmt.Sprintf("%v", this.StartMs) + `,`, - `EndMs:` + fmt.Sprintf("%v", this.EndMs) + `,`, - `Grouping:` + fmt.Sprintf("%v", this.Grouping) + `,`, - `By:` + fmt.Sprintf("%v", this.By) + `,`, - `RangeMs:` + fmt.Sprintf("%v", this.RangeMs) + `,`, - `}`, - }, "") - return s -} -func (this *Chunk) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Chunk{`, - `MinTimeMs:` + fmt.Sprintf("%v", this.MinTimeMs) + `,`, - `MaxTimeMs:` + fmt.Sprintf("%v", this.MaxTimeMs) + `,`, - `Type:` + fmt.Sprintf("%v", this.Type) + `,`, - `Data:` + fmt.Sprintf("%v", this.Data) + `,`, - `}`, - }, "") - return s -} -func (this *ChunkedSeries) String() string { - if this == nil { - return "nil" - } - repeatedStringForChunks := "[]Chunk{" - for _, f := range this.Chunks { - repeatedStringForChunks += strings.Replace(strings.Replace(f.String(), "Chunk", "Chunk", 1), `&`, ``, 1) + "," - } - repeatedStringForChunks += "}" - s := strings.Join([]string{`&ChunkedSeries{`, - `Labels:` + fmt.Sprintf("%v", this.Labels) + `,`, - `Chunks:` + repeatedStringForChunks + `,`, - `}`, - }, "") - return s -} -func valueToStringTypes(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *MetricMetadata) 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 ErrIntOverflowTypes - } - 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: MetricMetadata: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MetricMetadata: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - m.Type = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Type |= MetricMetadata_MetricType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MetricFamilyName", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.MetricFamilyName = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Help", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Help = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Unit", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Unit = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthTypes - } - 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 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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: Sample: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Sample: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - m.Value = float64(math.Float64frombits(v)) - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) - } - m.Timestamp = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Timestamp |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Exemplar) 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 ErrIntOverflowTypes - } - 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: Exemplar: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Exemplar: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Labels = append(m.Labels, github_com_grafana_mimir_pkg_storegateway_labelpb.ZLabel{}) - if err := m.Labels[len(m.Labels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - m.Value = float64(math.Float64frombits(v)) - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) - } - m.Timestamp = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Timestamp |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TimeSeries) 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 ErrIntOverflowTypes - } - 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: TimeSeries: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TimeSeries: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Labels = append(m.Labels, github_com_grafana_mimir_pkg_storegateway_labelpb.ZLabel{}) - if err := m.Labels[len(m.Labels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Samples", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Samples = append(m.Samples, Sample{}) - if err := m.Samples[len(m.Samples)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Exemplars", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Exemplars = append(m.Exemplars, Exemplar{}) - if err := m.Exemplars[len(m.Exemplars)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *LabelMatcher) 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 ErrIntOverflowTypes - } - 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: LabelMatcher: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LabelMatcher: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - m.Type = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Type |= LabelMatcher_Type(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - 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 ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - 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 ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Value = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ReadHints) 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 ErrIntOverflowTypes - } - 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: ReadHints: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ReadHints: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StepMs", wireType) - } - m.StepMs = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.StepMs |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Func", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Func = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StartMs", wireType) - } - m.StartMs = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.StartMs |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field EndMs", wireType) - } - m.EndMs = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.EndMs |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Grouping", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Grouping = append(m.Grouping, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field By", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.By = bool(v != 0) - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field RangeMs", wireType) - } - m.RangeMs = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.RangeMs |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Chunk) 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 ErrIntOverflowTypes - } - 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: Chunk: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Chunk: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MinTimeMs", wireType) - } - m.MinTimeMs = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MinTimeMs |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxTimeMs", wireType) - } - m.MaxTimeMs = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MaxTimeMs |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - m.Type = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Type |= Chunk_Encoding(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) - if m.Data == nil { - m.Data = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ChunkedSeries) 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 ErrIntOverflowTypes - } - 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: ChunkedSeries: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ChunkedSeries: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Labels = append(m.Labels, github_com_grafana_mimir_pkg_storegateway_labelpb.ZLabel{}) - if err := m.Labels[len(m.Labels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Chunks", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Chunks = append(m.Chunks, Chunk{}) - if err := m.Chunks[len(m.Chunks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipTypes(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, ErrIntOverflowTypes - } - 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, ErrIntOverflowTypes - } - 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, ErrIntOverflowTypes - } - 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, ErrInvalidLengthTypes - } - iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthTypes - } - return iNdEx, nil - case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTypes - } - 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 := skipTypes(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthTypes - } - } - 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 ( - ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") -) diff --git a/pkg/storegateway/prompb/types.proto b/pkg/storegateway/prompb/types.proto deleted file mode 100644 index c13b46c2559..00000000000 --- a/pkg/storegateway/prompb/types.proto +++ /dev/null @@ -1,110 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-only -// Provenance-includes-location: https://github.com/thanos-io/thanos/blob/main/pkg/store/storepb/prompb/types.proto -// Provenance-includes-license: Apache-2.0 -// Provenance-includes-copyright: The Thanos Authors. -// Provenance-includes-location: https://github.com/prometheus/prometheus -// Provenance-includes-license: Apache-2.0 -// Provenance-includes-copyright: The Prometheus Authors. - -syntax = "proto3"; -package prometheus_copy; - -option go_package = "prompb"; - -import "gogoproto/gogo.proto"; -import "github.com/grafana/mimir/pkg/storegateway/labelpb/types.proto"; - -// Do not generate XXX fields to reduce memory footprint and opening a door -// for zero-copy casts to/from prometheus data types. -option (gogoproto.goproto_unkeyed_all) = false; -option (gogoproto.goproto_unrecognized_all) = false; -option (gogoproto.goproto_sizecache_all) = false; - -message MetricMetadata { - enum MetricType { - MetricType_UNKNOWN = 0; - MetricType_COUNTER = 1; - MetricType_GAUGE = 2; - MetricType_HISTOGRAM = 3; - MetricType_GAUGEHISTOGRAM = 4; - MetricType_SUMMARY = 5; - MetricType_INFO = 6; - MetricType_STATESET = 7; - } - - // Represents the metric type, these match the set from Prometheus. - // Refer to pkg/textparse/interface.go for details. - MetricType type = 1; - string metric_family_name = 2; - string help = 4; - string unit = 5; -} - -message Sample { - double value = 1; - int64 timestamp = 2; -} - -message Exemplar { - // Optional, can be empty. - repeated thanos.Label labels = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/grafana/mimir/pkg/storegateway/labelpb.ZLabel"]; - double value = 2; - // timestamp is in ms format, see pkg/timestamp/timestamp.go for - // conversion from time.Time to Prometheus timestamp. - int64 timestamp = 3; -} - -// TimeSeries represents samples and labels for a single time series. -message TimeSeries { - // Labels have to be sorted by label names and without duplicated label names. - // TODO(bwplotka): Don't use zero copy ZLabels, see https://github.com/thanos-io/thanos/pull/3279 for details. - repeated thanos.Label labels = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/grafana/mimir/pkg/storegateway/labelpb.ZLabel"]; - repeated Sample samples = 2 [(gogoproto.nullable) = false]; - repeated Exemplar exemplars = 3 [(gogoproto.nullable) = false]; -} - -// Matcher specifies a rule, which can match or set of labels or not. -message LabelMatcher { - enum Type { - LabelMatcher_EQ = 0; - LabelMatcher_NEQ = 1; - LabelMatcher_RE = 2; - LabelMatcher_NRE = 3; - } - Type type = 1; - string name = 2; - string value = 3; -} - -message ReadHints { - int64 step_ms = 1; // Query step size in milliseconds. - string func = 2; // String representation of surrounding function or aggregation. - int64 start_ms = 3; // Start time in milliseconds. - int64 end_ms = 4; // End time in milliseconds. - repeated string grouping = 5; // List of label names used in aggregation. - bool by = 6; // Indicate whether it is without or by. - int64 range_ms = 7; // Range vector selector range in milliseconds. -} - -// Chunk represents a TSDB chunk. -// Time range [min, max] is inclusive. -message Chunk { - int64 min_time_ms = 1; - int64 max_time_ms = 2; - - // We require this to match chunkenc.Encoding. - enum Encoding { - Chunk_UNKNOWN = 0; - Chunk_XOR = 1; - } - Encoding type = 3; - bytes data = 4; -} - -// ChunkedSeries represents single, encoded time series. -message ChunkedSeries { - // Labels should be sorted. - repeated thanos.Label labels = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/grafana/mimir/pkg/storegateway/labelpb.ZLabel"]; - // Chunks will be in start time order and may overlap. - repeated Chunk chunks = 2 [(gogoproto.nullable) = false]; -} diff --git a/pkg/storegateway/storepb/custom.go b/pkg/storegateway/storepb/custom.go index f0dca83f2e9..8e0c99f08fc 100644 --- a/pkg/storegateway/storepb/custom.go +++ b/pkg/storegateway/storepb/custom.go @@ -13,7 +13,7 @@ import ( "github.com/pkg/errors" "github.com/prometheus/prometheus/model/labels" - "github.com/grafana/mimir/pkg/storegateway/labelpb" + "github.com/grafana/mimir/pkg/mimirpb" ) func NewSeriesResponse(series *Series) *SeriesResponse { @@ -222,13 +222,13 @@ func (s *uniqueSeriesSet) Next() bool { } lset, chks := s.SeriesSet.At() if s.peek == nil { - s.peek = &Series{Labels: labelpb.ZLabelsFromPromLabels(lset), Chunks: chks} + s.peek = &Series{Labels: mimirpb.FromLabelsToLabelAdapters(lset), Chunks: chks} continue } if labels.Compare(lset, s.peek.PromLabels()) != 0 { s.lset, s.chunks = s.peek.PromLabels(), s.peek.Chunks - s.peek = &Series{Labels: labelpb.ZLabelsFromPromLabels(lset), Chunks: chks} + s.peek = &Series{Labels: mimirpb.FromLabelsToLabelAdapters(lset), Chunks: chks} return true } @@ -388,5 +388,5 @@ func (x LabelMatcher_Type) PromString() string { // PromLabels return Prometheus labels.Labels without extra allocation. func (m *Series) PromLabels() labels.Labels { - return labelpb.ZLabelsToPromLabels(m.Labels) + return mimirpb.FromLabelAdaptersToLabels(m.Labels) } diff --git a/pkg/storegateway/storepb/rpc.pb.go b/pkg/storegateway/storepb/rpc.pb.go index 2d606ff33ab..95fed075bb8 100644 --- a/pkg/storegateway/storepb/rpc.pb.go +++ b/pkg/storegateway/storepb/rpc.pb.go @@ -445,57 +445,58 @@ func init() { func init() { proto.RegisterFile("rpc.proto", fileDescriptor_77a6da22d6a3feb1) } var fileDescriptor_77a6da22d6a3feb1 = []byte{ - // 797 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x93, 0xcd, 0x6e, 0xeb, 0x44, - 0x14, 0xc7, 0x3d, 0xf1, 0x47, 0x9c, 0x93, 0x0f, 0xcd, 0x9d, 0xe6, 0x5e, 0xb9, 0x46, 0x72, 0xa3, - 0x48, 0x48, 0x51, 0x55, 0xa5, 0x28, 0x48, 0x20, 0x96, 0x49, 0x05, 0x6a, 0x23, 0x5a, 0x24, 0xb7, - 0xa5, 0x88, 0x4d, 0x70, 0x9a, 0xa9, 0x63, 0x35, 0x19, 0x07, 0x8f, 0x43, 0x93, 0x1d, 0x8f, 0xc0, - 0x63, 0x20, 0xb1, 0xe6, 0x05, 0x58, 0x75, 0x47, 0x97, 0x5d, 0x21, 0x92, 0x6e, 0x58, 0xa1, 0x3e, - 0x02, 0x9a, 0xb1, 0xf3, 0x85, 0x82, 0x4a, 0xa5, 0xbb, 0xf2, 0x9c, 0xff, 0x7f, 0x3c, 0x73, 0xe6, - 0x77, 0xce, 0x81, 0x5c, 0x34, 0xba, 0xae, 0x8f, 0xa2, 0x30, 0x0e, 0x89, 0x11, 0xf7, 0x3d, 0x16, - 0x72, 0x3b, 0x1f, 0x4f, 0x47, 0x94, 0x27, 0xa2, 0x5d, 0xf6, 0x43, 0x3f, 0x94, 0xcb, 0x43, 0xb1, - 0x4a, 0xd5, 0x5d, 0x3f, 0x0c, 0xfd, 0x01, 0x3d, 0x94, 0x51, 0x77, 0x7c, 0x73, 0xe8, 0xb1, 0x69, - 0x62, 0x55, 0xff, 0xce, 0x40, 0xf1, 0x9c, 0x46, 0x01, 0xe5, 0x2e, 0xfd, 0x7e, 0x4c, 0x79, 0x4c, - 0x76, 0xc1, 0x1c, 0x06, 0xac, 0x13, 0x07, 0x43, 0x6a, 0xa1, 0x0a, 0xaa, 0xa9, 0x6e, 0x76, 0x18, - 0xb0, 0x8b, 0x60, 0x48, 0xa5, 0xe5, 0x4d, 0x12, 0x2b, 0x93, 0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0xea, 0xb0, 0x73, 0x43, 0x05, 0x85, 0x5e, 0x27, 0x60, 0x3d, 0x3a, 0xe9, 0x74, 0xa7, 0xe2, 0x39, - 0x02, 0xb9, 0xe6, 0xbe, 0x49, 0xad, 0x13, 0xe1, 0xb4, 0x84, 0x51, 0xfd, 0x15, 0x41, 0x69, 0x51, - 0x29, 0x3e, 0x0a, 0x19, 0xa7, 0xa4, 0x06, 0x06, 0x97, 0x8a, 0xfc, 0x2b, 0xdf, 0x28, 0x2d, 0x20, - 0x24, 0xfb, 0x8e, 0x15, 0x37, 0xf5, 0x89, 0x0d, 0xd9, 0x3b, 0x2f, 0x62, 0x01, 0xf3, 0x65, 0xe1, - 0x72, 0xc7, 0x8a, 0xbb, 0x10, 0xc8, 0xc1, 0xe2, 0xfd, 0xea, 0x7f, 0xbf, 0xff, 0x58, 0x59, 0x10, - 0xf8, 0x10, 0x74, 0x2e, 0xf2, 0x97, 0x05, 0xca, 0x37, 0x8a, 0xcb, 0x2b, 0x85, 0x28, 0xb6, 0x49, - 0xb7, 0x65, 0x82, 0x11, 0x51, 0x3e, 0x1e, 0xc4, 0xd5, 0x5f, 0x10, 0xbc, 0x91, 0x2d, 0x70, 0xe6, - 0x0d, 0x57, 0x5d, 0x56, 0x96, 0xc7, 0x44, 0xb1, 0xbc, 0x54, 0x75, 0x93, 0x80, 0x60, 0x50, 0x29, - 0xeb, 0xa5, 0xb5, 0x17, 0xcb, 0x55, 0x71, 0xf4, 0x97, 0x8b, 0xb3, 0xde, 0x83, 0xc6, 0xff, 0xef, - 0xc1, 0xb6, 0x66, 0x22, 0x9c, 0x69, 0x6b, 0x66, 0x06, 0xab, 0xd5, 0x08, 0xc8, 0x7a, 0xb2, 0x29, - 0xe8, 0x32, 0xe8, 0x4c, 0x08, 0x16, 0xaa, 0xa8, 0xb5, 0x9c, 0x9b, 0x04, 0xc4, 0x06, 0x33, 0x65, - 0xc8, 0xad, 0x8c, 0x34, 0x96, 0xf1, 0x2a, 0x6f, 0x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, 0x9e, - 0x39, 0xe8, 0xc7, 0xb9, 0x83, 0x7e, 0x9e, 0x3b, 0xe8, 0x7e, 0xee, 0xa0, 0x87, 0xb9, 0x83, 0xfe, - 0x9c, 0x3b, 0xe8, 0xaf, 0xb9, 0xa3, 0x3c, 0xcf, 0x1d, 0xf4, 0xd3, 0x93, 0xa3, 0x3c, 0x3c, 0x39, - 0xca, 0xe3, 0x93, 0xa3, 0x7c, 0x9b, 0xe5, 0x02, 0xc4, 0xa8, 0xdb, 0x35, 0x64, 0x2d, 0x3e, 0xfe, - 0x27, 0x00, 0x00, 0xff, 0xff, 0x2b, 0x82, 0x90, 0x02, 0x90, 0x06, 0x00, 0x00, + // 811 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x93, 0xcd, 0x8e, 0xe3, 0x44, + 0x10, 0xc7, 0xdd, 0xf1, 0x47, 0x9c, 0xca, 0x87, 0x7a, 0x7b, 0xb2, 0x2b, 0x8f, 0x91, 0xbc, 0x51, + 0x24, 0xa4, 0x68, 0xb5, 0x64, 0x51, 0x90, 0x40, 0x1c, 0x93, 0x11, 0x68, 0x36, 0x62, 0x06, 0xc9, + 0xb3, 0xcb, 0x22, 0x2e, 0xc1, 0x49, 0x7a, 0x1d, 0x6b, 0x93, 0x76, 0x70, 0xdb, 0x4c, 0x72, 0xe3, + 0x11, 0x78, 0x0c, 0x24, 0xce, 0xbc, 0x00, 0xa7, 0xb9, 0x31, 0xc7, 0x39, 0x21, 0x92, 0xb9, 0x70, + 0x42, 0xf3, 0x08, 0xa8, 0xdb, 0x4e, 0x9c, 0xa0, 0xa0, 0x61, 0x24, 0x4e, 0xee, 0xfa, 0xff, 0xcb, + 0xdd, 0xd5, 0xbf, 0xaa, 0x86, 0x52, 0x34, 0x1f, 0xb5, 0xe7, 0x51, 0x18, 0x87, 0xc4, 0x88, 0x27, + 0x1e, 0x0b, 0xb9, 0x5d, 0x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e, 0x63, 0x35, 0x8f, 0xba, 0x5f, 0x63, 0x8d, 0x60, 0xa8, 0xe4, + 0x7f, 0x7e, 0xe6, 0x62, 0xbd, 0xf3, 0x1b, 0x12, 0x2f, 0x36, 0x8c, 0x28, 0xf9, 0x14, 0x8c, 0xf4, + 0x61, 0x91, 0xc7, 0xfb, 0x0f, 0x2d, 0xeb, 0x98, 0xfd, 0xe4, 0x9f, 0x72, 0x0a, 0xe1, 0x43, 0x44, + 0x4e, 0x00, 0xf2, 0xb1, 0x22, 0xc7, 0x7b, 0x74, 0x77, 0xdf, 0x85, 0x6d, 0x1f, 0xb2, 0x32, 0x96, + 0x9f, 0x43, 0x79, 0x07, 0x31, 0xd9, 0x4f, 0xdd, 0x9b, 0x1d, 0xfb, 0xbd, 0x83, 0x5e, 0xba, 0x4f, + 0xaf, 0x7b, 0xb5, 0x72, 0x94, 0xeb, 0x95, 0xa3, 0xdc, 0xac, 0x1c, 0xe5, 0x6e, 0xe5, 0xa0, 0x1f, + 0xd6, 0x0e, 0xfa, 0x69, 0xed, 0xa0, 0xab, 0xb5, 0x83, 0xae, 0xd7, 0x0e, 0xfa, 0x63, 0xed, 0xa0, + 0x3f, 0xd7, 0x8e, 0x72, 0xb7, 0x76, 0xd0, 0x8f, 0xb7, 0x8e, 0x72, 0x7d, 0xeb, 0x28, 0x37, 0xb7, + 0x8e, 0xf2, 0x4d, 0x91, 0x0b, 0x10, 0xf3, 0xe1, 0xd0, 0x90, 0xbd, 0xf8, 0xe8, 0xef, 0x00, 0x00, + 0x00, 0xff, 0xff, 0x4a, 0x86, 0xba, 0x78, 0xa9, 0x06, 0x00, 0x00, } func (x Aggr) String() string { diff --git a/pkg/storegateway/storepb/rpc.proto b/pkg/storegateway/storepb/rpc.proto index 85467d44a48..cf7aa93fddc 100644 --- a/pkg/storegateway/storepb/rpc.proto +++ b/pkg/storegateway/storepb/rpc.proto @@ -7,7 +7,7 @@ syntax = "proto3"; package thanos; import "types.proto"; -import "gogoproto/gogo.proto"; +import "github.com/gogo/protobuf/gogoproto/gogo.proto"; import "google/protobuf/any.proto"; option go_package = "storepb"; diff --git a/pkg/storegateway/storepb/types.pb.go b/pkg/storegateway/storepb/types.pb.go index 2438ff33a61..7e18c3a174d 100644 --- a/pkg/storegateway/storepb/types.pb.go +++ b/pkg/storegateway/storepb/types.pb.go @@ -8,8 +8,8 @@ import ( fmt "fmt" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" - _ "github.com/grafana/mimir/pkg/storegateway/labelpb" - github_com_grafana_mimir_pkg_storegateway_labelpb "github.com/grafana/mimir/pkg/storegateway/labelpb" + _ "github.com/grafana/mimir/pkg/mimirpb" + github_com_grafana_mimir_pkg_mimirpb "github.com/grafana/mimir/pkg/mimirpb" io "io" math "math" math_bits "math/bits" @@ -112,8 +112,8 @@ func (m *Chunk) XXX_DiscardUnknown() { var xxx_messageInfo_Chunk proto.InternalMessageInfo type Series struct { - Labels []github_com_grafana_mimir_pkg_storegateway_labelpb.ZLabel `protobuf:"bytes,1,rep,name=labels,proto3,customtype=github.com/grafana/mimir/pkg/storegateway/labelpb.ZLabel" json:"labels"` - Chunks []AggrChunk `protobuf:"bytes,2,rep,name=chunks,proto3" json:"chunks"` + 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"` } func (m *Series) Reset() { *m = Series{} } @@ -242,41 +242,42 @@ func init() { func init() { proto.RegisterFile("types.proto", fileDescriptor_d938547f84707355) } var fileDescriptor_d938547f84707355 = []byte{ - // 534 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x93, 0x3f, 0x6f, 0xd3, 0x40, - 0x18, 0xc6, 0x7d, 0xf9, 0xe3, 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f, 0x0f, 0xf6, 0x35, 0x55, 0xc3, 0x11, 0x8b, 0xd1, 0x93, 0xad, 0x35, 0x69, - 0x6d, 0xfd, 0x7d, 0x2b, 0xc6, 0x3d, 0x9d, 0x46, 0xec, 0xdf, 0xa6, 0x48, 0xba, 0x1a, 0x54, 0x83, - 0xe8, 0x33, 0x6a, 0xc2, 0xea, 0x27, 0x3a, 0x4e, 0x99, 0x9e, 0x53, 0x83, 0x14, 0x3f, 0x9c, 0x0f, - 0xb0, 0x92, 0xdf, 0x43, 0xf7, 0xe1, 0xdd, 0x4d, 0xb3, 0x41, 0xff, 0xc4, 0x32, 0x50, 0x13, 0x5a, - 0x5b, 0xc5, 0x37, 0xfd, 0x13, 0x0b, 0xdc, 0x42, 0x49, 0xdf, 0x2a, 0xdd, 0x46, 0x49, 0xdf, 0x2a, - 0xf7, 0x8e, 0x67, 0x0b, 0x6c, 0xcc, 0x17, 0xd8, 0xb8, 0x5a, 0x60, 0xe3, 0x66, 0x81, 0xc1, 0xe7, - 0x0c, 0x83, 0xef, 0x19, 0x06, 0xb3, 0x0c, 0x83, 0x79, 0x86, 0xc1, 0xaf, 0x0c, 0x83, 0xdf, 0x19, - 0x36, 0x6e, 0x32, 0x0c, 0xbe, 0x2c, 0xb1, 0x31, 0x5f, 0x62, 0xe3, 0x6a, 0x89, 0x8d, 0xb3, 0x9a, - 0xde, 0xb6, 0xc8, 0xf7, 0x4d, 0xfd, 0xc1, 0x3c, 0xfd, 0x13, 0x00, 0x00, 0xff, 0xff, 0xeb, 0x60, - 0xfa, 0xbf, 0x9c, 0x03, 0x00, 0x00, + // 545 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x93, 0xbd, 0x8e, 0xd3, 0x40, + 0x10, 0xc7, 0xbd, 0xf9, 0x70, 0x92, 0xcd, 0x1d, 0x98, 0xbd, 0x13, 0x72, 0xae, 0xd8, 0x44, 0xa6,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x0f, 0xd4, 0x7e, + 0x5f, 0x12, 0xe9, 0x4d, 0xa8, 0x40, 0xa7, 0x3b, 0xaf, 0xa4, 0xb1, 0xb1, 0x6d, 0x33, 0xf6, 0xf9, + 0x65, 0x44, 0xff, 0x3d, 0x14, 0x4e, 0xd6, 0x8b, 0xaa, 0x39, 0x2a, 0x46, 0xc7, 0xb0, 0xfc, 0x91, + 0x4c, 0x13, 0xaa, 0xf6, 0x54, 0x73, 0xf2, 0xc4, 0xfa, 0x00, 0x4b, 0x99, 0x0f, 0x1d, 0xc1, 0xbb, + 0xdb, 0xc5, 0x86, 0x83, 0x33, 0x43, 0x43, 0xc7, 0xd0, 0xd8, 0x39, 0x7c, 0x35, 0x38, 0x33, 0xc0, + 0x2d, 0xd4, 0x19, 0x18, 0x85, 0xdb, 0xa8, 0x33, 0x30, 0x8a, 0xfd, 0xde, 0x7c, 0x89, 0xb5, 0xc5, + 0x12, 0x6b, 0x57, 0x4b, 0xac, 0xdd, 0x2c, 0x31, 0xf8, 0x9c, 0x62, 0xf0, 0x3d, 0xc5, 0x60, 0x9e, + 0x62, 0xb0, 0x48, 0x31, 0xf8, 0x95, 0x62, 0xf0, 0x3b, 0xc5, 0xda, 0x4d, 0x8a, 0xc1, 0x97, 0x15, + 0xd6, 0x16, 0x2b, 0xac, 0x5d, 0xad, 0xb0, 0xf6, 0xbe, 0x12, 0xcb, 0x50, 0xd0, 0xc8, 0x75, 0x75, + 0xf5, 0xbf, 0x3c, 0xfd, 0x13, 0x00, 0x00, 0xff, 0xff, 0x2b, 0x46, 0xb2, 0x4d, 0xa7, 0x03, 0x00, + 0x00, } func (x Chunk_Encoding) String() string { @@ -1083,7 +1084,7 @@ func (m *Series) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Labels = append(m.Labels, github_com_grafana_mimir_pkg_storegateway_labelpb.ZLabel{}) + m.Labels = append(m.Labels, github_com_grafana_mimir_pkg_mimirpb.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 0cb20917b99..8b56ec9a65b 100644 --- a/pkg/storegateway/storepb/types.proto +++ b/pkg/storegateway/storepb/types.proto @@ -8,8 +8,8 @@ package thanos; option go_package = "storepb"; -import "gogoproto/gogo.proto"; -import "github.com/grafana/mimir/pkg/storegateway/labelpb/types.proto"; +import "github.com/gogo/protobuf/gogoproto/gogo.proto"; +import "github.com/grafana/mimir/pkg/mimirpb/mimir.proto"; option (gogoproto.sizer_all) = true; option (gogoproto.marshaler_all) = true; @@ -31,7 +31,7 @@ message Chunk { } message Series { - repeated Label labels = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/grafana/mimir/pkg/storegateway/labelpb.ZLabel"]; + repeated cortexpb.LabelPair labels = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/grafana/mimir/pkg/mimirpb.LabelAdapter"]; repeated AggrChunk chunks = 2 [(gogoproto.nullable) = false]; }