From 532679ad4bea009cefe61d80af75199282fc6bac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20S=CC=8Ctibrany=CC=81?= Date: Fri, 2 Oct 2020 14:20:07 +0200 Subject: [PATCH 1/7] Update Thanos to latest master. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Peter Štibraný --- go.mod | 2 +- go.sum | 3 + pkg/querier/block.go | 7 +- pkg/querier/block_test.go | 11 +- pkg/querier/blocks_store_queryable_test.go | 11 +- pkg/storegateway/bucket_stores_test.go | 5 +- pkg/storegateway/gateway_test.go | 3 +- .../thanos-io/thanos/pkg/block/block.go | 18 + .../thanos-io/thanos/pkg/block/index.go | 1 + .../thanos/pkg/block/metadata/meta.go | 3 + .../thanos-io/thanos/pkg/compact/compact.go | 7 +- .../downsample/streamed_block_writer.go | 1 + .../thanos-io/thanos/pkg/objstore/objstore.go | 1 + .../thanos/pkg/promclient/matchers.go | 56 -- .../thanos/pkg/promclient/promclient.go | 6 +- .../thanos/pkg/rules/rulespb/custom.go | 34 +- .../thanos/pkg/rules/rulespb/rpc.pb.go | 333 +++-------- .../thanos/pkg/rules/rulespb/rpc.proto | 17 +- .../thanos-io/thanos/pkg/shipper/shipper.go | 1 + .../thanos-io/thanos/pkg/store/bucket.go | 67 +-- .../thanos-io/thanos/pkg/store/local.go | 7 +- .../thanos-io/thanos/pkg/store/multitsdb.go | 14 +- .../thanos-io/thanos/pkg/store/prometheus.go | 64 +-- .../thanos-io/thanos/pkg/store/proxy.go | 176 +++--- .../thanos/pkg/store/storepb/custom.go | 215 +++---- .../pkg/store/storepb/prompb/types.pb.go | 532 ++---------------- .../pkg/store/storepb/prompb/types.proto | 16 +- .../thanos/pkg/store/storepb/rpc.pb.go | 339 +++-------- .../thanos/pkg/store/storepb/rpc.proto | 7 +- .../pkg/store/storepb/testutil/series.go | 4 +- .../thanos/pkg/store/storepb/types.pb.go | 303 ++-------- .../thanos/pkg/store/storepb/types.proto | 10 +- .../thanos-io/thanos/pkg/store/tsdb.go | 48 +- vendor/modules.txt | 3 +- 34 files changed, 580 insertions(+), 1745 deletions(-) delete mode 100644 vendor/github.com/thanos-io/thanos/pkg/promclient/matchers.go diff --git a/go.mod b/go.mod index 4f0e132586e..b2aa11576ac 100644 --- a/go.mod +++ b/go.mod @@ -53,7 +53,7 @@ require ( github.com/sony/gobreaker v0.4.1 github.com/spf13/afero v1.2.2 github.com/stretchr/testify v1.6.1 - github.com/thanos-io/thanos v0.13.1-0.20200923175059-57035bf8f843 + github.com/thanos-io/thanos v0.13.1-0.20201002105236-bb1662a1d13c github.com/uber/jaeger-client-go v2.25.0+incompatible github.com/weaveworks/common v0.0.0-20200914083218-61ffdd448099 github.com/yuin/gopher-lua v0.0.0-20200816102855-ee81675732da // indirect diff --git a/go.sum b/go.sum index cad1feb6017..e4b8d880253 100644 --- a/go.sum +++ b/go.sum @@ -249,6 +249,7 @@ github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfc github.com/cortexproject/cortex v0.6.1-0.20200228110116-92ab6cbe0995/go.mod h1:3Xa3DjJxtpXqxcMGdk850lcIRb81M0fyY1MQ6udY134= github.com/cortexproject/cortex v1.2.1-0.20200805064754-d8edc95e2c91/go.mod h1:PVPxNLrxKH+yc8asaJOxuz7TiRmMizFfnSMOnRzM6oM= github.com/cortexproject/cortex v1.3.1-0.20200901115931-255ff3306960/go.mod h1:ub8BpRZrRa02BOM8NJTnI2YklxW/mGhEkJDrhsDfcfg= +github.com/cortexproject/cortex v1.3.1-0.20200923145333-8587ea61fe17/go.mod h1:dJ9gpW7dzQ7z09cKtNN9PfebumgyO4dtNdFQ6eQEed0= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/cznic/b v0.0.0-20180115125044-35e9bbe41f07/go.mod h1:URriBxXwVq5ijiJ12C7iIZqlA69nTlI+LgI6/pwftG8= @@ -1168,6 +1169,8 @@ github.com/thanos-io/thanos v0.13.1-0.20200807203500-9b578afb4763 h1:c84P3YUu8bx github.com/thanos-io/thanos v0.13.1-0.20200807203500-9b578afb4763/go.mod h1:KyW0a93tsh7v4hXAwo2CVAIRYuZT1Kkf4e04gisQjAg= github.com/thanos-io/thanos v0.13.1-0.20200923175059-57035bf8f843 h1:juk6GFI+MPKmTKaOzcYnBOUYSIYk9cEFwfVPAHkqh4I= github.com/thanos-io/thanos v0.13.1-0.20200923175059-57035bf8f843/go.mod h1:U7HVxfAHYptOk9xCuxr8WoILGL1wWdXVqZD3t6JifNA= +github.com/thanos-io/thanos v0.13.1-0.20201002105236-bb1662a1d13c h1:zrh4jhgC8AUtoQSdHoiavvpwmtIWuev4q9PypxzLN+g= +github.com/thanos-io/thanos v0.13.1-0.20201002105236-bb1662a1d13c/go.mod h1:XcBmJEI7zAdrF9h7mSH2+C2pMFefq60ayosWsIE8CPY= github.com/themihai/gomemcache v0.0.0-20180902122335-24332e2d58ab h1:7ZR3hmisBWw77ZpO1/o86g+JV3VKlk3d48jopJxzTjU= github.com/themihai/gomemcache v0.0.0-20180902122335-24332e2d58ab/go.mod h1:eheTFp954zcWZXCU8d0AT76ftsQOTo4DTqkN/h3k1MY= github.com/tidwall/pretty v0.0.0-20180105212114-65a9db5fad51/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= diff --git a/pkg/querier/block.go b/pkg/querier/block.go index cfc90fcdb83..6f32c6d8145 100644 --- a/pkg/querier/block.go +++ b/pkg/querier/block.go @@ -8,6 +8,7 @@ import ( "github.com/prometheus/prometheus/pkg/labels" "github.com/prometheus/prometheus/storage" "github.com/prometheus/prometheus/tsdb/chunkenc" + "github.com/thanos-io/thanos/pkg/store/labelpb" "github.com/thanos-io/thanos/pkg/store/storepb" "github.com/cortexproject/cortex/pkg/querier/series" @@ -63,7 +64,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) && storepb.CompareLabels(currLabels, bqss.series[bqss.next].Labels) == 0 { + for bqss.next < len(bqss.series) && labels.Compare(labelpb.LabelsToPromLabels(currLabels), labelpb.LabelsToPromLabels(bqss.series[bqss.next].Labels)) == 0 { currChunks = append(currChunks, bqss.series[bqss.next].Chunks...) bqss.next++ } @@ -85,12 +86,12 @@ func (bqss *blockQuerierSeriesSet) Warnings() storage.Warnings { } // newBlockQuerierSeries makes a new blockQuerierSeries. Input labels must be already sorted by name. -func newBlockQuerierSeries(lbls []storepb.Label, chunks []storepb.AggrChunk) *blockQuerierSeries { +func newBlockQuerierSeries(lbls []labelpb.Label, chunks []storepb.AggrChunk) *blockQuerierSeries { sort.Slice(chunks, func(i, j int) bool { return chunks[i].MinTime < chunks[j].MinTime }) - return &blockQuerierSeries{labels: storepb.LabelsToPromLabelsUnsafe(lbls), chunks: chunks} + return &blockQuerierSeries{labels: labelpb.LabelsToPromLabels(lbls), chunks: chunks} } type blockQuerierSeries struct { diff --git a/pkg/querier/block_test.go b/pkg/querier/block_test.go index a0aa6f51aab..d822f598cf6 100644 --- a/pkg/querier/block_test.go +++ b/pkg/querier/block_test.go @@ -14,6 +14,7 @@ import ( "github.com/prometheus/prometheus/tsdb/chunkenc" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/thanos-io/thanos/pkg/store/labelpb" "github.com/thanos-io/thanos/pkg/store/storepb" "github.com/cortexproject/cortex/pkg/util" @@ -39,7 +40,7 @@ func TestBlockQuerierSeries(t *testing.T) { }, "should return series on success": { series: &storepb.Series{ - Labels: []storepb.Label{ + Labels: []labelpb.Label{ {Name: "foo", Value: "bar"}, }, Chunks: []storepb.AggrChunk{ @@ -56,7 +57,7 @@ func TestBlockQuerierSeries(t *testing.T) { }, "should return error on failure while reading encoded chunk data": { series: &storepb.Series{ - Labels: []storepb.Label{{Name: "foo", Value: "bar"}}, + Labels: []labelpb.Label{{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}}}, }, @@ -262,11 +263,11 @@ func createAggrChunk(minTime, maxTime int64, samples ...promql.Point) storepb.Ag } } -func mkLabels(s ...string) []storepb.Label { - result := []storepb.Label{} +func mkLabels(s ...string) []labelpb.Label { + var result []labelpb.Label for i := 0; i+1 < len(s); i = i + 2 { - result = append(result, storepb.Label{ + result = append(result, labelpb.Label{ Name: s[i], Value: s[i+1], }) diff --git a/pkg/querier/blocks_store_queryable_test.go b/pkg/querier/blocks_store_queryable_test.go index 7fb52366750..8d77f104388 100644 --- a/pkg/querier/blocks_store_queryable_test.go +++ b/pkg/querier/blocks_store_queryable_test.go @@ -24,6 +24,7 @@ import ( "github.com/stretchr/testify/require" "github.com/thanos-io/thanos/pkg/block/metadata" "github.com/thanos-io/thanos/pkg/store/hintspb" + "github.com/thanos-io/thanos/pkg/store/labelpb" "github.com/thanos-io/thanos/pkg/store/storepb" "github.com/weaveworks/common/user" "google.golang.org/grpc" @@ -624,8 +625,8 @@ func TestBlocksStoreQuerier_SelectSortedShouldHonorQueryStoreAfter(t *testing.T) func TestBlocksStoreQuerier_PromQLExecution(t *testing.T) { block1 := ulid.MustNew(1, nil) block2 := ulid.MustNew(2, nil) - series1 := []storepb.Label{{Name: "__name__", Value: "metric_1"}} - series2 := []storepb.Label{{Name: "__name__", Value: "metric_2"}} + series1 := []labelpb.Label{{Name: "__name__", Value: "metric_1"}} + series2 := []labelpb.Label{{Name: "__name__", Value: "metric_2"}} series1Samples := []promql.Point{ {T: 1589759955000, V: 1}, @@ -737,8 +738,8 @@ func TestBlocksStoreQuerier_PromQLExecution(t *testing.T) { require.NoError(t, err) require.Len(t, matrix, 2) - assert.Equal(t, storepb.LabelsToPromLabels(series1), matrix[0].Metric) - assert.Equal(t, storepb.LabelsToPromLabels(series2), matrix[1].Metric) + assert.Equal(t, labelpb.LabelsToPromLabels(series1), matrix[0].Metric) + assert.Equal(t, labelpb.LabelsToPromLabels(series2), matrix[1].Metric) assert.Equal(t, series1Samples, matrix[0].Points) assert.Equal(t, series2Samples, matrix[1].Points) } @@ -840,7 +841,7 @@ func mockSeriesResponse(lbls labels.Labels, timeMillis int64, value float64) *st return &storepb.SeriesResponse{ Result: &storepb.SeriesResponse_Series{ Series: &storepb.Series{ - Labels: storepb.PromLabelsToLabels(lbls), + Labels: labelpb.LabelsFromPromLabels(lbls), Chunks: []storepb.AggrChunk{ {MinTime: timeMillis, MaxTime: timeMillis, Raw: &storepb.Chunk{Type: storepb.Chunk_XOR, Data: chunkData}}, }, diff --git a/pkg/storegateway/bucket_stores_test.go b/pkg/storegateway/bucket_stores_test.go index 5930dc02171..d96b9092b89 100644 --- a/pkg/storegateway/bucket_stores_test.go +++ b/pkg/storegateway/bucket_stores_test.go @@ -18,6 +18,7 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" "github.com/thanos-io/thanos/pkg/store" + "github.com/thanos-io/thanos/pkg/store/labelpb" "github.com/thanos-io/thanos/pkg/store/storepb" "github.com/weaveworks/common/logging" "go.uber.org/atomic" @@ -68,7 +69,7 @@ func TestBucketStores_InitialSync(t *testing.T) { require.NoError(t, err) assert.Empty(t, warnings) require.Len(t, seriesSet, 1) - assert.Equal(t, []storepb.Label{{Name: labels.MetricName, Value: metricName}}, seriesSet[0].Labels) + assert.Equal(t, []labelpb.Label{{Name: labels.MetricName, Value: metricName}}, seriesSet[0].Labels) } // Query series of another user. @@ -146,7 +147,7 @@ func TestBucketStores_SyncBlocks(t *testing.T) { require.NoError(t, err) assert.Empty(t, warnings) assert.Len(t, seriesSet, 1) - assert.Equal(t, []storepb.Label{{Name: labels.MetricName, Value: metricName}}, seriesSet[0].Labels) + assert.Equal(t, []labelpb.Label{{Name: labels.MetricName, Value: metricName}}, seriesSet[0].Labels) assert.NoError(t, testutil.GatherAndCompare(reg, strings.NewReader(` # HELP cortex_bucket_store_blocks_loaded Number of currently loaded blocks. diff --git a/pkg/storegateway/gateway_test.go b/pkg/storegateway/gateway_test.go index 2889e05efb1..3ae54429ad6 100644 --- a/pkg/storegateway/gateway_test.go +++ b/pkg/storegateway/gateway_test.go @@ -25,6 +25,7 @@ import ( "github.com/stretchr/testify/require" "github.com/thanos-io/thanos/pkg/block/metadata" "github.com/thanos-io/thanos/pkg/extprom" + "github.com/thanos-io/thanos/pkg/store/labelpb" "github.com/thanos-io/thanos/pkg/store/storepb" "github.com/cortexproject/cortex/pkg/ring" @@ -695,7 +696,7 @@ func TestStoreGateway_SeriesQueryingShouldRemoveExternalLabels(t *testing.T) { actual := srv.SeriesSet[seriesID] // Ensure Cortex external labels have been removed. - assert.Equal(t, []storepb.Label{{Name: "series_id", Value: strconv.Itoa(seriesID)}}, actual.Labels) + assert.Equal(t, []labelpb.Label{{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/vendor/github.com/thanos-io/thanos/pkg/block/block.go b/vendor/github.com/thanos-io/thanos/pkg/block/block.go index b2492fbf390..550ebc351f9 100644 --- a/vendor/github.com/thanos-io/thanos/pkg/block/block.go +++ b/vendor/github.com/thanos-io/thanos/pkg/block/block.go @@ -222,3 +222,21 @@ func IsBlockDir(path string) (id ulid.ULID, ok bool) { id, err := ulid.Parse(filepath.Base(path)) return id, err == nil } + +// GetSegmentFiles returns list of segment files for given block. Paths are relative to the chunks directory. +// In case of errors, nil is returned. +func GetSegmentFiles(blockDir string) []string { + chunksDir := filepath.Join(blockDir, ChunksDirname) + + files, err := ioutil.ReadDir(chunksDir) + if err != nil { + return nil + } + + // ReadDir returns files in sorted order already. + var result []string + for _, f := range files { + result = append(result, f.Name()) + } + return result +} diff --git a/vendor/github.com/thanos-io/thanos/pkg/block/index.go b/vendor/github.com/thanos-io/thanos/pkg/block/index.go index 2551aacd9c2..41ac09dad7e 100644 --- a/vendor/github.com/thanos-io/thanos/pkg/block/index.go +++ b/vendor/github.com/thanos-io/thanos/pkg/block/index.go @@ -302,6 +302,7 @@ func Repair(logger log.Logger, dir string, id ulid.ULID, source metadata.SourceT if err := rewrite(logger, indexr, chunkr, indexw, chunkw, &resmeta, ignoreChkFns); err != nil { return resid, errors.Wrap(err, "rewrite block") } + resmeta.Thanos.SegmentFiles = GetSegmentFiles(resdir) if err := metadata.Write(logger, resdir, &resmeta); err != nil { return resid, err } diff --git a/vendor/github.com/thanos-io/thanos/pkg/block/metadata/meta.go b/vendor/github.com/thanos-io/thanos/pkg/block/metadata/meta.go index b57b57722fc..c361b703e74 100644 --- a/vendor/github.com/thanos-io/thanos/pkg/block/metadata/meta.go +++ b/vendor/github.com/thanos-io/thanos/pkg/block/metadata/meta.go @@ -59,6 +59,9 @@ type Thanos struct { // Source is a real upload source of the block. Source SourceType `json:"source"` + + // List of segment files (in chunks directory), in sorted order. Optional. + SegmentFiles []string `json:"segment_files,omitempty"` } type ThanosDownsample struct { diff --git a/vendor/github.com/thanos-io/thanos/pkg/compact/compact.go b/vendor/github.com/thanos-io/thanos/pkg/compact/compact.go index 562a4ca336e..74e971d39a7 100644 --- a/vendor/github.com/thanos-io/thanos/pkg/compact/compact.go +++ b/vendor/github.com/thanos-io/thanos/pkg/compact/compact.go @@ -782,9 +782,10 @@ func (cg *Group) compact(ctx context.Context, dir string, comp tsdb.Compactor) ( index := filepath.Join(bdir, block.IndexFilename) newMeta, err := metadata.InjectThanos(cg.logger, bdir, metadata.Thanos{ - Labels: cg.labels.Map(), - Downsample: metadata.ThanosDownsample{Resolution: cg.resolution}, - Source: metadata.CompactorSource, + Labels: cg.labels.Map(), + Downsample: metadata.ThanosDownsample{Resolution: cg.resolution}, + Source: metadata.CompactorSource, + SegmentFiles: block.GetSegmentFiles(bdir), }, nil) if err != nil { return false, ulid.ULID{}, errors.Wrapf(err, "failed to finalize the block %s", bdir) diff --git a/vendor/github.com/thanos-io/thanos/pkg/compact/downsample/streamed_block_writer.go b/vendor/github.com/thanos-io/thanos/pkg/compact/downsample/streamed_block_writer.go index 8ea34794bb1..8a7a3f4f487 100644 --- a/vendor/github.com/thanos-io/thanos/pkg/compact/downsample/streamed_block_writer.go +++ b/vendor/github.com/thanos-io/thanos/pkg/compact/downsample/streamed_block_writer.go @@ -203,6 +203,7 @@ func (w *streamedBlockWriter) syncDir() (err error) { func (w *streamedBlockWriter) writeMetaFile() error { w.meta.Version = metadata.MetaVersion1 w.meta.Thanos.Source = metadata.CompactorSource + w.meta.Thanos.SegmentFiles = block.GetSegmentFiles(w.blockDir) w.meta.Stats.NumChunks = w.totalChunks w.meta.Stats.NumSamples = w.totalSamples w.meta.Stats.NumSeries = w.seriesRefs diff --git a/vendor/github.com/thanos-io/thanos/pkg/objstore/objstore.go b/vendor/github.com/thanos-io/thanos/pkg/objstore/objstore.go index 61db70b2f70..cdab0925a6c 100644 --- a/vendor/github.com/thanos-io/thanos/pkg/objstore/objstore.go +++ b/vendor/github.com/thanos-io/thanos/pkg/objstore/objstore.go @@ -67,6 +67,7 @@ type InstrumentedBucket interface { type BucketReader interface { // Iter calls f for each entry in the given directory (not recursive.). The argument to f is the full // object name including the prefix of the inspected directory. + // Entries are passed to function in sorted order. Iter(ctx context.Context, dir string, f func(string) error) error // Get returns a reader for the given object name. diff --git a/vendor/github.com/thanos-io/thanos/pkg/promclient/matchers.go b/vendor/github.com/thanos-io/thanos/pkg/promclient/matchers.go deleted file mode 100644 index c005d6fd713..00000000000 --- a/vendor/github.com/thanos-io/thanos/pkg/promclient/matchers.go +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) The Thanos Authors. -// Licensed under the Apache License 2.0. - -package promclient - -import ( - "github.com/pkg/errors" - "github.com/prometheus/prometheus/pkg/labels" - "github.com/thanos-io/thanos/pkg/store/storepb" -) - -func TranslateMatcher(m storepb.LabelMatcher) (*labels.Matcher, error) { - switch m.Type { - case storepb.LabelMatcher_EQ: - return labels.NewMatcher(labels.MatchEqual, m.Name, m.Value) - - case storepb.LabelMatcher_NEQ: - return labels.NewMatcher(labels.MatchNotEqual, m.Name, m.Value) - - case storepb.LabelMatcher_RE: - return labels.NewMatcher(labels.MatchRegexp, m.Name, m.Value) - - case storepb.LabelMatcher_NRE: - return labels.NewMatcher(labels.MatchNotRegexp, m.Name, m.Value) - } - return nil, errors.Errorf("unknown label matcher type %d", m.Type) -} - -func TranslateMatchers(ms []storepb.LabelMatcher) (res []*labels.Matcher, err error) { - for _, m := range ms { - r, err := TranslateMatcher(m) - if err != nil { - return nil, err - } - res = append(res, r) - } - return res, nil -} - -// MatchersToString converts label matchers to string format. -func MatchersToString(ms []storepb.LabelMatcher) (string, error) { - var res string - matchers, err := TranslateMatchers(ms) - if err != nil { - return "", err - } - - for i, m := range matchers { - res += m.String() - if i < len(matchers)-1 { - res += ", " - } - } - - return "{" + res + "}", nil -} diff --git a/vendor/github.com/thanos-io/thanos/pkg/promclient/promclient.go b/vendor/github.com/thanos-io/thanos/pkg/promclient/promclient.go index f005d1ae28f..ab6c15c6f88 100644 --- a/vendor/github.com/thanos-io/thanos/pkg/promclient/promclient.go +++ b/vendor/github.com/thanos-io/thanos/pkg/promclient/promclient.go @@ -636,11 +636,7 @@ func (c *Client) SeriesInGRPC(ctx context.Context, base *url.URL, matchers []sto u.Path = path.Join(u.Path, "/api/v1/series") q := u.Query() - matcher, err := MatchersToString(matchers) - if err != nil { - return nil, errors.Wrap(err, "invalid matchers") - } - q.Add("match[]", matcher) + q.Add("match[]", storepb.MatchersToString(matchers...)) q.Add("start", formatTime(timestamp.Time(startTime))) q.Add("end", formatTime(timestamp.Time(endTime))) u.RawQuery = q.Encode() diff --git a/vendor/github.com/thanos-io/thanos/pkg/rules/rulespb/custom.go b/vendor/github.com/thanos-io/thanos/pkg/rules/rulespb/custom.go index 47fa0f1f9b5..a2708075b87 100644 --- a/vendor/github.com/thanos-io/thanos/pkg/rules/rulespb/custom.go +++ b/vendor/github.com/thanos-io/thanos/pkg/rules/rulespb/custom.go @@ -6,14 +6,14 @@ package rulespb import ( "encoding/json" "math/big" - "sort" "strconv" "strings" "time" "github.com/pkg/errors" "github.com/prometheus/prometheus/pkg/labels" - "github.com/thanos-io/thanos/pkg/store/storepb" + "github.com/thanos-io/thanos/pkg/store/labelpb" + storepb "github.com/thanos-io/thanos/pkg/store/storepb" ) const ( @@ -72,22 +72,22 @@ func NewAlertingRule(a *Alert) *Rule { } } -func (r *Rule) GetLabels() []storepb.Label { +func (r *Rule) GetLabels() labels.Labels { switch { case r.GetRecording() != nil: - return r.GetRecording().Labels.Labels + return r.GetRecording().Labels.PromLabels() case r.GetAlert() != nil: - return r.GetAlert().Labels.Labels + return r.GetAlert().Labels.PromLabels() default: return nil } } -func (r *Rule) SetLabels(ls []storepb.Label) { - var result PromLabels +func (r *Rule) SetLabels(ls labels.Labels) { + var result storepb.LabelSet if len(ls) > 0 { - result = PromLabels{Labels: ls} + result = storepb.LabelSet{Labels: labelpb.LabelsFromPromLabels(ls)} } switch { @@ -160,7 +160,7 @@ func (r1 *Rule) Compare(r2 *Rule) int { return d } - if d := storepb.CompareLabels(r1.GetLabels(), r2.GetLabels()); d != 0 { + if d := labels.Compare(r1.GetLabels(), r2.GetLabels()); d != 0 { return d } @@ -329,19 +329,3 @@ func (a1 *Alert) Compare(a2 *Alert) int { return 0 } - -func (m *PromLabels) 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)) - } - m.Labels = storepb.PromLabelsToLabels(lbls) - sort.Slice(m.Labels, func(i, j int) bool { - return m.Labels[i].Name < m.Labels[j].Name - }) - return nil -} - -func (m *PromLabels) MarshalJSON() ([]byte, error) { - return storepb.LabelsToPromLabels(m.Labels).MarshalJSON() -} diff --git a/vendor/github.com/thanos-io/thanos/pkg/rules/rulespb/rpc.pb.go b/vendor/github.com/thanos-io/thanos/pkg/rules/rulespb/rpc.pb.go index 2fda7b2fe85..72785cb90ae 100644 --- a/vendor/github.com/thanos-io/thanos/pkg/rules/rulespb/rpc.pb.go +++ b/vendor/github.com/thanos-io/thanos/pkg/rules/rulespb/rpc.pb.go @@ -20,6 +20,7 @@ import ( math_bits "math/bits" time "time" + labelpb "github.com/thanos-io/thanos/pkg/store/labelpb" storepb "github.com/thanos-io/thanos/pkg/store/storepb" ) @@ -401,11 +402,11 @@ func (*Rule) XXX_OneofWrappers() []interface{} { } type AlertInstance struct { - Labels PromLabels `protobuf:"bytes,1,opt,name=labels,proto3" json:"labels"` - Annotations PromLabels `protobuf:"bytes,2,opt,name=annotations,proto3" json:"annotations"` - State AlertState `protobuf:"varint,3,opt,name=state,proto3,enum=thanos.AlertState" json:"state"` - ActiveAt *time.Time `protobuf:"bytes,4,opt,name=active_at,json=activeAt,proto3,stdtime" json:"activeAt,omitempty"` - Value string `protobuf:"bytes,5,opt,name=value,proto3" json:"value"` + Labels labelpb.LabelSet `protobuf:"bytes,1,opt,name=labels,proto3" json:"labels"` + Annotations labelpb.LabelSet `protobuf:"bytes,2,opt,name=annotations,proto3" json:"annotations"` + State AlertState `protobuf:"varint,3,opt,name=state,proto3,enum=thanos.AlertState" json:"state"` + ActiveAt *time.Time `protobuf:"bytes,4,opt,name=active_at,json=activeAt,proto3,stdtime" json:"activeAt,omitempty"` + Value string `protobuf:"bytes,5,opt,name=value,proto3" json:"value"` // Thanos specific. Used mainly for alert API purposes. PartialResponseStrategy storepb.PartialResponseStrategy `protobuf:"varint,6,opt,name=PartialResponseStrategy,proto3,enum=thanos.PartialResponseStrategy" json:"partialResponseStrategy"` } @@ -449,8 +450,8 @@ type Alert struct { Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name"` Query string `protobuf:"bytes,3,opt,name=query,proto3" json:"query"` DurationSeconds float64 `protobuf:"fixed64,4,opt,name=duration_seconds,json=durationSeconds,proto3" json:"duration"` - Labels PromLabels `protobuf:"bytes,5,opt,name=labels,proto3" json:"labels"` - Annotations PromLabels `protobuf:"bytes,6,opt,name=annotations,proto3" json:"annotations"` + Labels labelpb.LabelSet `protobuf:"bytes,5,opt,name=labels,proto3" json:"labels"` + Annotations labelpb.LabelSet `protobuf:"bytes,6,opt,name=annotations,proto3" json:"annotations"` Alerts []*AlertInstance `protobuf:"bytes,7,rep,name=alerts,proto3" json:"alerts"` Health string `protobuf:"bytes,8,opt,name=health,proto3" json:"health"` LastError string `protobuf:"bytes,9,opt,name=last_error,json=lastError,proto3" json:"lastError,omitempty"` @@ -492,13 +493,13 @@ func (m *Alert) XXX_DiscardUnknown() { var xxx_messageInfo_Alert proto.InternalMessageInfo type RecordingRule struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name"` - Query string `protobuf:"bytes,2,opt,name=query,proto3" json:"query"` - Labels PromLabels `protobuf:"bytes,3,opt,name=labels,proto3" json:"labels"` - Health string `protobuf:"bytes,4,opt,name=health,proto3" json:"health"` - LastError string `protobuf:"bytes,5,opt,name=last_error,json=lastError,proto3" json:"lastError,omitempty"` - EvaluationDurationSeconds float64 `protobuf:"fixed64,6,opt,name=evaluation_duration_seconds,json=evaluationDurationSeconds,proto3" json:"evaluationTime"` - LastEvaluation time.Time `protobuf:"bytes,7,opt,name=last_evaluation,json=lastEvaluation,proto3,stdtime" json:"lastEvaluation"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name"` + Query string `protobuf:"bytes,2,opt,name=query,proto3" json:"query"` + Labels labelpb.LabelSet `protobuf:"bytes,3,opt,name=labels,proto3" json:"labels"` + Health string `protobuf:"bytes,4,opt,name=health,proto3" json:"health"` + LastError string `protobuf:"bytes,5,opt,name=last_error,json=lastError,proto3" json:"lastError,omitempty"` + EvaluationDurationSeconds float64 `protobuf:"fixed64,6,opt,name=evaluation_duration_seconds,json=evaluationDurationSeconds,proto3" json:"evaluationTime"` + LastEvaluation time.Time `protobuf:"bytes,7,opt,name=last_evaluation,json=lastEvaluation,proto3,stdtime" json:"lastEvaluation"` } func (m *RecordingRule) Reset() { *m = RecordingRule{} } @@ -534,43 +535,6 @@ func (m *RecordingRule) XXX_DiscardUnknown() { var xxx_messageInfo_RecordingRule proto.InternalMessageInfo -type PromLabels struct { - Labels []storepb.Label `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels"` -} - -func (m *PromLabels) Reset() { *m = PromLabels{} } -func (m *PromLabels) String() string { return proto.CompactTextString(m) } -func (*PromLabels) ProtoMessage() {} -func (*PromLabels) Descriptor() ([]byte, []int) { - return fileDescriptor_91b1d28f30eb5efb, []int{8} -} -func (m *PromLabels) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PromLabels) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PromLabels.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 *PromLabels) XXX_Merge(src proto.Message) { - xxx_messageInfo_PromLabels.Merge(m, src) -} -func (m *PromLabels) XXX_Size() int { - return m.Size() -} -func (m *PromLabels) XXX_DiscardUnknown() { - xxx_messageInfo_PromLabels.DiscardUnknown(m) -} - -var xxx_messageInfo_PromLabels proto.InternalMessageInfo - func init() { proto.RegisterEnum("thanos.AlertState", AlertState_name, AlertState_value) proto.RegisterEnum("thanos.RulesRequest_Type", RulesRequest_Type_name, RulesRequest_Type_value) @@ -582,76 +546,74 @@ func init() { proto.RegisterType((*AlertInstance)(nil), "thanos.AlertInstance") proto.RegisterType((*Alert)(nil), "thanos.Alert") proto.RegisterType((*RecordingRule)(nil), "thanos.RecordingRule") - proto.RegisterType((*PromLabels)(nil), "thanos.PromLabels") } func init() { proto.RegisterFile("rules/rulespb/rpc.proto", fileDescriptor_91b1d28f30eb5efb) } var fileDescriptor_91b1d28f30eb5efb = []byte{ - // 998 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xcd, 0x6e, 0xdb, 0x46, - 0x10, 0x26, 0x2d, 0x91, 0x12, 0xc7, 0x3f, 0x71, 0x37, 0x31, 0x4c, 0x2b, 0x85, 0x68, 0x08, 0x48, - 0xe1, 0xfe, 0x44, 0x2a, 0x6c, 0x24, 0x45, 0x7a, 0x29, 0x44, 0x5b, 0x8d, 0x05, 0x18, 0x6e, 0xb0, - 0x16, 0x7a, 0x68, 0x0f, 0x2a, 0x25, 0x6f, 0x64, 0x01, 0x14, 0xc9, 0xec, 0xae, 0x5c, 0xe8, 0x09, - 0x7a, 0xcd, 0xbd, 0x4f, 0xd2, 0x6b, 0x4f, 0xbe, 0x14, 0xc8, 0xb1, 0x27, 0xb5, 0xb5, 0x6f, 0x7a, - 0x8a, 0x82, 0xb3, 0xa4, 0x28, 0xbb, 0x72, 0x9d, 0x20, 0xca, 0x85, 0xb3, 0x3b, 0xf3, 0xcd, 0x0c, - 0x77, 0xe6, 0xe3, 0x70, 0x61, 0x93, 0x0f, 0x7d, 0x26, 0x6a, 0xf8, 0x8c, 0x3a, 0x35, 0x1e, 0x75, - 0xab, 0x11, 0x0f, 0x65, 0x48, 0x4c, 0x79, 0xe6, 0x05, 0xa1, 0x28, 0x6d, 0x09, 0x19, 0x72, 0x56, - 0xc3, 0x67, 0xd4, 0xa9, 0xc9, 0x51, 0xc4, 0x84, 0x82, 0x94, 0x1e, 0xf4, 0xc2, 0x5e, 0x88, 0xcb, - 0x5a, 0xbc, 0x4a, 0xb4, 0x4e, 0x2f, 0x0c, 0x7b, 0x3e, 0xab, 0xe1, 0xae, 0x33, 0x7c, 0x59, 0x93, - 0xfd, 0x01, 0x13, 0xd2, 0x1b, 0x44, 0x0a, 0x50, 0xf9, 0x5d, 0x87, 0x15, 0x1a, 0xe7, 0xa3, 0xec, - 0xd5, 0x90, 0x09, 0x49, 0x1e, 0x43, 0x3e, 0x0e, 0x6b, 0xeb, 0xdb, 0xfa, 0xce, 0xda, 0xee, 0x56, - 0x55, 0x65, 0xae, 0xce, 0x62, 0xaa, 0xad, 0x51, 0xc4, 0x28, 0xc2, 0xc8, 0x8f, 0xb0, 0x15, 0x79, - 0x5c, 0xf6, 0x3d, 0xbf, 0xcd, 0x99, 0x88, 0xc2, 0x40, 0xb0, 0xb6, 0x90, 0xdc, 0x93, 0xac, 0x37, - 0xb2, 0x97, 0x30, 0x86, 0x93, 0xc6, 0x78, 0xa1, 0x80, 0x34, 0xc1, 0x9d, 0x24, 0x30, 0xba, 0x19, - 0xcd, 0x37, 0x54, 0x3e, 0x81, 0x7c, 0x9c, 0x8a, 0x14, 0x20, 0x57, 0x3f, 0x3a, 0x5a, 0xd7, 0x88, - 0x05, 0x46, 0xfd, 0xa8, 0x41, 0x5b, 0xeb, 0x3a, 0x01, 0x30, 0x69, 0x63, 0xff, 0x3b, 0x7a, 0xb0, - 0xbe, 0x54, 0xf9, 0x09, 0x56, 0x93, 0xf7, 0x53, 0x01, 0xc8, 0xa7, 0x60, 0xf4, 0x78, 0x38, 0x8c, - 0xf0, 0x14, 0xcb, 0xbb, 0x1f, 0xcd, 0x9e, 0xe2, 0x79, 0x6c, 0x38, 0xd4, 0xa8, 0x42, 0x90, 0x12, - 0x14, 0x7e, 0xf6, 0x78, 0xd0, 0x0f, 0x7a, 0xf8, 0xba, 0xd6, 0xa1, 0x46, 0x53, 0x85, 0x5b, 0x04, - 0x93, 0x33, 0x31, 0xf4, 0x65, 0x65, 0x1f, 0x60, 0xea, 0x2b, 0xc8, 0x13, 0x30, 0xd1, 0x59, 0xd8, - 0xfa, 0x76, 0x6e, 0x6e, 0x7c, 0x17, 0x26, 0x63, 0x27, 0x01, 0xd1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0x0b, 0x4e, 0x9e, 0x80, 0xc5, 0x59, 0x37, 0xe4, 0xa7, 0x31, 0x89, 0x14, 0xe3, 0x36, 0xa6, - 0x1d, 0x49, 0x0d, 0x31, 0xf2, 0x50, 0xa3, 0x19, 0x92, 0x3c, 0x02, 0xc3, 0xf3, 0x19, 0x97, 0xd8, - 0xe3, 0xe5, 0xdd, 0xd5, 0xd4, 0xa5, 0x1e, 0x2b, 0x63, 0x82, 0xa2, 0x75, 0x86, 0x84, 0xbf, 0xe5, - 0x60, 0x15, 0x8d, 0xcd, 0x40, 0x48, 0x2f, 0xe8, 0x32, 0xf2, 0x35, 0x98, 0xbe, 0xd7, 0x61, 0xbe, - 0x48, 0xd2, 0x92, 0xe9, 0x41, 0x79, 0x38, 0x38, 0x42, 0x8b, 0xbb, 0x96, 0x54, 0x32, 0x41, 0xd2, - 0x44, 0x92, 0x26, 0x2c, 0x7b, 0x41, 0x10, 0x4a, 0xac, 0xa1, 0x48, 0x5e, 0x62, 0x5e, 0x80, 0xfb, - 0x49, 0x80, 0x59, 0x38, 0x9d, 0xdd, 0x90, 0x3d, 0x30, 0x84, 0xf4, 0x24, 0xb3, 0x73, 0x58, 0x6e, - 0x72, 0xed, 0x24, 0x27, 0xb1, 0x45, 0x91, 0x12, 0x41, 0x54, 0x09, 0x72, 0x02, 0x96, 0xd7, 0x95, - 0xfd, 0x73, 0xd6, 0xf6, 0x24, 0xb2, 0xf2, 0x0e, 0x42, 0x4c, 0xc6, 0x0e, 0x51, 0x0e, 0x75, 0xf9, - 0x45, 0x38, 0xe8, 0x4b, 0x36, 0x88, 0xe4, 0x08, 0x09, 0x51, 0x4c, 0xf5, 0xc4, 0x01, 0x23, 0xe6, - 0x05, 0x43, 0xa6, 0x5a, 0x2a, 0x2b, 0x2a, 0xa8, 0x12, 0xff, 0xc7, 0x15, 0xf3, 0x43, 0x72, 0xe5, - 0x17, 0x03, 0x0c, 0x2c, 0x47, 0x56, 0x2c, 0xfd, 0x1d, 0x8a, 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0x14, 0x9b, 0xc7, 0xf5, 0xfd, 0x56, 0xf3, 0xfb, 0xc6, 0xba, 0x46, 0x96, 0xa1, 0xf0, 0xa2, 0x71, - 0x7c, 0xd0, 0x3c, 0x7e, 0xae, 0xae, 0x4e, 0xdf, 0x36, 0x69, 0xbc, 0x5e, 0xda, 0xfd, 0x06, 0x0c, - 0xbc, 0x3a, 0x91, 0xa7, 0xe9, 0xe2, 0xc1, 0xbc, 0x2b, 0x5f, 0x69, 0xe3, 0x86, 0x56, 0x8d, 0xb7, - 0x2f, 0x75, 0xf7, 0xd1, 0xc5, 0x3f, 0x65, 0xed, 0xe2, 0xb2, 0xac, 0xbf, 0xb9, 0x2c, 0xeb, 0x7f, - 0x5f, 0x96, 0xf5, 0xd7, 0x57, 0x65, 0xed, 0xcd, 0x55, 0x59, 0xfb, 0xf3, 0xaa, 0xac, 0xfd, 0x50, - 0x48, 0xee, 0xb2, 0x1d, 0x13, 0xeb, 0xb2, 0xf7, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x0a, 0x78, - 0xe7, 0xed, 0xe3, 0x0a, 0x00, 0x00, + // 983 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0x4f, 0x6f, 0xe3, 0x44, + 0x14, 0xb7, 0x9b, 0xd8, 0x89, 0x5f, 0xda, 0x6e, 0x98, 0xdd, 0xaa, 0x6e, 0x16, 0xc5, 0x55, 0xa4, + 0x45, 0x05, 0xb1, 0x09, 0x6a, 0xb5, 0x0b, 0x9c, 0x50, 0xd2, 0x86, 0x36, 0x52, 0x55, 0x56, 0x93, + 0x88, 0x03, 0x1c, 0xc2, 0x24, 0x9d, 0x4d, 0x23, 0x39, 0xb6, 0x77, 0x66, 0x52, 0x94, 0x33, 0x5f, + 0x60, 0xaf, 0x7c, 0x10, 0xbe, 0x00, 0xa7, 0x5e, 0x90, 0xf6, 0xc8, 0x29, 0x40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0x89, 0xb1, 0x90, 0xb9, 0x8e, 0xc2, 0x6d, 0xce, 0xa6, 0xde, + 0x43, 0x25, 0x30, 0xd2, 0x99, 0x92, 0x0d, 0x3b, 0x73, 0xe7, 0x7d, 0x2a, 0x09, 0x4b, 0x52, 0xc9, + 0xc2, 0x32, 0x55, 0xb2, 0xf2, 0x73, 0x06, 0xd6, 0xae, 0xa9, 0xd1, 0x3d, 0x5f, 0xa0, 0x39, 0xb1, + 0x56, 0xee, 0x20, 0x56, 0xca, 0x8f, 0xcc, 0x7b, 0xf2, 0x23, 0xed, 0x4d, 0xf6, 0x1d, 0x7b, 0x63, + 0x2d, 0xab, 0x37, 0xf6, 0x92, 0x7a, 0x93, 0x5b, 0x66, 0x6f, 0x3e, 0xd9, 0x03, 0x48, 0x25, 0x00, + 0xad, 0x42, 0xbe, 0x75, 0x52, 0xdf, 0xef, 0xb4, 0xbe, 0x6d, 0x16, 0x0d, 0x54, 0x80, 0xdc, 0x8b, + 0xe6, 0xc9, 0x41, 0xeb, 0xe4, 0x50, 0xff, 0xf5, 0x7c, 0xdd, 0xc2, 0x72, 0xbc, 0xb2, 0xfb, 0x15, + 0x58, 0xea, 0xaf, 0x07, 0x3d, 0x4f, 0x06, 0x8f, 0x6e, 0xfb, 0x5b, 0x2b, 0x6d, 0xdc, 0xf0, 0x6a, + 0x75, 0xfa, 0xcc, 0x6c, 0x3c, 0xb9, 0xf8, 0xab, 0x6c, 0x5c, 0x5c, 0x96, 0xcd, 0x37, 0x97, 0x65, + 0xf3, 0xcf, 0xcb, 0xb2, 0xf9, 0xfa, 0xaa, 0x6c, 0xbc, 0xb9, 0x2a, 0x1b, 0xbf, 0x5f, 0x95, 0x8d, + 0xef, 0x72, 0xf1, 0x1f, 0x6a, 0xcf, 0x56, 0x97, 0xdb, 0xfb, 0x3b, 0x00, 0x00, 0xff, 0xff, 0x6d, + 0xf1, 0x63, 0x71, 0xb9, 0x0a, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1307,43 +1269,6 @@ func (m *RecordingRule) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *PromLabels) 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 *PromLabels) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PromLabels) 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 = encodeVarintRpc(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - func encodeVarintRpc(dAtA []byte, offset int, v uint64) int { offset -= sovRpc(v) base := offset @@ -1594,21 +1519,6 @@ func (m *RecordingRule) Size() (n int) { return n } -func (m *PromLabels) 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 + sovRpc(uint64(l)) - } - } - return n -} - func sovRpc(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -3099,93 +3009,6 @@ func (m *RecordingRule) Unmarshal(dAtA []byte) error { } return nil } -func (m *PromLabels) 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 ErrIntOverflowRpc - } - 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: PromLabels: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PromLabels: 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 ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Labels = append(m.Labels, storepb.Label{}) - if err := m.Labels[len(m.Labels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func skipRpc(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/vendor/github.com/thanos-io/thanos/pkg/rules/rulespb/rpc.proto b/vendor/github.com/thanos-io/thanos/pkg/rules/rulespb/rpc.proto index eec6daedbd4..b6da4ef8d1a 100644 --- a/vendor/github.com/thanos-io/thanos/pkg/rules/rulespb/rpc.proto +++ b/vendor/github.com/thanos-io/thanos/pkg/rules/rulespb/rpc.proto @@ -5,6 +5,7 @@ syntax = "proto3"; package thanos; import "store/storepb/types.proto"; +import "store/labelpb/types.proto"; import "gogoproto/gogo.proto"; import "google/protobuf/timestamp.proto"; @@ -73,7 +74,7 @@ message RuleGroup { google.protobuf.Timestamp last_evaluation = 6 [(gogoproto.jsontag) = "lastEvaluation", (gogoproto.stdtime) = true, (gogoproto.nullable) = false ]; // Thanos specific. - PartialResponseStrategy PartialResponseStrategy = 8 [(gogoproto.jsontag) = "partialResponseStrategy" ]; + PartialResponseStrategy PartialResponseStrategy = 8 [(gogoproto.jsontag) = "partialResponseStrategy" ]; } message Rule { @@ -100,8 +101,8 @@ enum AlertState { } message AlertInstance { - PromLabels labels = 1 [(gogoproto.jsontag) = "labels", (gogoproto.nullable) = false ]; - PromLabels annotations = 2 [(gogoproto.jsontag) = "annotations", (gogoproto.nullable) = false ]; + LabelSet labels = 1 [(gogoproto.jsontag) = "labels", (gogoproto.nullable) = false ]; + LabelSet annotations = 2 [(gogoproto.jsontag) = "annotations", (gogoproto.nullable) = false ]; AlertState state = 3 [(gogoproto.jsontag) = "state" ]; google.protobuf.Timestamp active_at = 4 [(gogoproto.jsontag) = "activeAt,omitempty", (gogoproto.stdtime) = true]; string value = 5 [(gogoproto.jsontag) = "value" ]; @@ -116,8 +117,8 @@ message Alert { string name = 2 [(gogoproto.jsontag) = "name" ]; string query = 3 [(gogoproto.jsontag) = "query" ]; double duration_seconds = 4 [(gogoproto.jsontag) = "duration" ]; - PromLabels labels = 5 [(gogoproto.jsontag) = "labels", (gogoproto.nullable) = false ]; - PromLabels annotations = 6 [(gogoproto.jsontag) = "annotations", (gogoproto.nullable) = false ]; + LabelSet labels = 5 [(gogoproto.jsontag) = "labels", (gogoproto.nullable) = false ]; + LabelSet annotations = 6 [(gogoproto.jsontag) = "annotations", (gogoproto.nullable) = false ]; repeated AlertInstance alerts = 7 [(gogoproto.jsontag) = "alerts" ]; string health = 8 [(gogoproto.jsontag) = "health" ]; string last_error = 9 [(gogoproto.jsontag) = "lastError,omitempty" ]; @@ -128,13 +129,9 @@ message Alert { message RecordingRule { string name = 1 [(gogoproto.jsontag) = "name" ]; string query = 2 [(gogoproto.jsontag) = "query" ]; - PromLabels labels = 3 [(gogoproto.jsontag) = "labels", (gogoproto.nullable) = false ]; + LabelSet labels = 3 [(gogoproto.jsontag) = "labels", (gogoproto.nullable) = false ]; string health = 4 [(gogoproto.jsontag) = "health" ]; string last_error = 5 [(gogoproto.jsontag) = "lastError,omitempty" ]; double evaluation_duration_seconds = 6 [(gogoproto.jsontag) = "evaluationTime" ]; google.protobuf.Timestamp last_evaluation = 7 [(gogoproto.jsontag) = "lastEvaluation", (gogoproto.stdtime) = true, (gogoproto.nullable) = false ]; } - -message PromLabels { - repeated Label labels = 1 [(gogoproto.nullable) = false]; -} diff --git a/vendor/github.com/thanos-io/thanos/pkg/shipper/shipper.go b/vendor/github.com/thanos-io/thanos/pkg/shipper/shipper.go index 30496e43c04..6804f0f2e44 100644 --- a/vendor/github.com/thanos-io/thanos/pkg/shipper/shipper.go +++ b/vendor/github.com/thanos-io/thanos/pkg/shipper/shipper.go @@ -358,6 +358,7 @@ func (s *Shipper) upload(ctx context.Context, meta *metadata.Meta) error { meta.Thanos.Labels = lset.Map() } meta.Thanos.Source = s.source + meta.Thanos.SegmentFiles = block.GetSegmentFiles(updir) if err := metadata.Write(s.logger, updir, meta); err != nil { return errors.Wrap(err, "write meta file") } diff --git a/vendor/github.com/thanos-io/thanos/pkg/store/bucket.go b/vendor/github.com/thanos-io/thanos/pkg/store/bucket.go index 9f4de8e0a6b..188cbbe1403 100644 --- a/vendor/github.com/thanos-io/thanos/pkg/store/bucket.go +++ b/vendor/github.com/thanos-io/thanos/pkg/store/bucket.go @@ -44,10 +44,10 @@ import ( "github.com/thanos-io/thanos/pkg/model" "github.com/thanos-io/thanos/pkg/objstore" "github.com/thanos-io/thanos/pkg/pool" - "github.com/thanos-io/thanos/pkg/promclient" "github.com/thanos-io/thanos/pkg/runutil" storecache "github.com/thanos-io/thanos/pkg/store/cache" "github.com/thanos-io/thanos/pkg/store/hintspb" + "github.com/thanos-io/thanos/pkg/store/labelpb" "github.com/thanos-io/thanos/pkg/store/storepb" "github.com/thanos-io/thanos/pkg/strutil" "github.com/thanos-io/thanos/pkg/tracing" @@ -226,13 +226,13 @@ func newBucketStoreMetrics(reg prometheus.Registerer) *bucketStoreMetrics { m.seriesFetchDuration = promauto.With(reg).NewHistogram(prometheus.HistogramOpts{ Name: "thanos_bucket_store_cached_series_fetch_duration_seconds", - Help: "Time it takes to fetch series from a bucket to respond a query. It also includes the time it takes to cache fetch and store operations.", + Help: "The time it takes to fetch series to respond to a request sent to a store gateway. It includes both the time to fetch it from the cache and from storage in case of cache misses.", Buckets: []float64{0.001, 0.01, 0.1, 0.3, 0.6, 1, 3, 6, 9, 20, 30, 60, 90, 120}, }) m.postingsFetchDuration = promauto.With(reg).NewHistogram(prometheus.HistogramOpts{ Name: "thanos_bucket_store_cached_postings_fetch_duration_seconds", - Help: "Time it takes to fetch postings from a bucket to respond a query. It also includes the time it takes to cache fetch and store operations.", + Help: "The time it takes to fetch postings to respond to a request sent to a store gateway. It includes both the time to fetch it from the cache and from storage in case of cache misses.", Buckets: []float64{0.001, 0.01, 0.1, 0.3, 0.6, 1, 3, 6, 9, 20, 30, 60, 90, 120}, }) @@ -410,21 +410,17 @@ func (s *BucketStore) SyncBlocks(ctx context.Context) error { } // Sync advertise labels. - var storeLabels []storepb.Label + var storeLabels labels.Labels s.mtx.Lock() - s.advLabelSets = s.advLabelSets[:0] + s.advLabelSets = make([]storepb.LabelSet, 0, len(s.advLabelSets)) for _, bs := range s.blockSets { - storeLabels := storeLabels[:0] - for _, l := range bs.labels { - storeLabels = append(storeLabels, storepb.Label{Name: l.Name, Value: l.Value}) - } - s.advLabelSets = append(s.advLabelSets, storepb.LabelSet{Labels: storeLabels}) + storeLabels = storeLabels[:0] + s.advLabelSets = append(s.advLabelSets, storepb.LabelSet{Labels: labelpb.LabelsFromPromLabels(append(storeLabels, bs.labels...))}) } sort.Slice(s.advLabelSets, func(i, j int) bool { return strings.Compare(s.advLabelSets[i].String(), s.advLabelSets[j].String()) < 0 }) s.mtx.Unlock() - return nil } @@ -602,7 +598,6 @@ func (s *BucketStore) Info(context.Context, *storepb.InfoRequest) (*storepb.Info } s.mtx.RLock() - // Should we clone? res.LabelSets = s.advLabelSets s.mtx.RUnlock() @@ -643,7 +638,7 @@ func (s *BucketStore) limitMaxTime(maxt int64) int64 { } type seriesEntry struct { - lset []storepb.Label + lset labels.Labels refs []uint64 chks []storepb.AggrChunk } @@ -669,7 +664,7 @@ func (s *bucketSeriesSet) Next() bool { return true } -func (s *bucketSeriesSet) At() ([]storepb.Label, []storepb.AggrChunk) { +func (s *bucketSeriesSet) At() (labels.Labels, []storepb.AggrChunk) { return s.set[s.i].lset, s.set[s.i].chks } @@ -713,7 +708,7 @@ func blockSeries( return nil, nil, errors.Wrap(err, "read series") } s := seriesEntry{ - lset: make([]storepb.Label, 0, len(lset)+len(extLset)), + lset: make(labels.Labels, 0, len(lset)+len(extLset)), refs: make([]uint64, 0, len(chks)), chks: make([]storepb.AggrChunk, 0, len(chks)), } @@ -723,20 +718,12 @@ func blockSeries( if extLset[l.Name] != "" { continue } - s.lset = append(s.lset, storepb.Label{ - Name: l.Name, - Value: l.Value, - }) + s.lset = append(s.lset, l) } for ln, lv := range extLset { - s.lset = append(s.lset, storepb.Label{ - Name: ln, - Value: lv, - }) + s.lset = append(s.lset, labels.Label{Name: ln, Value: lv}) } - sort.Slice(s.lset, func(i, j int) bool { - return s.lset[i].Name < s.lset[j].Name - }) + sort.Sort(s.lset) for _, meta := range chks { if meta.MaxTime < req.MinTime { @@ -881,7 +868,7 @@ func (s *BucketStore) Series(req *storepb.SeriesRequest, srv storepb.Store_Serie defer s.queryGate.Done() } - matchers, err := promclient.TranslateMatchers(req.Matchers) + matchers, err := storepb.TranslateFromPromMatchers(req.Matchers...) if err != nil { return status.Error(codes.InvalidArgument, err.Error()) } @@ -905,7 +892,7 @@ func (s *BucketStore) Series(req *storepb.SeriesRequest, srv storepb.Store_Serie return status.Error(codes.InvalidArgument, errors.Wrap(err, "unmarshal series request hints").Error()) } - reqBlockMatchers, err = promclient.TranslateMatchers(reqHints.BlockMatchers) + reqBlockMatchers, err = storepb.TranslateFromPromMatchers(reqHints.BlockMatchers...) if err != nil { return status.Error(codes.InvalidArgument, errors.Wrap(err, "translate request hints labels matchers").Error()) } @@ -1019,15 +1006,16 @@ func (s *BucketStore) Series(req *storepb.SeriesRequest, srv storepb.Store_Serie stats.mergedSeriesCount++ + var lset labels.Labels if req.SkipChunks { - series.Labels, _ = set.At() + lset, _ = set.At() } else { - series.Labels, series.Chunks = set.At() + lset, series.Chunks = set.At() stats.mergedChunksCount += len(series.Chunks) s.metrics.chunkSizeBytes.Observe(float64(chunksSize(series.Chunks))) } - + series.Labels = labelpb.LabelsFromPromLabels(lset) if err = srv.Send(storepb.NewSeriesResponse(&series)); err != nil { err = status.Error(codes.Unknown, errors.Wrap(err, "send series response").Error()) return @@ -1342,7 +1330,17 @@ func newBucketBlock( }) sort.Sort(b.relabelLabels) - // Get object handles for all chunk files. + // Get object handles for all chunk files (segment files) from meta.json, if available. + if len(meta.Thanos.SegmentFiles) > 0 { + b.chunkObjs = make([]string, 0, len(meta.Thanos.SegmentFiles)) + + for _, sf := range meta.Thanos.SegmentFiles { + b.chunkObjs = append(b.chunkObjs, path.Join(meta.ULID.String(), block.ChunksDirname, sf)) + } + return b, nil + } + + // Get object handles for all chunk files from storage. if err = bkt.Iter(ctx, path.Join(meta.ULID.String(), block.ChunksDirname), func(n string) error { b.chunkObjs = append(b.chunkObjs, n) return nil @@ -1379,6 +1377,11 @@ func (b *bucketBlock) readChunkRange(ctx context.Context, seq int, off, length i if err != nil { return nil, errors.Wrap(err, "allocate chunk bytes") } + + if seq < 0 || seq >= len(b.chunkObjs) { + return nil, errors.Errorf("unknown segment file for index %d", seq) + } + buf := bytes.NewBuffer(*c) r, err := b.bkt.GetRange(ctx, b.chunkObjs[seq], off, length) diff --git a/vendor/github.com/thanos-io/thanos/pkg/store/local.go b/vendor/github.com/thanos-io/thanos/pkg/store/local.go index e50bcf6cd04..98f4b587857 100644 --- a/vendor/github.com/thanos-io/thanos/pkg/store/local.go +++ b/vendor/github.com/thanos-io/thanos/pkg/store/local.go @@ -22,6 +22,7 @@ import ( "github.com/thanos-io/thanos/pkg/component" "github.com/thanos-io/thanos/pkg/runutil" + "github.com/thanos-io/thanos/pkg/store/labelpb" "github.com/thanos-io/thanos/pkg/store/storepb" ) @@ -68,7 +69,7 @@ func NewLocalStoreFromJSONMmappableFile( c: f, info: &storepb.InfoResponse{ LabelSets: []storepb.LabelSet{ - {Labels: storepb.PromLabelsToLabelsUnsafe(extLabels)}, + {Labels: labelpb.LabelsFromPromLabels(extLabels)}, }, StoreType: component.ToProto(), MinTime: math.MaxInt64, @@ -168,7 +169,7 @@ func (s *LocalStore) Series(r *storepb.SeriesRequest, srv storepb.Store_SeriesSe var chosen []int for si, series := range s.series { - lbls := storepb.LabelsToPromLabelsUnsafe(series.Labels) + lbls := labelpb.LabelsToPromLabels(series.Labels) var noMatch bool for _, m := range matchers { extValue := lbls.Get(m.Name) @@ -236,7 +237,7 @@ func (s *LocalStore) LabelValues(_ context.Context, r *storepb.LabelValuesReques ) { vals := map[string]struct{}{} for _, series := range s.series { - lbls := storepb.LabelsToPromLabelsUnsafe(series.Labels) + lbls := labelpb.LabelsToPromLabels(series.Labels) val := lbls.Get(r.Label) if val == "" { continue diff --git a/vendor/github.com/thanos-io/thanos/pkg/store/multitsdb.go b/vendor/github.com/thanos-io/thanos/pkg/store/multitsdb.go index 26f3c593534..9fa504d0ed6 100644 --- a/vendor/github.com/thanos-io/thanos/pkg/store/multitsdb.go +++ b/vendor/github.com/thanos-io/thanos/pkg/store/multitsdb.go @@ -14,6 +14,7 @@ import ( "github.com/opentracing/opentracing-go" "github.com/pkg/errors" "github.com/prometheus/client_golang/prometheus" + "github.com/prometheus/prometheus/pkg/labels" tsdb_errors "github.com/prometheus/prometheus/tsdb/errors" "github.com/thanos-io/thanos/pkg/runutil" "golang.org/x/sync/errgroup" @@ -22,6 +23,7 @@ import ( "google.golang.org/grpc/status" "github.com/thanos-io/thanos/pkg/component" + "github.com/thanos-io/thanos/pkg/store/labelpb" "github.com/thanos-io/thanos/pkg/store/storepb" "github.com/thanos-io/thanos/pkg/tracing" ) @@ -178,11 +180,11 @@ func (s *tenantSeriesSetServer) Next() (ok bool) { return ok } -func (s *tenantSeriesSetServer) At() ([]storepb.Label, []storepb.AggrChunk) { +func (s *tenantSeriesSetServer) At() (labels.Labels, []storepb.AggrChunk) { if s.cur == nil { return nil, nil } - return s.cur.Labels, s.cur.Chunks + return s.cur.PromLabels(), s.cur.Chunks } func (s *tenantSeriesSetServer) Err() error { return s.err } @@ -241,9 +243,11 @@ func (s *MultiTSDBStore) Series(r *storepb.SeriesRequest, srv storepb.Store_Seri mergedSet := storepb.MergeSeriesSets(seriesSet...) for mergedSet.Next() { - var series storepb.Series - series.Labels, series.Chunks = mergedSet.At() - respSender.send(storepb.NewSeriesResponse(&series)) + lset, chks := mergedSet.At() + respSender.send(storepb.NewSeriesResponse(&storepb.Series{ + Labels: labelpb.LabelsFromPromLabels(lset), + Chunks: chks, + })) } return mergedSet.Err() }) diff --git a/vendor/github.com/thanos-io/thanos/pkg/store/prometheus.go b/vendor/github.com/thanos-io/thanos/pkg/store/prometheus.go index 9617111122b..78e10733a3d 100644 --- a/vendor/github.com/thanos-io/thanos/pkg/store/prometheus.go +++ b/vendor/github.com/thanos-io/thanos/pkg/store/prometheus.go @@ -28,6 +28,7 @@ import ( "github.com/prometheus/prometheus/pkg/labels" "github.com/prometheus/prometheus/storage/remote" "github.com/prometheus/prometheus/tsdb/chunkenc" + "github.com/thanos-io/thanos/pkg/store/labelpb" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -108,12 +109,7 @@ func (p *PrometheusStore) Info(_ context.Context, _ *storepb.InfoRequest) (*stor MinTime: mint, MaxTime: maxt, } - for _, l := range lset { - res.Labels = append(res.Labels, storepb.Label{ - Name: l.Name, - Value: l.Value, - }) - } + res.Labels = append(res.Labels, labelpb.LabelsFromPromLabels(lset)...) // Until we deprecate the single labels in the reply, we just duplicate // them here for migration/compatibility purposes. @@ -168,7 +164,7 @@ func (p *PrometheusStore) Series(r *storepb.SeriesRequest, s storepb.Store_Serie for k, v := range lbm { lset = append(lset, storepb.Label{Name: k, Value: v}) } - lset = append(lset, storepb.PromLabelsToLabelsUnsafe(externalLabels)...) + lset = append(lset, labelpb.LabelsFromPromLabels(externalLabels)...) sort.Slice(lset, func(i, j int) bool { return lset[i].Name < lset[j].Name }) @@ -236,8 +232,7 @@ func (p *PrometheusStore) handleSampledPrometheusResponse(s storepb.Store_Series span.SetTag("series_count", len(resp.Results[0].Timeseries)) for _, e := range resp.Results[0].Timeseries { - lset := p.translateAndExtendLabels(e.Labels, externalLabels) - + lset := labelpb.ExtendLabels(labelpb.LabelsToPromLabels(e.Labels), externalLabels) if len(e.Samples) == 0 { // As found in https://github.com/thanos-io/thanos/issues/381 // Prometheus can give us completely empty time series. Ignore these with log until we figure out that @@ -257,7 +252,7 @@ func (p *PrometheusStore) handleSampledPrometheusResponse(s storepb.Store_Series } if err := s.Send(storepb.NewSeriesResponse(&storepb.Series{ - Labels: lset, + Labels: labelpb.LabelsFromPromLabels(lset), Chunks: aggregatedChunks, })); err != nil { return err @@ -320,7 +315,9 @@ func (p *PrometheusStore) handleStreamedPrometheusResponse(s storepb.Store_Serie } if err := s.Send(storepb.NewSeriesResponse(&storepb.Series{ - Labels: p.translateAndExtendLabels(series.Labels, externalLabels), + Labels: labelpb.LabelsFromPromLabels( + labelpb.ExtendLabels(labelpb.LabelsToPromLabels(series.Labels), externalLabels), + ), Chunks: thanosChks, })); err != nil { return err @@ -444,18 +441,18 @@ func matchesExternalLabels(ms []storepb.LabelMatcher, externalLabels labels.Labe return true, ms, nil } + tms, err := storepb.TranslateFromPromMatchers(ms...) + if err != nil { + return false, nil, err + } + var newMatcher []storepb.LabelMatcher - for _, m := range ms { + for i, tm := range tms { // Validate all matchers. - tm, err := promclient.TranslateMatcher(m) - if err != nil { - return false, nil, err - } - - extValue := externalLabels.Get(m.Name) + extValue := externalLabels.Get(tm.Name) if extValue == "" { // Agnostic to external labels. - newMatcher = append(newMatcher, m) + newMatcher = append(newMatcher, ms[i]) continue } @@ -484,35 +481,6 @@ func (p *PrometheusStore) encodeChunk(ss []prompb.Sample) (storepb.Chunk_Encodin return storepb.Chunk_XOR, c.Bytes(), nil } -// translateAndExtendLabels transforms a metrics into a protobuf label set. It additionally -// attaches the given labels to it, overwriting existing ones on collision. -// Both input labels are expected to be sorted. -// -// NOTE(bwplotka): Don't use modify passed slices as we reuse underlying memory. -func (p *PrometheusStore) translateAndExtendLabels(m []prompb.Label, extend labels.Labels) []storepb.Label { - pbLabels := storepb.PrompbLabelsToLabelsUnsafe(m) - pbExtend := storepb.PromLabelsToLabelsUnsafe(extend) - - lset := make([]storepb.Label, 0, len(m)+len(extend)) - ei := 0 - -Outer: - for _, l := range pbLabels { - for ei < len(pbExtend) { - if l.Name < pbExtend[ei].Name { - break - } - lset = append(lset, pbExtend[ei]) - ei++ - if l.Name == pbExtend[ei-1].Name { - continue Outer - } - } - lset = append(lset, l) - } - return storepb.ExtendLabels(lset, extend) -} - // LabelNames returns all known label names. func (p *PrometheusStore) LabelNames(ctx context.Context, r *storepb.LabelNamesRequest) (*storepb.LabelNamesResponse, error) { lbls, err := p.client.LabelNamesInGRPC(ctx, p.base, r.Start, r.End) diff --git a/vendor/github.com/thanos-io/thanos/pkg/store/proxy.go b/vendor/github.com/thanos-io/thanos/pkg/store/proxy.go index 6a590376998..9c9bfe2b743 100644 --- a/vendor/github.com/thanos-io/thanos/pkg/store/proxy.go +++ b/vendor/github.com/thanos-io/thanos/pkg/store/proxy.go @@ -8,7 +8,6 @@ import ( "fmt" "io" "math" - "sort" "strings" "sync" "time" @@ -22,11 +21,12 @@ import ( "github.com/prometheus/client_golang/prometheus/promauto" "github.com/prometheus/prometheus/pkg/labels" "github.com/thanos-io/thanos/pkg/component" - "github.com/thanos-io/thanos/pkg/promclient" + "github.com/thanos-io/thanos/pkg/store/labelpb" "github.com/thanos-io/thanos/pkg/store/storepb" "github.com/thanos-io/thanos/pkg/strutil" "github.com/thanos-io/thanos/pkg/tracing" "golang.org/x/sync/errgroup" + "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) @@ -42,7 +42,7 @@ type Client interface { storepb.StoreClient // LabelSets that each apply to some data exposed by the backing store. - LabelSets() []storepb.LabelSet + LabelSets() []labels.Labels // Minimum and maximum time range of data in the store. TimeRange() (mint int64, maxt int64) @@ -78,6 +78,12 @@ func newProxyStoreMetrics(reg prometheus.Registerer) *proxyStoreMetrics { return &m } +func RegisterStoreServer(storeSrv storepb.StoreServer) func(*grpc.Server) { + return func(s *grpc.Server) { + storepb.RegisterStoreServer(s, storeSrv) + } +} + // NewProxyStore returns a new ProxyStore that uses the given clients that implements storeAPI to fan-in all series to the client. // Note that there is no deduplication support. Deduplication should be done on the highest level (just before PromQL). func NewProxyStore( @@ -107,8 +113,8 @@ func NewProxyStore( // Info returns store information about the external labels this store have. func (s *ProxyStore) Info(_ context.Context, _ *storepb.InfoRequest) (*storepb.InfoResponse, error) { res := &storepb.InfoResponse{ - Labels: make([]storepb.Label, 0, len(s.selectorLabels)), StoreType: s.component.ToProto(), + Labels: labelpb.LabelsFromPromLabels(s.selectorLabels), } minTime := int64(math.MaxInt64) @@ -136,26 +142,17 @@ func (s *ProxyStore) Info(_ context.Context, _ *storepb.InfoRequest) (*storepb.I res.MaxTime = maxTime res.MinTime = minTime - for _, l := range s.selectorLabels { - res.Labels = append(res.Labels, storepb.Label{ - Name: l.Name, - Value: l.Value, - }) - } - - labelSets := make(map[uint64][]storepb.Label, len(stores)) + labelSets := make(map[uint64]storepb.LabelSet, len(stores)) for _, st := range stores { - for _, labelSet := range st.LabelSets() { - mergedLabelSet := mergeLabels(labelSet.Labels, s.selectorLabels) - ls := storepb.LabelsToPromLabels(mergedLabelSet) - sort.Sort(ls) - labelSets[ls.Hash()] = mergedLabelSet + for _, lset := range st.LabelSets() { + mergedLabelSet := labelpb.ExtendLabels(lset, s.selectorLabels) + labelSets[mergedLabelSet.Hash()] = storepb.LabelSet{Labels: labelpb.LabelsFromPromLabels(mergedLabelSet)} } } res.LabelSets = make([]storepb.LabelSet, 0, len(labelSets)) for _, v := range labelSets { - res.LabelSets = append(res.LabelSets, storepb.LabelSet{Labels: v}) + res.LabelSets = append(res.LabelSets, v) } // We always want to enforce announcing the subset of data that @@ -169,26 +166,6 @@ func (s *ProxyStore) Info(_ context.Context, _ *storepb.InfoRequest) (*storepb.I return res, nil } -// mergeLabels merges label-set a and label-selector b with the selector's -// labels having precedence. The types are distinct because of the inputs at -// hand where this function is used. -func mergeLabels(a []storepb.Label, b labels.Labels) []storepb.Label { - ls := map[string]string{} - for _, l := range a { - ls[l.Name] = l.Value - } - for _, l := range b { - ls[l.Name] = l.Value - } - - res := []storepb.Label{} - for k, v := range ls { - res = append(res, storepb.Label{Name: k, Value: v}) - } - - return res -} - // cancelableRespSender is a response channel that does need to be exhausted on cancel. type cancelableRespSender struct { ctx context.Context @@ -260,14 +237,14 @@ func (s *ProxyStore) Series(r *storepb.SeriesRequest, srv storepb.Store_SeriesSe // NOTE: all matchers are validated in matchesExternalLabels method so we explicitly ignore error. var ok bool tracing.DoInSpan(gctx, "store_matches", func(ctx context.Context) { - storeMatcher := [][]storepb.LabelMatcher{} + var storeDebugMatcher [][]*labels.Matcher if ctxVal := srv.Context().Value(StoreMatcherKey); ctxVal != nil { - if value, ok := ctxVal.([][]storepb.LabelMatcher); ok { - storeMatcher = value + if value, ok := ctxVal.([][]*labels.Matcher); ok { + storeDebugMatcher = value } } // We can skip error, we already translated matchers once. - ok, _ = storeMatches(st, r.MinTime, r.MaxTime, storeMatcher, r.Matchers...) + ok, _ = storeMatches(st, r.MinTime, r.MaxTime, storeDebugMatcher, r.Matchers...) }) if !ok { storeDebugMsgs = append(storeDebugMsgs, fmt.Sprintf("store %s filtered out", st)) @@ -284,7 +261,7 @@ func (s *ProxyStore) Series(r *storepb.SeriesRequest, srv storepb.Store_SeriesSe sc, err := st.Series(seriesCtx, r) if err != nil { - storeID := storepb.LabelSetsToString(st.LabelSets()) + storeID := labelpb.PromLabelSetsToString(st.LabelSets()) if storeID == "" { storeID = "Store Gateway" } @@ -318,9 +295,8 @@ func (s *ProxyStore) Series(r *storepb.SeriesRequest, srv storepb.Store_SeriesSe // Series are not necessarily merged across themselves. mergedSet := storepb.MergeSeriesSets(seriesSet...) for mergedSet.Next() { - var series storepb.Series - series.Labels, series.Chunks = mergedSet.At() - respSender.send(storepb.NewSeriesResponse(&series)) + lset, chk := mergedSet.At() + respSender.send(storepb.NewSeriesResponse(&storepb.Series{Labels: labelpb.LabelsFromPromLabels(lset), Chunks: chk})) } return mergedSet.Err() }) @@ -494,11 +470,11 @@ func (s *streamSeriesSet) Next() (ok bool) { return ok } -func (s *streamSeriesSet) At() ([]storepb.Label, []storepb.AggrChunk) { +func (s *streamSeriesSet) At() (labels.Labels, []storepb.AggrChunk) { if s.currSeries == nil { return nil, nil } - return s.currSeries.Labels, s.currSeries.Chunks + return s.currSeries.PromLabels(), s.currSeries.Chunks } func (s *streamSeriesSet) Err() error { @@ -507,80 +483,56 @@ func (s *streamSeriesSet) Err() error { return errors.Wrap(s.err, s.name) } -// matchStore returns true if the given store may hold data for the given label -// matchers. -func storeMatches(s Client, mint, maxt int64, storeMatcher [][]storepb.LabelMatcher, matchers ...storepb.LabelMatcher) (bool, error) { +// matchStore returns true if the given store may hold data for the given label matchers. +func storeMatches(s Client, mint, maxt int64, storeDebugMatchers [][]*labels.Matcher, matchers ...storepb.LabelMatcher) (bool, error) { storeMinTime, storeMaxTime := s.TimeRange() if mint > storeMaxTime || maxt <= storeMinTime { return false, nil } - match, err := storeMatchMetadata(s, storeMatcher) - // Return result here if no matchers set. - if len(matchers) == 0 || err != nil || !match { - return match, err - } - return labelSetsMatch(s.LabelSets(), matchers) -} -// storeMatch return true if the store's metadata labels match the storeMatcher. -func storeMatchMetadata(s Client, storeMatcher [][]storepb.LabelMatcher) (bool, error) { - clientLabels := generateMetadataClientLabels(s) - if len(storeMatcher) == 0 { - return true, nil - } - res := false - for _, stm := range storeMatcher { - stmMatch, err := labelSetMatches(clientLabels, stm) - if err != nil { - return false, err - } - res = res || stmMatch + if !storeMatchDebugMetadata(s, storeDebugMatchers) { + return false, nil } - return res, nil -} -func generateMetadataClientLabels(s Client) storepb.LabelSet { - l := storepb.Label{Name: "__address__", Value: s.Addr()} - return storepb.LabelSet{Labels: []storepb.Label{l}} + promMatchers, err := storepb.TranslateFromPromMatchers(matchers...) + if err != nil { + return false, err + } + return labelSetsMatch(promMatchers, s.LabelSets()...), nil } -// labelSetsMatch returns false if all label-set do not match the matchers. -func labelSetsMatch(lss []storepb.LabelSet, matchers []storepb.LabelMatcher) (bool, error) { - if len(lss) == 0 { - return true, nil +// storeMatchDebugMetadata return true if the store's address match the storeDebugMatchers. +func storeMatchDebugMetadata(s Client, storeDebugMatchers [][]*labels.Matcher) bool { + if len(storeDebugMatchers) == 0 { + return true } - res := false - for _, ls := range lss { - lsMatch, err := labelSetMatches(ls, matchers) - if err != nil { - return false, err - } - res = res || lsMatch + match := false + for _, sm := range storeDebugMatchers { + match = match || labelSetsMatch(sm, labels.FromStrings("__address__", s.Addr())) } - return res, nil + return match } -// labelSetMatches returns false if any matcher matches negatively against the -// respective label-value for the matcher's label-name. -func labelSetMatches(ls storepb.LabelSet, matchers []storepb.LabelMatcher) (bool, error) { - for _, m := range matchers { - for _, l := range ls.Labels { - if l.Name != m.Name { - continue - } - - m, err := promclient.TranslateMatcher(m) - if err != nil { - return false, err - } +// labelSetsMatch returns false if all label-set do not match the matchers (aka: OR is between all label-sets). +func labelSetsMatch(matchers []*labels.Matcher, lss ...labels.Labels) bool { + if len(lss) == 0 { + return true + } - if !m.Matches(l.Value) { - return false, nil + for _, ls := range lss { + notMatched := false + for _, m := range matchers { + if lv := ls.Get(m.Name); lv != "" && !m.Matches(lv) { + notMatched = true + break } } + if !notMatched { + return true + } } - return true, nil + return false } // LabelNames returns all known label names. @@ -599,14 +551,14 @@ func (s *ProxyStore) LabelNames(ctx context.Context, r *storepb.LabelNamesReques st := st var ok bool tracing.DoInSpan(gctx, "store_matches", func(ctx context.Context) { - storeMatcher := [][]storepb.LabelMatcher{} + var storeDebugMatcher [][]*labels.Matcher if ctxVal := ctx.Value(StoreMatcherKey); ctxVal != nil { - if value, ok := ctxVal.([][]storepb.LabelMatcher); ok { - storeMatcher = value + if value, ok := ctxVal.([][]*labels.Matcher); ok { + storeDebugMatcher = value } } // We can skip error, we already translated matchers once. - ok, _ = storeMatches(st, r.Start, r.End, storeMatcher) + ok, _ = storeMatches(st, r.Start, r.End, storeDebugMatcher) }) if !ok { storeDebugMsgs = append(storeDebugMsgs, fmt.Sprintf("Store %s filtered out", st)) @@ -668,14 +620,14 @@ func (s *ProxyStore) LabelValues(ctx context.Context, r *storepb.LabelValuesRequ store := st var ok bool tracing.DoInSpan(gctx, "store_matches", func(ctx context.Context) { - storeMatcher := [][]storepb.LabelMatcher{} + var storeDebugMatcher [][]*labels.Matcher if ctxVal := ctx.Value(StoreMatcherKey); ctxVal != nil { - if value, ok := ctxVal.([][]storepb.LabelMatcher); ok { - storeMatcher = value + if value, ok := ctxVal.([][]*labels.Matcher); ok { + storeDebugMatcher = value } } // We can skip error, we already translated matchers once. - ok, _ = storeMatches(st, r.Start, r.End, storeMatcher) + ok, _ = storeMatches(st, r.Start, r.End, storeDebugMatcher) }) if !ok { storeDebugMsgs = append(storeDebugMsgs, fmt.Sprintf("Store %s filtered out", st)) diff --git a/vendor/github.com/thanos-io/thanos/pkg/store/storepb/custom.go b/vendor/github.com/thanos-io/thanos/pkg/store/storepb/custom.go index 61214a611fb..8b1f13366c1 100644 --- a/vendor/github.com/thanos-io/thanos/pkg/store/storepb/custom.go +++ b/vendor/github.com/thanos-io/thanos/pkg/store/storepb/custom.go @@ -9,12 +9,11 @@ import ( "sort" "strconv" "strings" - "unsafe" "github.com/gogo/protobuf/types" "github.com/pkg/errors" "github.com/prometheus/prometheus/pkg/labels" - "github.com/thanos-io/thanos/pkg/store/storepb/prompb" + "github.com/thanos-io/thanos/pkg/store/labelpb" ) var PartialResponseStrategyValues = func() []string { @@ -50,30 +49,11 @@ func NewHintsSeriesResponse(hints *types.Any) *SeriesResponse { } } -// CompareLabels compares two sets of labels. -// After lexicographical order, the set with fewer labels comes first. -func CompareLabels(a, b []Label) int { - l := len(a) - if len(b) < l { - l = len(b) - } - for i := 0; i < l; i++ { - if d := strings.Compare(a[i].Name, b[i].Name); d != 0 { - return d - } - if d := strings.Compare(a[i].Value, b[i].Value); d != 0 { - return d - } - } - - return len(a) - len(b) -} - type emptySeriesSet struct{} -func (emptySeriesSet) Next() bool { return false } -func (emptySeriesSet) At() ([]Label, []AggrChunk) { return nil, nil } -func (emptySeriesSet) Err() error { return nil } +func (emptySeriesSet) Next() bool { return false } +func (emptySeriesSet) At() (labels.Labels, []AggrChunk) { return nil, nil } +func (emptySeriesSet) Err() error { return nil } // EmptySeriesSet returns a new series set that contains no series. func EmptySeriesSet() SeriesSet { @@ -112,7 +92,7 @@ func MergeSeriesSets(all ...SeriesSet) SeriesSet { // The set is sorted by the label sets. Chunks may be overlapping or expected of order. type SeriesSet interface { Next() bool - At() ([]Label, []AggrChunk) + At() (labels.Labels, []AggrChunk) Err() error } @@ -120,7 +100,7 @@ type SeriesSet interface { type mergedSeriesSet struct { a, b SeriesSet - lset []Label + lset labels.Labels chunks []AggrChunk adone, bdone bool } @@ -135,7 +115,7 @@ func newMergedSeriesSet(a, b SeriesSet) *mergedSeriesSet { return s } -func (s *mergedSeriesSet) At() ([]Label, []AggrChunk) { +func (s *mergedSeriesSet) At() (labels.Labels, []AggrChunk) { return s.lset, s.chunks } @@ -155,7 +135,7 @@ func (s *mergedSeriesSet) compare() int { } lsetA, _ := s.a.At() lsetB, _ := s.b.At() - return CompareLabels(lsetA, lsetB) + return labels.Compare(lsetA, lsetB) } func (s *mergedSeriesSet) Next() bool { @@ -228,7 +208,7 @@ type uniqueSeriesSet struct { peek *Series - lset []Label + lset labels.Labels chunks []AggrChunk } @@ -236,7 +216,7 @@ func newUniqueSeriesSet(wrapped SeriesSet) *uniqueSeriesSet { return &uniqueSeriesSet{SeriesSet: wrapped} } -func (s *uniqueSeriesSet) At() ([]Label, []AggrChunk) { +func (s *uniqueSeriesSet) At() (labels.Labels, []AggrChunk) { return s.lset, s.chunks } @@ -251,13 +231,13 @@ func (s *uniqueSeriesSet) Next() bool { } lset, chks := s.SeriesSet.At() if s.peek == nil { - s.peek = &Series{Labels: lset, Chunks: chks} + s.peek = &Series{Labels: labelpb.LabelsFromPromLabels(lset), Chunks: chks} continue } - if CompareLabels(lset, s.peek.Labels) != 0 { - s.lset, s.chunks = s.peek.Labels, s.peek.Chunks - s.peek = &Series{Labels: lset, Chunks: chks} + if labels.Compare(lset, s.peek.PromLabels()) != 0 { + s.lset, s.chunks = s.peek.PromLabels(), s.peek.Chunks + s.peek = &Series{Labels: labelpb.LabelsFromPromLabels(lset), Chunks: chks} return true } @@ -270,7 +250,7 @@ func (s *uniqueSeriesSet) Next() bool { return false } - s.lset, s.chunks = s.peek.Labels, s.peek.Chunks + s.lset, s.chunks = s.peek.PromLabels(), s.peek.Chunks s.peek = nil return true } @@ -333,66 +313,6 @@ func (m *Chunk) Compare(b *Chunk) int { return bytes.Compare(m.Data, b.Data) } -// LabelsToPromLabels converts Thanos proto labels to Prometheus labels in type safe manner. -// NOTE: It allocates memory. -func LabelsToPromLabels(lset []Label) labels.Labels { - ret := make(labels.Labels, len(lset)) - for i, l := range lset { - ret[i] = labels.Label{Name: l.Name, Value: l.Value} - } - return ret -} - -// LabelsToPromLabelsUnsafe converts Thanos proto labels to Prometheus labels in type unsafe manner. -// It reuses the same memory. Caller should abort using passed []Labels. -// -// NOTE: This depends on order of struct fields etc, so use with extreme care. -func LabelsToPromLabelsUnsafe(lset []Label) labels.Labels { - return *(*[]labels.Label)(unsafe.Pointer(&lset)) -} - -// PromLabelsToLabels converts Prometheus labels to Thanos proto labels in type safe manner. -// NOTE: It allocates memory. -func PromLabelsToLabels(lset labels.Labels) []Label { - ret := make([]Label, len(lset)) - for i, l := range lset { - ret[i] = Label{Name: l.Name, Value: l.Value} - } - return ret -} - -// PromLabelsToLabelsUnsafe converts Prometheus labels to Thanos proto labels in type unsafe manner. -// It reuses the same memory. Caller should abort using passed labels.Labels. -// -// NOTE: This depends on order of struct fields etc, so use with extreme care. -func PromLabelsToLabelsUnsafe(lset labels.Labels) []Label { - return *(*[]Label)(unsafe.Pointer(&lset)) -} - -// PrompbLabelsToLabelsUnsafe converts Prometheus proto labels to Thanos proto labels in type unsafe manner. -// It reuses the same memory. Caller should abort using passed labels.Labels. -// -// NOTE: This depends on order of struct fields etc, so use with extreme care. -func PrompbLabelsToLabelsUnsafe(lset []prompb.Label) []Label { - return *(*[]Label)(unsafe.Pointer(&lset)) -} - -func LabelsToString(lset []Label) string { - var s []string - for _, l := range lset { - s = append(s, l.String()) - } - return "[" + strings.Join(s, ",") + "]" -} - -func LabelSetsToString(lsets []LabelSet) string { - s := []string{} - for _, ls := range lsets { - s = append(s, LabelsToString(ls.Labels)) - } - return strings.Join(s, "") -} - func (x *PartialResponseStrategy) UnmarshalJSON(entry []byte) error { fieldStr, err := strconv.Unquote(string(entry)) if err != nil { @@ -417,34 +337,6 @@ func (x *PartialResponseStrategy) MarshalJSON() ([]byte, error) { return []byte(strconv.Quote(x.String())), nil } -// ExtendLabels extend given labels by extend in labels format. -// The type conversion is done safely, which means we don't modify extend labels underlying array. -// -// In case of existing labels already present in given label set, it will be overwritten by external one. -func ExtendLabels(lset []Label, extend labels.Labels) []Label { - overwritten := map[string]struct{}{} - for i, l := range lset { - if v := extend.Get(l.Name); v != "" { - lset[i].Value = v - overwritten[l.Name] = struct{}{} - } - } - - for _, l := range extend { - if _, ok := overwritten[l.Name]; ok { - continue - } - lset = append(lset, Label{ - Name: l.Name, - Value: l.Value, - }) - } - sort.Slice(lset, func(i, j int) bool { - return lset[i].Name < lset[j].Name - }) - return lset -} - // TranslatePromMatchers returns proto matchers from Prometheus matchers. // NOTE: It allocates memory. func TranslatePromMatchers(ms ...*labels.Matcher) ([]LabelMatcher, error) { @@ -471,6 +363,7 @@ func TranslatePromMatchers(ms ...*labels.Matcher) ([]LabelMatcher, error) { // TranslateFromPromMatchers returns Prometheus matchers from proto matchers. // NOTE: It allocates memory. +// TODO(bwplotka): Create yolo/no-alloc helper. func TranslateFromPromMatchers(ms ...LabelMatcher) ([]*labels.Matcher, error) { res := make([]*labels.Matcher, 0, len(ms)) for _, m := range ms { @@ -486,9 +379,81 @@ func TranslateFromPromMatchers(ms ...LabelMatcher) ([]*labels.Matcher, error) { case LabelMatcher_NRE: t = labels.MatchNotRegexp default: - return nil, errors.Errorf("unrecognized matcher type %d", m.Type) + return nil, errors.Errorf("unrecognized label matcher type %d", m.Type) + } + m, err := labels.NewMatcher(t, m.Name, m.Value) + if err != nil { + return nil, err } - res = append(res, &labels.Matcher{Type: t, Name: m.Name, Value: m.Value}) + res = append(res, m) } return res, nil } + +// MatchersToString converts label matchers to string format. +// String should be parsable as a valid PromQL query metric selector. +func MatchersToString(ms ...LabelMatcher) string { + var res string + for i, m := range ms { + res += m.PromString() + if i < len(ms)-1 { + res += ", " + } + } + return "{" + res + "}" +} + +// PromMatchersToString converts prometheus label matchers to string format. +// String should be parsable as a valid PromQL query metric selector. +func PromMatchersToString(ms ...*labels.Matcher) string { + var res string + for i, m := range ms { + res += m.String() + if i < len(ms)-1 { + res += ", " + } + } + return "{" + res + "}" +} + +func (m *LabelMatcher) PromString() string { + return fmt.Sprintf("%s%s%q", m.Name, m.Type.PromString(), m.Value) +} + +func (x LabelMatcher_Type) PromString() string { + typeToStr := map[LabelMatcher_Type]string{ + LabelMatcher_EQ: "=", + LabelMatcher_NEQ: "!=", + LabelMatcher_RE: "=~", + LabelMatcher_NRE: "!~", + } + if str, ok := typeToStr[x]; ok { + return str + } + panic("unknown match type") +} + +// PromLabels return Prometheus labels.Labels without extra allocation. +func (m *Series) PromLabels() labels.Labels { + return labelpb.LabelsToPromLabels(m.Labels) +} + +// Deprecated. +// TODO(bwplotka): Remove this once Cortex dep will stop using it. +type Label = labelpb.Label + +// Deprecated. +// TODO(bwplotka): Remove this in next PR. Done to reduce diff only. +type LabelSet = labelpb.LabelSet + +// Deprecated. +// TODO(bwplotka): Remove this once Cortex dep will stop using it. +func CompareLabels(a, b []Label) int { + return labels.Compare(labelpb.LabelsToPromLabels(a), labelpb.LabelsToPromLabels(b)) +} + +// Deprecated. +// TODO(bwplotka): Remove this once Cortex dep will stop using it. +func LabelsToPromLabelsUnsafe(lset []Label) labels.Labels { + return labelpb.LabelsToPromLabels(lset) +} diff --git a/vendor/github.com/thanos-io/thanos/pkg/store/storepb/prompb/types.pb.go b/vendor/github.com/thanos-io/thanos/pkg/store/storepb/prompb/types.pb.go index 40ac8393677..6916e78ec2f 100644 --- a/vendor/github.com/thanos-io/thanos/pkg/store/storepb/prompb/types.pb.go +++ b/vendor/github.com/thanos-io/thanos/pkg/store/storepb/prompb/types.pb.go @@ -12,6 +12,8 @@ import ( _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" + _ "github.com/thanos-io/thanos/pkg/store/labelpb" + github_com_thanos_io_thanos_pkg_store_labelpb "github.com/thanos-io/thanos/pkg/store/labelpb" ) // Reference imports to suppress errors if they are not otherwise used. @@ -53,7 +55,7 @@ func (x LabelMatcher_Type) String() string { } func (LabelMatcher_Type) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_166e07899dab7c14, []int{4, 0} + return fileDescriptor_166e07899dab7c14, []int{2, 0} } // We require this to match chunkenc.Encoding. @@ -79,7 +81,7 @@ func (x Chunk_Encoding) String() string { } func (Chunk_Encoding) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_166e07899dab7c14, []int{6, 0} + return fileDescriptor_166e07899dab7c14, []int{4, 0} } type Sample struct { @@ -136,8 +138,8 @@ func (m *Sample) GetTimestamp() int64 { // TimeSeries represents samples and labels for a single time series. type TimeSeries struct { - Labels []Label `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels"` - Samples []Sample `protobuf:"bytes,2,rep,name=samples,proto3" json:"samples"` + Labels []github_com_thanos_io_thanos_pkg_store_labelpb.Label `protobuf:"bytes,1,rep,name=labels,proto3,customtype=github.com/thanos-io/thanos/pkg/store/labelpb.Label" json:"labels"` + Samples []Sample `protobuf:"bytes,2,rep,name=samples,proto3" json:"samples"` } func (m *TimeSeries) Reset() { *m = TimeSeries{} } @@ -173,13 +175,6 @@ func (m *TimeSeries) XXX_DiscardUnknown() { var xxx_messageInfo_TimeSeries proto.InternalMessageInfo -func (m *TimeSeries) GetLabels() []Label { - if m != nil { - return m.Labels - } - return nil -} - func (m *TimeSeries) GetSamples() []Sample { if m != nil { return m.Samples @@ -187,102 +182,6 @@ func (m *TimeSeries) GetSamples() []Sample { return nil } -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 (m *Label) String() string { return proto.CompactTextString(m) } -func (*Label) ProtoMessage() {} -func (*Label) Descriptor() ([]byte, []int) { - return fileDescriptor_166e07899dab7c14, []int{2} -} -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 - -func (m *Label) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *Label) GetValue() string { - if m != nil { - return m.Value - } - return "" -} - -type Labels struct { - Labels []Label `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels"` -} - -func (m *Labels) Reset() { *m = Labels{} } -func (m *Labels) String() string { return proto.CompactTextString(m) } -func (*Labels) ProtoMessage() {} -func (*Labels) Descriptor() ([]byte, []int) { - return fileDescriptor_166e07899dab7c14, []int{3} -} -func (m *Labels) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Labels) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Labels.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 *Labels) XXX_Merge(src proto.Message) { - xxx_messageInfo_Labels.Merge(m, src) -} -func (m *Labels) XXX_Size() int { - return m.Size() -} -func (m *Labels) XXX_DiscardUnknown() { - xxx_messageInfo_Labels.DiscardUnknown(m) -} - -var xxx_messageInfo_Labels proto.InternalMessageInfo - -func (m *Labels) GetLabels() []Label { - if m != nil { - return m.Labels - } - 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"` @@ -294,7 +193,7 @@ func (m *LabelMatcher) Reset() { *m = LabelMatcher{} } func (m *LabelMatcher) String() string { return proto.CompactTextString(m) } func (*LabelMatcher) ProtoMessage() {} func (*LabelMatcher) Descriptor() ([]byte, []int) { - return fileDescriptor_166e07899dab7c14, []int{4} + return fileDescriptor_166e07899dab7c14, []int{2} } func (m *LabelMatcher) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -358,7 +257,7 @@ func (m *ReadHints) Reset() { *m = ReadHints{} } func (m *ReadHints) String() string { return proto.CompactTextString(m) } func (*ReadHints) ProtoMessage() {} func (*ReadHints) Descriptor() ([]byte, []int) { - return fileDescriptor_166e07899dab7c14, []int{5} + return fileDescriptor_166e07899dab7c14, []int{3} } func (m *ReadHints) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -449,7 +348,7 @@ func (m *Chunk) Reset() { *m = Chunk{} } func (m *Chunk) String() string { return proto.CompactTextString(m) } func (*Chunk) ProtoMessage() {} func (*Chunk) Descriptor() ([]byte, []int) { - return fileDescriptor_166e07899dab7c14, []int{6} + return fileDescriptor_166e07899dab7c14, []int{4} } func (m *Chunk) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -509,7 +408,7 @@ func (m *Chunk) GetData() []byte { // ChunkedSeries represents single, encoded time series. type ChunkedSeries struct { // Labels should be sorted. - Labels []Label `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels"` + Labels []github_com_thanos_io_thanos_pkg_store_labelpb.Label `protobuf:"bytes,1,rep,name=labels,proto3,customtype=github.com/thanos-io/thanos/pkg/store/labelpb.Label" json:"labels"` // Chunks will be in start time order and may overlap. Chunks []Chunk `protobuf:"bytes,2,rep,name=chunks,proto3" json:"chunks"` } @@ -518,7 +417,7 @@ func (m *ChunkedSeries) Reset() { *m = ChunkedSeries{} } func (m *ChunkedSeries) String() string { return proto.CompactTextString(m) } func (*ChunkedSeries) ProtoMessage() {} func (*ChunkedSeries) Descriptor() ([]byte, []int) { - return fileDescriptor_166e07899dab7c14, []int{7} + return fileDescriptor_166e07899dab7c14, []int{5} } func (m *ChunkedSeries) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -547,13 +446,6 @@ func (m *ChunkedSeries) XXX_DiscardUnknown() { var xxx_messageInfo_ChunkedSeries proto.InternalMessageInfo -func (m *ChunkedSeries) GetLabels() []Label { - if m != nil { - return m.Labels - } - return nil -} - func (m *ChunkedSeries) GetChunks() []Chunk { if m != nil { return m.Chunks @@ -566,8 +458,6 @@ func init() { proto.RegisterEnum("prometheus_copy.Chunk_Encoding", Chunk_Encoding_name, Chunk_Encoding_value) proto.RegisterType((*Sample)(nil), "prometheus_copy.Sample") proto.RegisterType((*TimeSeries)(nil), "prometheus_copy.TimeSeries") - proto.RegisterType((*Label)(nil), "prometheus_copy.Label") - proto.RegisterType((*Labels)(nil), "prometheus_copy.Labels") proto.RegisterType((*LabelMatcher)(nil), "prometheus_copy.LabelMatcher") proto.RegisterType((*ReadHints)(nil), "prometheus_copy.ReadHints") proto.RegisterType((*Chunk)(nil), "prometheus_copy.Chunk") @@ -577,43 +467,45 @@ func init() { func init() { proto.RegisterFile("store/storepb/prompb/types.proto", fileDescriptor_166e07899dab7c14) } var fileDescriptor_166e07899dab7c14 = []byte{ - // 574 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0xc1, 0x6e, 0xd3, 0x40, - 0x10, 0xcd, 0xda, 0x89, 0x9d, 0x4c, 0x4b, 0x89, 0x56, 0xa5, 0x35, 0x15, 0x72, 0x2d, 0x9f, 0x7c, - 0x4a, 0x44, 0x5b, 0xc1, 0x05, 0x71, 0x28, 0x8a, 0x84, 0x44, 0x9d, 0xaa, 0xdb, 0x22, 0x10, 0x97, - 0x6a, 0x1d, 0x2f, 0xae, 0x45, 0xbc, 0xb6, 0xbc, 0x1b, 0xd4, 0xa8, 0x3f, 0xc1, 0x99, 0xbf, 0x80, - 0xaf, 0xe8, 0xb1, 0x47, 0x4e, 0x08, 0x25, 0x3f, 0x82, 0x76, 0xed, 0x24, 0x88, 0xe6, 0x04, 0x97, - 0x68, 0x66, 0xde, 0x9b, 0x37, 0xcf, 0x9e, 0x89, 0xc1, 0x13, 0x32, 0x2f, 0x59, 0x5f, 0xff, 0x16, - 0x51, 0xbf, 0x28, 0xf3, 0xac, 0x88, 0xfa, 0x72, 0x5a, 0x30, 0xd1, 0x2b, 0xca, 0x5c, 0xe6, 0xf8, - 0xa1, 0xaa, 0x31, 0x79, 0xc5, 0x26, 0xe2, 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, 0x1d, 0xfb, 0x1e, 0xb4, 0x17, 0x2c, 0xbc, 0x01, 0xf6, 0xdb, 0xe1, 0x9b, 0xe1, - 0xe9, 0xbb, 0x61, 0xf5, 0xe6, 0xdf, 0x9f, 0x92, 0x2e, 0xf2, 0x6f, 0xe0, 0x81, 0x56, 0x63, 0xf1, - 0x7f, 0x1d, 0xfe, 0x11, 0x58, 0x23, 0x25, 0xb3, 0xb8, 0xfb, 0x9d, 0xf5, 0x9e, 0x17, 0x5d, 0x15, - 0xf7, 0xd8, 0xbb, 0x9d, 0xb9, 0xe8, 0x6e, 0xe6, 0xa2, 0x5f, 0x33, 0x17, 0x7d, 0x99, 0xbb, 0x8d, - 0xbb, 0xb9, 0xdb, 0xf8, 0x31, 0x77, 0x1b, 0x1f, 0xac, 0xea, 0x2b, 0x10, 0x59, 0xfa, 0x9f, 0x7d, - 0xf8, 0x3b, 0x00, 0x00, 0xff, 0xff, 0xda, 0x37, 0x89, 0x1e, 0x24, 0x04, 0x00, 0x00, + // 604 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x54, 0xcd, 0x6e, 0xd3, 0x4c, + 0x14, 0xcd, 0xc4, 0x89, 0x93, 0x4c, 0xfb, 0xf5, 0x8b, 0x46, 0x2d, 0x4d, 0x2b, 0xe4, 0x5a, 0x5e, + 0x65, 0x83, 0x2d, 0xb5, 0x08, 0x16, 0xb0, 0x6a, 0x15, 0x84, 0x04, 0x49, 0xd5, 0x69, 0x11, 0x88, + 0x4d, 0x35, 0x4e, 0x06, 0xc7, 0x34, 0x9e, 0x19, 0x79, 0xc6, 0xa8, 0x79, 0x0b, 0xd6, 0xbc, 0x05, + 0x3c, 0x45, 0x97, 0x5d, 0x22, 0x16, 0x15, 0x6a, 0x5f, 0x04, 0xcd, 0xb5, 0xd3, 0x50, 0xca, 0x9e, + 0x4d, 0x74, 0x7f, 0xce, 0x9c, 0x73, 0xff, 0x62, 0xec, 0x6b, 0x23, 0x73, 0x1e, 0xc1, 0xaf, 0x8a, + 0x23, 0x95, 0xcb, 0x4c, 0xc5, 0x91, 0x99, 0x2b, 0xae, 0x43, 0x95, 0x4b, 0x23, 0xc9, 0xff, 0x36, + 0xc6, 0xcd, 0x94, 0x17, 0xfa, 0x74, 0x2c, 0xd5, 0x7c, 0x7b, 0x3d, 0x91, 0x89, 0x84, 0x5c, 0x64, + 0xad, 0x12, 0xb6, 0xbd, 0x55, 0x12, 0xcd, 0x58, 0xcc, 0x67, 0x77, 0x19, 0x82, 0xe7, 0xd8, 0x3d, + 0x66, 0x99, 0x9a, 0x71, 0xb2, 0x8e, 0x9b, 0x9f, 0xd8, 0xac, 0xe0, 0x3d, 0xe4, 0xa3, 0x3e, 0xa2, + 0xa5, 0x43, 0x1e, 0xe2, 0x8e, 0x49, 0x33, 0xae, 0x0d, 0xcb, 0x54, 0xaf, 0xee, 0xa3, 0xbe, 0x43, + 0x97, 0x81, 0xe0, 0x2b, 0xc2, 0xf8, 0x24, 0xcd, 0xf8, 0x31, 0xcf, 0x53, 0xae, 0xc9, 0x47, 0xec, + 0x82, 0x86, 0xee, 0x21, 0xdf, 0xe9, 0xaf, 0xec, 0x6e, 0x84, 0x66, 0xca, 0x84, 0xd4, 0xe1, 0x8b, + 0x62, 0x36, 0x3b, 0x90, 0x6a, 0xfe, 0xda, 0x66, 0xf7, 0x9f, 0x5d, 0x5c, 0xed, 0xd4, 0x7e, 0x5c, + 0xed, 0xec, 0x25, 0xa9, 0x99, 0x16, 0x71, 0x38, 0x96, 0x59, 0x54, 0x02, 0x1f, 0xa5, 0xb2, 0xb2, + 0x22, 0x75, 0x96, 0x44, 0x77, 0xca, 0x0e, 0xe1, 0x31, 0xad, 0x14, 0xc8, 0x53, 0xdc, 0xd2, 0x50, + 0xb8, 0xee, 0xd5, 0x41, 0x6c, 0x33, 0xfc, 0x63, 0x18, 0x61, 0xd9, 0xd8, 0x7e, 0xc3, 0xca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x08, 0x37, 0x0f, 0xa6, 0x85, 0x38, 0x23, 0x1e, 0x5e, 0xc9, 0x52, 0x71, 0x6a, 0xef, + 0x63, 0x59, 0x73, 0x27, 0x4b, 0x85, 0xbd, 0x91, 0xa1, 0x86, 0x3c, 0x3b, 0xbf, 0xcd, 0x57, 0xe7, + 0x94, 0xb1, 0xf3, 0x2a, 0xbf, 0x57, 0x6d, 0xc2, 0x81, 0x4d, 0xec, 0xdc, 0xdb, 0x04, 0xa8, 0x84, + 0x03, 0x31, 0x96, 0x93, 0x54, 0x24, 0xcb, 0x35, 0x4c, 0x98, 0x61, 0xd0, 0xda, 0x2a, 0x05, 0x3b, + 0xf0, 0x71, 0x7b, 0x81, 0x22, 0x2b, 0xb8, 0xf5, 0x66, 0xf4, 0x6a, 0x74, 0xf8, 0x76, 0x54, 0x4e, + 0xfe, 0xdd, 0x21, 0xed, 0x22, 0x3b, 0xe8, 0xff, 0x80, 0x8e, 0x4f, 0xfe, 0xc1, 0xf1, 0x3e, 0xc6, + 0xee, 0xd8, 0x8a, 0x2f, 0x6e, 0xf7, 0xc1, 0xdf, 0x5b, 0xad, 0x4e, 0xb7, 0xc2, 0xee, 0xfb, 0x17, + 0xd7, 0x1e, 0xba, 0xbc, 0xf6, 0xd0, 0xcf, 0x6b, 0x0f, 0x7d, 0xbe, 0xf1, 0x6a, 0x97, 0x37, 0x5e, + 0xed, 0xfb, 0x8d, 0x57, 0x7b, 0xef, 0x96, 0xdf, 0x86, 0xd8, 0x85, 0x3f, 0xf5, 0xde, 0xaf, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xd4, 0x4e, 0x4f, 0x77, 0x3a, 0x04, 0x00, 0x00, } func (m *Sample) Marshal() (dAtA []byte, err error) { @@ -687,85 +579,11 @@ func (m *TimeSeries) MarshalToSizedBuffer(dAtA []byte) (int, error) { 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 - } + size := m.Labels[iNdEx].Size() i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -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 *Labels) 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 *Labels) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Labels) 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 { + if _, err := m.Labels[iNdEx].MarshalTo(dAtA[i:]); err != nil { return 0, err } - i -= size i = encodeVarintTypes(dAtA, i, uint64(size)) } i-- @@ -968,11 +786,11 @@ func (m *ChunkedSeries) MarshalToSizedBuffer(dAtA []byte) (int, error) { 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 { + size := m.Labels[iNdEx].Size() + i -= size + if _, err := m.Labels[iNdEx].MarshalTo(dAtA[i:]); err != nil { return 0, err } - i -= size i = encodeVarintTypes(dAtA, i, uint64(size)) } i-- @@ -1029,38 +847,6 @@ func (m *TimeSeries) Size() (n int) { return n } -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 *Labels) 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 *LabelMatcher) Size() (n int) { if m == nil { return 0 @@ -1305,7 +1091,7 @@ func (m *TimeSeries) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Labels = append(m.Labels, Label{}) + m.Labels = append(m.Labels, github_com_thanos_io_thanos_pkg_store_labelpb.Label{}) if err := m.Labels[len(m.Labels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -1368,210 +1154,6 @@ func (m *TimeSeries) Unmarshal(dAtA []byte) error { } return nil } -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 *Labels) 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: Labels: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Labels: 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 *LabelMatcher) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -2123,7 +1705,7 @@ func (m *ChunkedSeries) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Labels = append(m.Labels, Label{}) + m.Labels = append(m.Labels, github_com_thanos_io_thanos_pkg_store_labelpb.Label{}) if err := m.Labels[len(m.Labels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/vendor/github.com/thanos-io/thanos/pkg/store/storepb/prompb/types.proto b/vendor/github.com/thanos-io/thanos/pkg/store/storepb/prompb/types.proto index 698a19a48ac..dbdb32f2bf9 100644 --- a/vendor/github.com/thanos-io/thanos/pkg/store/storepb/prompb/types.proto +++ b/vendor/github.com/thanos-io/thanos/pkg/store/storepb/prompb/types.proto @@ -20,6 +20,7 @@ package prometheus_copy; option go_package = "prompb"; import "gogoproto/gogo.proto"; +import "store/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. @@ -34,17 +35,8 @@ message Sample { // TimeSeries represents samples and labels for a single time series. message TimeSeries { - repeated Label labels = 1 [(gogoproto.nullable) = false]; - repeated Sample samples = 2 [(gogoproto.nullable) = false]; -} - -message Label { - string name = 1; - string value = 2; -} - -message Labels { - repeated Label labels = 1 [(gogoproto.nullable) = false]; + repeated thanos.FullCopyLabel labels = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/thanos-io/thanos/pkg/store/labelpb.Label"]; + repeated Sample samples = 2 [(gogoproto.nullable) = false]; } // Matcher specifies a rule, which can match or set of labels or not. @@ -88,7 +80,7 @@ message Chunk { // ChunkedSeries represents single, encoded time series. message ChunkedSeries { // Labels should be sorted. - repeated Label labels = 1 [(gogoproto.nullable) = false]; + repeated thanos.FullCopyLabel labels = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/thanos-io/thanos/pkg/store/labelpb.Label"]; // Chunks will be in start time order and may overlap. repeated Chunk chunks = 2 [(gogoproto.nullable) = false]; } diff --git a/vendor/github.com/thanos-io/thanos/pkg/store/storepb/rpc.pb.go b/vendor/github.com/thanos-io/thanos/pkg/store/storepb/rpc.pb.go index 4c154f9a717..288e37c69a4 100644 --- a/vendor/github.com/thanos-io/thanos/pkg/store/storepb/rpc.pb.go +++ b/vendor/github.com/thanos-io/thanos/pkg/store/storepb/rpc.pb.go @@ -13,6 +13,8 @@ import ( _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" types "github.com/gogo/protobuf/types" + github_com_thanos_io_thanos_pkg_store_labelpb "github.com/thanos-io/thanos/pkg/store/labelpb" + labelpb "github.com/thanos-io/thanos/pkg/store/labelpb" prompb "github.com/thanos-io/thanos/pkg/store/storepb/prompb" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" @@ -221,12 +223,12 @@ var xxx_messageInfo_InfoRequest proto.InternalMessageInfo type InfoResponse struct { // Deprecated. Use label_sets instead. - Labels []Label `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels"` - MinTime int64 `protobuf:"varint,2,opt,name=min_time,json=minTime,proto3" json:"min_time,omitempty"` - MaxTime int64 `protobuf:"varint,3,opt,name=max_time,json=maxTime,proto3" json:"max_time,omitempty"` - StoreType StoreType `protobuf:"varint,4,opt,name=storeType,proto3,enum=thanos.StoreType" json:"storeType,omitempty"` + Labels []github_com_thanos_io_thanos_pkg_store_labelpb.Label `protobuf:"bytes,1,rep,name=labels,proto3,customtype=github.com/thanos-io/thanos/pkg/store/labelpb.Label" json:"labels"` + MinTime int64 `protobuf:"varint,2,opt,name=min_time,json=minTime,proto3" json:"min_time,omitempty"` + MaxTime int64 `protobuf:"varint,3,opt,name=max_time,json=maxTime,proto3" json:"max_time,omitempty"` + StoreType StoreType `protobuf:"varint,4,opt,name=storeType,proto3,enum=thanos.StoreType" json:"storeType,omitempty"` // label_sets is an unsorted list of `LabelSet`s. - LabelSets []LabelSet `protobuf:"bytes,5,rep,name=label_sets,json=labelSets,proto3" json:"label_sets"` + LabelSets []labelpb.LabelSet `protobuf:"bytes,5,rep,name=label_sets,json=labelSets,proto3" json:"label_sets"` } func (m *InfoResponse) Reset() { *m = InfoResponse{} } @@ -262,43 +264,6 @@ func (m *InfoResponse) XXX_DiscardUnknown() { var xxx_messageInfo_InfoResponse proto.InternalMessageInfo -type LabelSet struct { - Labels []Label `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels"` -} - -func (m *LabelSet) Reset() { *m = LabelSet{} } -func (m *LabelSet) String() string { return proto.CompactTextString(m) } -func (*LabelSet) ProtoMessage() {} -func (*LabelSet) Descriptor() ([]byte, []int) { - return fileDescriptor_a938d55a388af629, []int{4} -} -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 SeriesRequest struct { MinTime int64 `protobuf:"varint,1,opt,name=min_time,json=minTime,proto3" json:"min_time,omitempty"` MaxTime int64 `protobuf:"varint,2,opt,name=max_time,json=maxTime,proto3" json:"max_time,omitempty"` @@ -321,7 +286,7 @@ func (m *SeriesRequest) Reset() { *m = SeriesRequest{} } func (m *SeriesRequest) String() string { return proto.CompactTextString(m) } func (*SeriesRequest) ProtoMessage() {} func (*SeriesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_a938d55a388af629, []int{5} + return fileDescriptor_a938d55a388af629, []int{4} } func (m *SeriesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -362,7 +327,7 @@ func (m *SeriesResponse) Reset() { *m = SeriesResponse{} } func (m *SeriesResponse) String() string { return proto.CompactTextString(m) } func (*SeriesResponse) ProtoMessage() {} func (*SeriesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_a938d55a388af629, []int{6} + return fileDescriptor_a938d55a388af629, []int{5} } func (m *SeriesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -460,7 +425,7 @@ func (m *LabelNamesRequest) Reset() { *m = LabelNamesRequest{} } func (m *LabelNamesRequest) String() string { return proto.CompactTextString(m) } func (*LabelNamesRequest) ProtoMessage() {} func (*LabelNamesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_a938d55a388af629, []int{7} + return fileDescriptor_a938d55a388af629, []int{6} } func (m *LabelNamesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -498,7 +463,7 @@ func (m *LabelNamesResponse) Reset() { *m = LabelNamesResponse{} } func (m *LabelNamesResponse) String() string { return proto.CompactTextString(m) } func (*LabelNamesResponse) ProtoMessage() {} func (*LabelNamesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_a938d55a388af629, []int{8} + return fileDescriptor_a938d55a388af629, []int{7} } func (m *LabelNamesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -540,7 +505,7 @@ func (m *LabelValuesRequest) Reset() { *m = LabelValuesRequest{} } func (m *LabelValuesRequest) String() string { return proto.CompactTextString(m) } func (*LabelValuesRequest) ProtoMessage() {} func (*LabelValuesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_a938d55a388af629, []int{9} + return fileDescriptor_a938d55a388af629, []int{8} } func (m *LabelValuesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -578,7 +543,7 @@ func (m *LabelValuesResponse) Reset() { *m = LabelValuesResponse{} } func (m *LabelValuesResponse) String() string { return proto.CompactTextString(m) } func (*LabelValuesResponse) ProtoMessage() {} func (*LabelValuesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_a938d55a388af629, []int{10} + return fileDescriptor_a938d55a388af629, []int{9} } func (m *LabelValuesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -614,7 +579,6 @@ func init() { proto.RegisterType((*WriteRequest)(nil), "thanos.WriteRequest") proto.RegisterType((*InfoRequest)(nil), "thanos.InfoRequest") proto.RegisterType((*InfoResponse)(nil), "thanos.InfoResponse") - proto.RegisterType((*LabelSet)(nil), "thanos.LabelSet") proto.RegisterType((*SeriesRequest)(nil), "thanos.SeriesRequest") proto.RegisterType((*SeriesResponse)(nil), "thanos.SeriesResponse") proto.RegisterType((*LabelNamesRequest)(nil), "thanos.LabelNamesRequest") @@ -626,70 +590,72 @@ func init() { func init() { proto.RegisterFile("store/storepb/rpc.proto", fileDescriptor_a938d55a388af629) } var fileDescriptor_a938d55a388af629 = []byte{ - // 1003 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0x4d, 0x6f, 0x23, 0x45, - 0x13, 0xf6, 0x78, 0xec, 0xb1, 0x5d, 0x4e, 0xf2, 0xce, 0x76, 0x9c, 0xec, 0xc4, 0x2b, 0x39, 0xd6, - 0x48, 0xaf, 0x64, 0x85, 0x95, 0x0d, 0x46, 0x80, 0x40, 0x5c, 0x9c, 0xc4, 0x4b, 0x22, 0x36, 0x0e, - 0xb4, 0xe3, 0x0d, 0x1f, 0x42, 0xd6, 0x24, 0xe9, 0x9d, 0x8c, 0x76, 0xbe, 0x98, 0x6e, 0x93, 0xf8, - 0x0a, 0x77, 0xc4, 0x9f, 0x42, 0xca, 0x71, 0x0f, 0x1c, 0xe0, 0x82, 0x20, 0x39, 0xf2, 0x27, 0x50, - 0x7f, 0x8c, 0xed, 0x09, 0xd9, 0x48, 0x28, 0x5c, 0xac, 0xae, 0x7a, 0xaa, 0xbb, 0x9e, 0x7e, 0xaa, - 0x6a, 0xdc, 0xf0, 0x98, 0xb2, 0x28, 0x21, 0x1d, 0xf1, 0x1b, 0x9f, 0x74, 0x92, 0xf8, 0xb4, 0x1d, - 0x27, 0x11, 0x8b, 0x90, 0xc1, 0xce, 0x9d, 0x30, 0xa2, 0xf5, 0x8d, 0x6c, 0x00, 0x9b, 0xc6, 0x84, - 0xca, 0x90, 0x7a, 0xcd, 0x8d, 0xdc, 0x48, 0x2c, 0x3b, 0x7c, 0xa5, 0xbc, 0xcd, 0xec, 0x86, 0x38, - 0x89, 0x82, 0x5b, 0xfb, 0x36, 0xdc, 0x28, 0x72, 0x7d, 0xd2, 0x11, 0xd6, 0xc9, 0xe4, 0x65, 0xc7, - 0x09, 0xa7, 0x12, 0xb2, 0xff, 0x07, 0xcb, 0xc7, 0x89, 0xc7, 0x08, 0x26, 0x34, 0x8e, 0x42, 0x4a, - 0xec, 0x1f, 0x34, 0x58, 0x52, 0x9e, 0x6f, 0x27, 0x84, 0x32, 0xd4, 0x03, 0x60, 0x5e, 0x40, 0x28, - 0x49, 0x3c, 0x42, 0x2d, 0xad, 0xa9, 0xb7, 0xaa, 0xdd, 0x27, 0x7c, 0x77, 0x40, 0xd8, 0x39, 0x99, - 0xd0, 0xf1, 0x69, 0x14, 0x4f, 0xdb, 0x47, 0x5e, 0x40, 0x86, 0x22, 0x64, 0xbb, 0x70, 0xf5, 0xfb, - 0x66, 0x0e, 0x2f, 0x6c, 0x42, 0xeb, 0x60, 0x30, 0x12, 0x3a, 0x21, 0xb3, 0xf2, 0x4d, 0xad, 0x55, - 0xc1, 0xca, 0x42, 0x16, 0x94, 0x12, 0x12, 0xfb, 0xde, 0xa9, 0x63, 0xe9, 0x4d, 0xad, 0xa5, 0xe3, - 0xd4, 0xb4, 0x97, 0xa1, 0xba, 0x1f, 0xbe, 0x8c, 0x14, 0x07, 0xfb, 0x37, 0x0d, 0x96, 0xa4, 0x2d, - 0x59, 0xa2, 0xb7, 0xc0, 0xf0, 0x9d, 0x13, 0xe2, 0xa7, 0x84, 0x96, 0xdb, 0x52, 0xbd, 0xf6, 0x73, - 0xee, 0x55, 0x14, 0x54, 0x08, 0xda, 0x80, 0x72, 0xe0, 0x85, 0x63, 0x4e, 0x48, 0x10, 0xd0, 0x71, - 0x29, 0xf0, 0x42, 0xce, 0x58, 0x40, 0xce, 0xa5, 0x84, 0x14, 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0xbc, 0xf0, 0x7f, 0x54, 0xaf, - 0x65, 0x9d, 0x4a, 0x93, 0x0f, 0xc1, 0x90, 0xf3, 0x89, 0xd6, 0xb2, 0xf3, 0x9a, 0x6e, 0x5b, 0xbf, - 0xed, 0x96, 0x1b, 0xdf, 0xd6, 0xd0, 0x0e, 0xc0, 0xbc, 0x37, 0xd1, 0x46, 0xe6, 0xfb, 0xbb, 0x38, - 0x85, 0xf5, 0xfa, 0x5d, 0x90, 0xca, 0xff, 0x0c, 0xaa, 0x0b, 0xa5, 0x42, 0xd9, 0xd0, 0x4c, 0xb3, - 0xd6, 0x9f, 0xdc, 0x89, 0xc9, 0x73, 0xba, 0x03, 0x58, 0x11, 0x2f, 0x00, 0xde, 0x85, 0x52, 0x8c, - 0x8f, 0xa1, 0x8a, 0x49, 0x10, 0x31, 0x22, 0xfc, 0x68, 0x76, 0xfd, 0xc5, 0x87, 0x42, 0x7d, 0xed, - 0x96, 0x57, 0x3d, 0x28, 0x72, 0xdb, 0xff, 0xbf, 0xfa, 0xb3, 0x91, 0xbb, 0xba, 0x6e, 0x68, 0xaf, - 0xaf, 0x1b, 0xda, 0x1f, 0xd7, 0x0d, 0xed, 0xa7, 0x9b, 0x46, 0xee, 0xf5, 0x4d, 0x23, 0xf7, 0xeb, - 0x4d, 0x23, 0xf7, 0x55, 0x49, 0x3d, 0x5c, 0x4e, 0x0c, 0xf1, 0x5d, 0x7a, 0xf7, 0xef, 0x00, 0x00, - 0x00, 0xff, 0xff, 0x9f, 0xfa, 0x6e, 0x07, 0x22, 0x09, 0x00, 0x00, + // 1039 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0x4b, 0x6f, 0x23, 0x45, + 0x10, 0xf6, 0x78, 0xfc, 0x2c, 0x27, 0x61, 0xb6, 0xe3, 0x64, 0x27, 0x5e, 0xc9, 0xb1, 0x2c, 0x21, + 0x59, 0xd1, 0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x5a, 0x7a, 0x72, 0x27, 0x26, 0xe3, 0x34, 0x7b, 0xb0, 0x26, 0xbe, 0x03, + 0xf8, 0x14, 0x4a, 0x32, 0x3e, 0x81, 0x02, 0x26, 0x53, 0x9f, 0x11, 0xa1, 0x47, 0x8b, 0xf2, 0x97, + 0x3f, 0x17, 0x4a, 0x1b, 0xb7, 0xb4, 0xea, 0xb3, 0x22, 0xd1, 0x7e, 0xfb, 0xf2, 0xef, 0x72, 0xe2, + 0xf2, 0xaa, 0xac, 0xbd, 0xba, 0x2a, 0x6b, 0x7f, 0x5d, 0x95, 0xb5, 0x5f, 0xae, 0xcb, 0x89, 0x57, + 0xd7, 0xe5, 0xc4, 0x1f, 0xd7, 0xe5, 0xc4, 0xd7, 0x59, 0xf5, 0x65, 0x33, 0xca, 0x88, 0x77, 0xe9, + 0xd9, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xb6, 0xf4, 0xa4, 0xff, 0x43, 0x09, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1157,48 +1123,11 @@ func (m *InfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { 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 - } + size := m.Labels[iNdEx].Size() i -= size - i = encodeVarintRpc(dAtA, i, uint64(size)) - } - 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 { + if _, err := m.Labels[iNdEx].MarshalTo(dAtA[i:]); err != nil { return 0, err } - i -= size i = encodeVarintRpc(dAtA, i, uint64(size)) } i-- @@ -1669,21 +1598,6 @@ func (m *InfoResponse) Size() (n int) { 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 + sovRpc(uint64(l)) - } - } - return n -} - func (m *SeriesRequest) Size() (n int) { if m == nil { return 0 @@ -2170,7 +2084,7 @@ func (m *InfoResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Labels = append(m.Labels, Label{}) + m.Labels = append(m.Labels, github_com_thanos_io_thanos_pkg_store_labelpb.Label{}) if err := m.Labels[len(m.Labels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -2261,7 +2175,7 @@ func (m *InfoResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.LabelSets = append(m.LabelSets, LabelSet{}) + m.LabelSets = append(m.LabelSets, labelpb.LabelSet{}) if err := m.LabelSets[len(m.LabelSets)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -2290,93 +2204,6 @@ func (m *InfoResponse) Unmarshal(dAtA []byte) error { } 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 ErrIntOverflowRpc - } - 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 ErrIntOverflowRpc - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRpc - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRpc - } - 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 := skipRpc(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthRpc - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *SeriesRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/vendor/github.com/thanos-io/thanos/pkg/store/storepb/rpc.proto b/vendor/github.com/thanos-io/thanos/pkg/store/storepb/rpc.proto index 414998435a2..e81dae63972 100644 --- a/vendor/github.com/thanos-io/thanos/pkg/store/storepb/rpc.proto +++ b/vendor/github.com/thanos-io/thanos/pkg/store/storepb/rpc.proto @@ -7,6 +7,7 @@ package thanos; import "store/storepb/types.proto"; import "gogoproto/gogo.proto"; import "store/storepb/prompb/types.proto"; +import "store/labelpb/types.proto"; import "google/protobuf/any.proto"; option go_package = "storepb"; @@ -77,7 +78,7 @@ enum StoreType { message InfoResponse { // Deprecated. Use label_sets instead. - repeated Label labels = 1 [(gogoproto.nullable) = false]; + repeated FullCopyLabel labels = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/thanos-io/thanos/pkg/store/labelpb.Label"]; int64 min_time = 2; int64 max_time = 3; StoreType storeType = 4; @@ -85,10 +86,6 @@ message InfoResponse { repeated LabelSet label_sets = 5 [(gogoproto.nullable) = false]; } -message LabelSet { - repeated Label labels = 1 [(gogoproto.nullable) = false]; -} - message SeriesRequest { int64 min_time = 1; int64 max_time = 2; diff --git a/vendor/github.com/thanos-io/thanos/pkg/store/storepb/testutil/series.go b/vendor/github.com/thanos-io/thanos/pkg/store/storepb/testutil/series.go index fc48c0ad9f5..a63648a336a 100644 --- a/vendor/github.com/thanos-io/thanos/pkg/store/storepb/testutil/series.go +++ b/vendor/github.com/thanos-io/thanos/pkg/store/storepb/testutil/series.go @@ -21,6 +21,7 @@ import ( "github.com/prometheus/prometheus/tsdb/index" "github.com/prometheus/prometheus/tsdb/wal" "github.com/thanos-io/thanos/pkg/store/hintspb" + "github.com/thanos-io/thanos/pkg/store/labelpb" "github.com/thanos-io/thanos/pkg/store/storepb" "github.com/thanos-io/thanos/pkg/testutil" ) @@ -103,8 +104,7 @@ func CreateHeadWithSeries(t testing.TB, j int, opts HeadGenOptions) (*tsdb.Head, all := allPostings(t, ir) for all.Next() { testutil.Ok(t, ir.Series(all.At(), &lset, &chunkMetas)) - sLset := storepb.PromLabelsToLabels(lset) - expected = append(expected, &storepb.Series{Labels: append(storepb.PromLabelsToLabels(opts.PrependLabels), sLset...)}) + expected = append(expected, &storepb.Series{Labels: labelpb.LabelsFromPromLabels(append(opts.PrependLabels.Copy(), lset...))}) if opts.SkipChunks { continue diff --git a/vendor/github.com/thanos-io/thanos/pkg/store/storepb/types.pb.go b/vendor/github.com/thanos-io/thanos/pkg/store/storepb/types.pb.go index aecd10191f2..5320ce2ac08 100644 --- a/vendor/github.com/thanos-io/thanos/pkg/store/storepb/types.pb.go +++ b/vendor/github.com/thanos-io/thanos/pkg/store/storepb/types.pb.go @@ -11,6 +11,8 @@ import ( _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" + _ "github.com/thanos-io/thanos/pkg/store/labelpb" + github_com_thanos_io_thanos_pkg_store_labelpb "github.com/thanos-io/thanos/pkg/store/labelpb" ) // Reference imports to suppress errors if they are not otherwise used. @@ -77,7 +79,7 @@ func (x Chunk_Encoding) String() string { } func (Chunk_Encoding) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_121fba57de02d8e0, []int{1, 0} + return fileDescriptor_121fba57de02d8e0, []int{0, 0} } type LabelMatcher_Type int32 @@ -108,47 +110,9 @@ func (x LabelMatcher_Type) String() string { } func (LabelMatcher_Type) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_121fba57de02d8e0, []int{4, 0} + return fileDescriptor_121fba57de02d8e0, []int{3, 0} } -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 (m *Label) String() string { return proto.CompactTextString(m) } -func (*Label) ProtoMessage() {} -func (*Label) Descriptor() ([]byte, []int) { - return fileDescriptor_121fba57de02d8e0, []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 Chunk struct { Type Chunk_Encoding `protobuf:"varint,1,opt,name=type,proto3,enum=thanos.Chunk_Encoding" json:"type,omitempty"` Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` @@ -158,7 +122,7 @@ func (m *Chunk) Reset() { *m = Chunk{} } func (m *Chunk) String() string { return proto.CompactTextString(m) } func (*Chunk) ProtoMessage() {} func (*Chunk) Descriptor() ([]byte, []int) { - return fileDescriptor_121fba57de02d8e0, []int{1} + return fileDescriptor_121fba57de02d8e0, []int{0} } func (m *Chunk) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -188,15 +152,15 @@ func (m *Chunk) XXX_DiscardUnknown() { var xxx_messageInfo_Chunk proto.InternalMessageInfo type Series struct { - Labels []Label `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels"` - Chunks []AggrChunk `protobuf:"bytes,2,rep,name=chunks,proto3" json:"chunks"` + Labels []github_com_thanos_io_thanos_pkg_store_labelpb.Label `protobuf:"bytes,1,rep,name=labels,proto3,customtype=github.com/thanos-io/thanos/pkg/store/labelpb.Label" json:"labels"` + Chunks []AggrChunk `protobuf:"bytes,2,rep,name=chunks,proto3" json:"chunks"` } func (m *Series) Reset() { *m = Series{} } func (m *Series) String() string { return proto.CompactTextString(m) } func (*Series) ProtoMessage() {} func (*Series) Descriptor() ([]byte, []int) { - return fileDescriptor_121fba57de02d8e0, []int{2} + return fileDescriptor_121fba57de02d8e0, []int{1} } func (m *Series) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -240,7 +204,7 @@ func (m *AggrChunk) Reset() { *m = AggrChunk{} } func (m *AggrChunk) String() string { return proto.CompactTextString(m) } func (*AggrChunk) ProtoMessage() {} func (*AggrChunk) Descriptor() ([]byte, []int) { - return fileDescriptor_121fba57de02d8e0, []int{3} + return fileDescriptor_121fba57de02d8e0, []int{2} } func (m *AggrChunk) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -280,7 +244,7 @@ func (m *LabelMatcher) Reset() { *m = LabelMatcher{} } func (m *LabelMatcher) String() string { return proto.CompactTextString(m) } func (*LabelMatcher) ProtoMessage() {} func (*LabelMatcher) Descriptor() ([]byte, []int) { - return fileDescriptor_121fba57de02d8e0, []int{4} + return fileDescriptor_121fba57de02d8e0, []int{3} } func (m *LabelMatcher) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -313,7 +277,6 @@ func init() { proto.RegisterEnum("thanos.PartialResponseStrategy", PartialResponseStrategy_name, PartialResponseStrategy_value) proto.RegisterEnum("thanos.Chunk_Encoding", Chunk_Encoding_name, Chunk_Encoding_value) proto.RegisterEnum("thanos.LabelMatcher_Type", LabelMatcher_Type_name, LabelMatcher_Type_value) - proto.RegisterType((*Label)(nil), "thanos.Label") proto.RegisterType((*Chunk)(nil), "thanos.Chunk") proto.RegisterType((*Series)(nil), "thanos.Series") proto.RegisterType((*AggrChunk)(nil), "thanos.AggrChunk") @@ -323,75 +286,41 @@ func init() { func init() { proto.RegisterFile("store/storepb/types.proto", fileDescriptor_121fba57de02d8e0) } var fileDescriptor_121fba57de02d8e0 = []byte{ - // 490 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x93, 0xcf, 0x6e, 0xd3, 0x40, - 0x10, 0xc6, 0xfd, 0x3f, 0xc9, 0x50, 0x90, 0x59, 0x2a, 0xd8, 0x70, 0x70, 0x23, 0x23, 0x44, 0x54, - 0x84, 0x23, 0xca, 0x13, 0x24, 0x28, 0x37, 0x68, 0xe9, 0x36, 0x12, 0x08, 0x21, 0xa1, 0x4d, 0xba, - 0x38, 0x16, 0xf1, 0x3a, 0xf2, 0x6e, 0x20, 0x79, 0x0b, 0x10, 0x2f, 0x95, 0x63, 0x8f, 0x9c, 0x10, - 0x24, 0x2f, 0x82, 0x76, 0x9c, 0x40, 0x2b, 0xf9, 0x62, 0xad, 0xe7, 0xfb, 0xcd, 0x7c, 0xa3, 0x9d, - 0x59, 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, 0x26, - 0xb2, 0xaf, 0x36, 0x91, 0xfd, 0x7b, 0x13, 0xd9, 0xdf, 0xb6, 0x91, 0x75, 0xb5, 0x8d, 0xac, 0x9f, - 0xdb, 0xc8, 0x7a, 0xdf, 0xd8, 0xbd, 0x91, 0x71, 0x80, 0x0f, 0xe0, 0xc5, 0xdf, 0x00, 0x00, 0x00, - 0xff, 0xff, 0xb1, 0xe1, 0xde, 0x65, 0x3b, 0x03, 0x00, 0x00, -} - -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 + // 530 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x93, 0xd1, 0x6e, 0xd3, 0x3c, + 0x14, 0xc7, 0xe3, 0x24, 0x4d, 0x5b, 0x6f, 0xdf, 0xa7, 0x60, 0x06, 0x64, 0xbb, 0x48, 0xab, 0x20, + 0x44, 0x35, 0x69, 0x89, 0xd4, 0x5d, 0x72, 0xd5, 0x4e, 0xe5, 0x0a, 0x36, 0xe6, 0x55, 0x02, 0x21, + 0x24, 0xe4, 0x76, 0x56, 0x6a, 0x96, 0xd8, 0x51, 0xe2, 0x40, 0x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b6, 0xaa, 0x43, 0x0e, 0x34, 0x47, 0x97, 0xae, 0xa1, 0x16, 0xe8, + 0x7c, 0x74, 0xe9, 0x02, 0x95, 0xc0, 0x23, 0xd7, 0xd4, 0x09, 0x3c, 0x72, 0xad, 0xe3, 0x10, 0x3e, + 0x7a, 0x45, 0x72, 0xc9, 0x48, 0x82, 0x69, 0x91, 0x09, 0x5e, 0xd0, 0x2b, 0x99, 0x13, 0x49, 0xe3, + 0x05, 0x6a, 0x41, 0xfb, 0xf5, 0x00, 0x9f, 0xbb, 0x06, 0x6a, 0xc3, 0xc6, 0x60, 0x78, 0x81, 0xc7, + 0x2e, 0x18, 0x3e, 0x59, 0xfe, 0xf2, 0x8d, 0xe5, 0xca, 0x07, 0xb7, 0x2b, 0x1f, 0xfc, 0x5c, 0xf9, + 0xe0, 0xf3, 0xda, 0x37, 0x6e, 0xd7, 0xbe, 0xf1, 0x7d, 0xed, 0x1b, 0x6f, 0x9b, 0xf5, 0x5b, 0x9a, + 0x38, 0xfa, 0x35, 0x9c, 0xfe, 0x0e, 0x00, 0x00, 0xff, 0xff, 0x31, 0xba, 0x19, 0x3e, 0x63, 0x03, + 0x00, 0x00, } func (m *Chunk) Marshal() (dAtA []byte, err error) { @@ -466,11 +395,11 @@ func (m *Series) MarshalToSizedBuffer(dAtA []byte) (int, error) { 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 { + size := m.Labels[iNdEx].Size() + i -= size + if _, err := m.Labels[iNdEx].MarshalTo(dAtA[i:]); err != nil { return 0, err } - i -= size i = encodeVarintTypes(dAtA, i, uint64(size)) } i-- @@ -638,23 +567,6 @@ func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { 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 *Chunk) Size() (n int) { if m == nil { return 0 @@ -757,123 +669,6 @@ func sovTypes(x uint64) (n int) { func sozTypes(x uint64) (n int) { return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -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 *Chunk) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -1038,7 +833,7 @@ func (m *Series) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Labels = append(m.Labels, Label{}) + m.Labels = append(m.Labels, github_com_thanos_io_thanos_pkg_store_labelpb.Label{}) if err := m.Labels[len(m.Labels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/vendor/github.com/thanos-io/thanos/pkg/store/storepb/types.proto b/vendor/github.com/thanos-io/thanos/pkg/store/storepb/types.proto index 4cd993f8633..a88c8cf7c11 100644 --- a/vendor/github.com/thanos-io/thanos/pkg/store/storepb/types.proto +++ b/vendor/github.com/thanos-io/thanos/pkg/store/storepb/types.proto @@ -7,6 +7,7 @@ package thanos; option go_package = "storepb"; import "gogoproto/gogo.proto"; +import "store/labelpb/types.proto"; option (gogoproto.sizer_all) = true; option (gogoproto.marshaler_all) = true; @@ -19,11 +20,6 @@ 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 Chunk { enum Encoding { XOR = 0; @@ -33,8 +29,8 @@ message Chunk { } message Series { - repeated Label labels = 1 [(gogoproto.nullable) = false]; - repeated AggrChunk chunks = 2 [(gogoproto.nullable) = false]; + repeated FullCopyLabel labels = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/thanos-io/thanos/pkg/store/labelpb.Label"]; + repeated AggrChunk chunks = 2 [(gogoproto.nullable) = false]; } message AggrChunk { diff --git a/vendor/github.com/thanos-io/thanos/pkg/store/tsdb.go b/vendor/github.com/thanos-io/thanos/pkg/store/tsdb.go index af3fc4da528..87ab161999b 100644 --- a/vendor/github.com/thanos-io/thanos/pkg/store/tsdb.go +++ b/vendor/github.com/thanos-io/thanos/pkg/store/tsdb.go @@ -7,19 +7,19 @@ import ( "context" "io" "math" - "sort" "github.com/go-kit/kit/log" "github.com/pkg/errors" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/prometheus/pkg/labels" "github.com/prometheus/prometheus/storage" + "github.com/thanos-io/thanos/pkg/store/labelpb" storetestutil "github.com/thanos-io/thanos/pkg/store/storepb/testutil" + "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "github.com/thanos-io/thanos/pkg/component" - "github.com/thanos-io/thanos/pkg/promclient" "github.com/thanos-io/thanos/pkg/runutil" "github.com/thanos-io/thanos/pkg/store/storepb" ) @@ -40,6 +40,12 @@ type TSDBStore struct { maxBytesPerFrame int } +func RegisterWritableStoreServer(storeSrv storepb.WriteableStoreServer) func(*grpc.Server) { + return func(s *grpc.Server) { + storepb.RegisterWriteableStoreServer(s, storeSrv) + } +} + // ReadWriteTSDBStore is a TSDBStore that can also be written to. type ReadWriteTSDBStore struct { storepb.StoreServer @@ -68,17 +74,11 @@ func (s *TSDBStore) Info(_ context.Context, _ *storepb.InfoRequest) (*storepb.In } res := &storepb.InfoResponse{ - Labels: make([]storepb.Label, 0, len(s.externalLabels)), + Labels: labelpb.LabelsFromPromLabels(s.externalLabels), StoreType: s.component.ToProto(), MinTime: minTime, MaxTime: math.MaxInt64, } - for _, l := range s.externalLabels { - res.Labels = append(res.Labels, storepb.Label{ - Name: l.Name, - Value: l.Value, - }) - } // Until we deprecate the single labels in the reply, we just duplicate // them here for migration/compatibility purposes. @@ -113,7 +113,7 @@ func (s *TSDBStore) Series(r *storepb.SeriesRequest, srv storepb.Store_SeriesSer return status.Error(codes.InvalidArgument, errors.New("no matchers specified (excluding external labels)").Error()) } - matchers, err := promclient.TranslateMatchers(newMatchers) + matchers, err := storepb.TranslateFromPromMatchers(newMatchers...) if err != nil { return status.Error(codes.InvalidArgument, err.Error()) } @@ -134,7 +134,7 @@ func (s *TSDBStore) Series(r *storepb.SeriesRequest, srv storepb.Store_SeriesSer // Stream at most one series per frame; series may be split over multiple frames according to maxBytesInFrame. for set.Next() { series := set.At() - seriesLabels := storepb.Series{Labels: s.translateAndExtendLabels(series.Labels(), s.externalLabels)} + seriesLabels := storepb.Series{Labels: labelpb.LabelsFromPromLabels(labelpb.ExtendLabels(series.Labels(), s.externalLabels))} if r.SkipChunks { if err := srv.Send(storepb.NewSeriesResponse(&seriesLabels)); err != nil { return status.Error(codes.Aborted, err.Error()) @@ -198,32 +198,6 @@ func (s *TSDBStore) Series(r *storepb.SeriesRequest, srv storepb.Store_SeriesSer return nil } -// translateAndExtendLabels transforms a metrics into a protobuf label set. It additionally -// attaches the given labels to it, overwriting existing ones on collision. -func (s *TSDBStore) translateAndExtendLabels(m, extend labels.Labels) []storepb.Label { - lset := make([]storepb.Label, 0, len(m)+len(extend)) - - for _, l := range m { - if extend.Get(l.Name) != "" { - continue - } - lset = append(lset, storepb.Label{ - Name: l.Name, - Value: l.Value, - }) - } - for _, l := range extend { - lset = append(lset, storepb.Label{ - Name: l.Name, - Value: l.Value, - }) - } - sort.Slice(lset, func(i, j int) bool { - return lset[i].Name < lset[j].Name - }) - return lset -} - // LabelNames returns all known label names. func (s *TSDBStore) LabelNames(ctx context.Context, r *storepb.LabelNamesRequest) ( *storepb.LabelNamesResponse, error, diff --git a/vendor/modules.txt b/vendor/modules.txt index 594b9da3c69..fd098b5d650 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -566,7 +566,7 @@ github.com/stretchr/objx github.com/stretchr/testify/assert github.com/stretchr/testify/mock github.com/stretchr/testify/require -# github.com/thanos-io/thanos v0.13.1-0.20200923175059-57035bf8f843 +# github.com/thanos-io/thanos v0.13.1-0.20201002105236-bb1662a1d13c ## explicit github.com/thanos-io/thanos/pkg/block github.com/thanos-io/thanos/pkg/block/indexheader @@ -597,6 +597,7 @@ github.com/thanos-io/thanos/pkg/shipper github.com/thanos-io/thanos/pkg/store github.com/thanos-io/thanos/pkg/store/cache github.com/thanos-io/thanos/pkg/store/hintspb +github.com/thanos-io/thanos/pkg/store/labelpb github.com/thanos-io/thanos/pkg/store/storepb github.com/thanos-io/thanos/pkg/store/storepb/prompb github.com/thanos-io/thanos/pkg/store/storepb/testutil From 6184848a5b6575190192d7ed16ae43439cba9bbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20S=CC=8Ctibrany=CC=81?= Date: Fri, 2 Oct 2020 16:58:19 +0200 Subject: [PATCH 2/7] =?UTF-8?q?Added=20forgotten=20files=20Signed-off-by:?= =?UTF-8?q?=20Peter=20S=CC=8Ctibrany=CC=81=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../thanos/pkg/store/labelpb/label.go | 299 ++++++++ .../thanos/pkg/store/labelpb/types.pb.go | 714 ++++++++++++++++++ .../thanos/pkg/store/labelpb/types.proto | 33 + 3 files changed, 1046 insertions(+) create mode 100644 vendor/github.com/thanos-io/thanos/pkg/store/labelpb/label.go create mode 100644 vendor/github.com/thanos-io/thanos/pkg/store/labelpb/types.pb.go create mode 100644 vendor/github.com/thanos-io/thanos/pkg/store/labelpb/types.proto diff --git a/vendor/github.com/thanos-io/thanos/pkg/store/labelpb/label.go b/vendor/github.com/thanos-io/thanos/pkg/store/labelpb/label.go new file mode 100644 index 00000000000..bc4b58d6450 --- /dev/null +++ b/vendor/github.com/thanos-io/thanos/pkg/store/labelpb/label.go @@ -0,0 +1,299 @@ +// Copyright (c) The Thanos Authors. +// Licensed under the Apache License 2.0. + +// Package containing Zero Copy Labels adapter. + +package labelpb + +import ( + "encoding/json" + "fmt" + "io" + "sort" + "strings" + "unsafe" + + "github.com/pkg/errors" + "github.com/prometheus/prometheus/pkg/labels" +) + +func noAllocString(buf []byte) string { + return *((*string)(unsafe.Pointer(&buf))) +} + +// LabelsFromPromLabels converts Prometheus labels to slice of storepb.Label in type unsafe manner. +// It reuses the same memory. Caller should abort using passed labels.Labels. +func LabelsFromPromLabels(lset labels.Labels) []Label { + return *(*[]Label)(unsafe.Pointer(&lset)) +} + +// LabelsToPromLabels convert slice of storepb.Label to Prometheus labels in type unsafe manner. +// It reuses the same memory. Caller should abort using passed []Label. +func LabelsToPromLabels(lset []Label) labels.Labels { + return *(*labels.Labels)(unsafe.Pointer(&lset)) +} + +// LabelSetsToPromLabelSets converts slice of storepb.LabelSet to slice of Prometheus labels. +func LabelSetsToPromLabelSets(lss ...LabelSet) []labels.Labels { + res := make([]labels.Labels, 0, len(lss)) + for _, ls := range lss { + res = append(res, ls.PromLabels()) + } + return res +} + +// Label is a labels.Label that can be marshaled to/from protobuf reusing the same +// memory address for string bytes. +type Label labels.Label + +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 *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 = 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 *Label) UnmarshalJSON(entry []byte) error { + l := FullCopyLabel{} + + if err := json.Unmarshal(entry, &l); err != nil { + return errors.Wrapf(err, "labels: label field unmarshal: %v", string(entry)) + } + m.Name = l.Name + m.Value = l.Value + return nil +} + +func (m *Label) MarshalJSON() ([]byte, error) { + return json.Marshal(&FullCopyLabel{Name: m.Name, Value: m.Value}) +} + +// Size implements proto.Sizer. +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 +} + +// Equal implements proto.Equaler. +func (m *Label) Equal(other Label) bool { + return m.Name == other.Name && m.Value == other.Value +} + +// Compare implements proto.Comparer. +func (m *Label) Compare(other Label) int { + if c := strings.Compare(m.Name, other.Name); c != 0 { + return c + } + return strings.Compare(m.Value, other.Value) +} + +// ExtendLabels extend given labels by extend in labels format. +// The type conversion is done safely, which means we don't modify extend labels underlying array. +// +// In case of existing labels already present in given label set, it will be overwritten by external one. +func ExtendLabels(lset labels.Labels, extend labels.Labels) labels.Labels { + overwritten := map[string]struct{}{} + for i, l := range lset { + if v := extend.Get(l.Name); v != "" { + lset[i].Value = v + overwritten[l.Name] = struct{}{} + } + } + + for _, l := range extend { + if _, ok := overwritten[l.Name]; ok { + continue + } + lset = append(lset, l) + } + sort.Sort(lset) + return lset +} + +func PromLabelSetsToString(lsets []labels.Labels) string { + s := []string{} + for _, ls := range lsets { + s = append(s, ls.String()) + } + sort.Strings(s) + return strings.Join(s, ",") +} + +func (m *LabelSet) 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 = LabelsFromPromLabels(lbls) + return nil +} + +func (m *LabelSet) MarshalJSON() ([]byte, error) { + return m.PromLabels().MarshalJSON() +} + +// PromLabels return Prometheus labels.Labels without extra allocation. +func (m *LabelSet) PromLabels() labels.Labels { + return LabelsToPromLabels(m.Labels) +} diff --git a/vendor/github.com/thanos-io/thanos/pkg/store/labelpb/types.pb.go b/vendor/github.com/thanos-io/thanos/pkg/store/labelpb/types.pb.go new file mode 100644 index 00000000000..1dad0b24257 --- /dev/null +++ b/vendor/github.com/thanos-io/thanos/pkg/store/labelpb/types.pb.go @@ -0,0 +1,714 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: store/labelpb/types.proto + +package labelpb + +import ( + fmt "fmt" + io "io" + math "math" + math_bits "math/bits" + + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" +) + +// 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 LabelSet struct { + Labels []Label `protobuf:"bytes,1,rep,name=labels,proto3,customtype=Label" json:"labels"` +} + +func (m *LabelSet) Reset() { *m = LabelSet{} } +func (m *LabelSet) String() string { return proto.CompactTextString(m) } +func (*LabelSet) ProtoMessage() {} +func (*LabelSet) Descriptor() ([]byte, []int) { + return fileDescriptor_cdcc9e7dae4870e8, []int{0} +} +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 FullCopyLabel 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 *FullCopyLabel) Reset() { *m = FullCopyLabel{} } +func (m *FullCopyLabel) String() string { return proto.CompactTextString(m) } +func (*FullCopyLabel) ProtoMessage() {} +func (*FullCopyLabel) Descriptor() ([]byte, []int) { + return fileDescriptor_cdcc9e7dae4870e8, []int{1} +} +func (m *FullCopyLabel) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *FullCopyLabel) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_FullCopyLabel.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 *FullCopyLabel) XXX_Merge(src proto.Message) { + xxx_messageInfo_FullCopyLabel.Merge(m, src) +} +func (m *FullCopyLabel) XXX_Size() int { + return m.Size() +} +func (m *FullCopyLabel) XXX_DiscardUnknown() { + xxx_messageInfo_FullCopyLabel.DiscardUnknown(m) +} + +var xxx_messageInfo_FullCopyLabel proto.InternalMessageInfo + +type FullCopyLabelSet struct { + Labels []FullCopyLabel `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels"` +} + +func (m *FullCopyLabelSet) Reset() { *m = FullCopyLabelSet{} } +func (m *FullCopyLabelSet) String() string { return proto.CompactTextString(m) } +func (*FullCopyLabelSet) ProtoMessage() {} +func (*FullCopyLabelSet) Descriptor() ([]byte, []int) { + return fileDescriptor_cdcc9e7dae4870e8, []int{2} +} +func (m *FullCopyLabelSet) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *FullCopyLabelSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_FullCopyLabelSet.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 *FullCopyLabelSet) XXX_Merge(src proto.Message) { + xxx_messageInfo_FullCopyLabelSet.Merge(m, src) +} +func (m *FullCopyLabelSet) XXX_Size() int { + return m.Size() +} +func (m *FullCopyLabelSet) XXX_DiscardUnknown() { + xxx_messageInfo_FullCopyLabelSet.DiscardUnknown(m) +} + +var xxx_messageInfo_FullCopyLabelSet proto.InternalMessageInfo + +func init() { + proto.RegisterType((*LabelSet)(nil), "thanos.LabelSet") + proto.RegisterType((*FullCopyLabel)(nil), "thanos.FullCopyLabel") + proto.RegisterType((*FullCopyLabelSet)(nil), "thanos.FullCopyLabelSet") +} + +func init() { proto.RegisterFile("store/labelpb/types.proto", fileDescriptor_cdcc9e7dae4870e8) } + +var fileDescriptor_cdcc9e7dae4870e8 = []byte{ + // 222 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2c, 0x2e, 0xc9, 0x2f, + 0x4a, 0xd5, 0xcf, 0x49, 0x4c, 0x4a, 0xcd, 0x29, 0x48, 0xd2, 0x2f, 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, 0x0f, 0x2e, 0x0e, 0x1f, 0x90, + 0xa6, 0xe0, 0xd4, 0x12, 0x21, 0x1b, 0x2e, 0x36, 0xb0, 0x01, 0xc5, 0x12, 0x8c, 0x0a, 0xcc, 0x1a, + 0xdc, 0x46, 0xa2, 0x7a, 0x10, 0xad, 0x7a, 0x6e, 0xa5, 0x39, 0x39, 0xce, 0xf9, 0x05, 0x95, 0x60, + 0x95, 0x4e, 0xbc, 0x27, 0xee, 0xc9, 0x33, 0xdc, 0xba, 0x27, 0xcf, 0x0a, 0xe6, 0x06, 0x41, 0xf5, + 0x28, 0x59, 0x72, 0xf1, 0xa2, 0xa8, 0x13, 0x12, 0xe2, 0x62, 0xc9, 0x4b, 0xcc, 0x4d, 0x95, 0x60, + 0x54, 0x60, 0xd4, 0xe0, 0x0c, 0x02, 0xb3, 0x85, 0x44, 0xb8, 0x58, 0xcb, 0x12, 0x73, 0x4a, 0x53, + 0x25, 0x98, 0xc0, 0x82, 0x10, 0x8e, 0x92, 0x3b, 0x97, 0x00, 0x8a, 0x56, 0x90, 0x63, 0x8c, 0x89, + 0x73, 0x0c, 0x0b, 0xc8, 0x31, 0x30, 0x37, 0x38, 0xa9, 0x9e, 0x78, 0x28, 0xc7, 0x70, 0xe2, 0x91, + 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1, + 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72, 0x0c, 0x51, 0xec, 0xd0, 0xe0, 0x49, 0x62, 0x03, 0xfb, 0xdd, + 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x92, 0x8d, 0xbe, 0xf8, 0x36, 0x01, 0x00, 0x00, +} + +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 := 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 *FullCopyLabel) 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 *FullCopyLabel) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FullCopyLabel) 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 *FullCopyLabelSet) 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 *FullCopyLabelSet) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FullCopyLabelSet) 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 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 *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 *FullCopyLabel) 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 *FullCopyLabelSet) 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 (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 *FullCopyLabel) 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: FullCopyLabel: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FullCopyLabel: 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 *FullCopyLabelSet) 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: FullCopyLabelSet: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FullCopyLabelSet: 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, FullCopyLabel{}) + 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 + depth := 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 + } + } + case 1: + iNdEx += 8 + 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 + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTypes + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTypes + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") +) diff --git a/vendor/github.com/thanos-io/thanos/pkg/store/labelpb/types.proto b/vendor/github.com/thanos-io/thanos/pkg/store/labelpb/types.proto new file mode 100644 index 00000000000..f5f56d70606 --- /dev/null +++ b/vendor/github.com/thanos-io/thanos/pkg/store/labelpb/types.proto @@ -0,0 +1,33 @@ +// Copyright (c) The Thanos Authors. +// Licensed under the Apache License 2.0. + +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 LabelSet { + repeated FullCopyLabel labels = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "Label"]; +} + +message FullCopyLabel { + string name = 1; + string value = 2; +} + +message FullCopyLabelSet { + repeated FullCopyLabel labels = 1 [(gogoproto.nullable) = false]; +} From bd22e54b0f8127564217891fa3e3465656c32fe8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20S=CC=8Ctibrany=CC=81?= Date: Fri, 2 Oct 2020 16:59:10 +0200 Subject: [PATCH 3/7] =?UTF-8?q?Go=20mod=20tidy,=20vendor=20Signed-off-by:?= =?UTF-8?q?=20Peter=20S=CC=8Ctibrany=CC=81=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- go.mod | 2 -- go.sum | 4 ---- vendor/modules.txt | 2 -- 3 files changed, 8 deletions(-) diff --git a/go.mod b/go.mod index b2aa11576ac..2410f857df8 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,6 @@ require ( github.com/Masterminds/squirrel v0.0.0-20161115235646-20f192218cf5 github.com/NYTimes/gziphandler v1.1.1 github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d - github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a // indirect github.com/alicebob/miniredis v2.5.0+incompatible github.com/armon/go-metrics v0.3.3 github.com/aws/aws-sdk-go v1.35.5 @@ -56,7 +55,6 @@ require ( github.com/thanos-io/thanos v0.13.1-0.20201002105236-bb1662a1d13c github.com/uber/jaeger-client-go v2.25.0+incompatible github.com/weaveworks/common v0.0.0-20200914083218-61ffdd448099 - github.com/yuin/gopher-lua v0.0.0-20200816102855-ee81675732da // indirect go.etcd.io/bbolt v1.3.5-0.20200615073812-232d8fc87f50 go.etcd.io/etcd v0.5.0-alpha.5.0.20200520232829-54ba9589114f go.uber.org/atomic v1.7.0 diff --git a/go.sum b/go.sum index e4b8d880253..46a7e22c2b6 100644 --- a/go.sum +++ b/go.sum @@ -248,7 +248,6 @@ github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f h1:lBNOc5arjvs8E5mO2tbp github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cortexproject/cortex v0.6.1-0.20200228110116-92ab6cbe0995/go.mod h1:3Xa3DjJxtpXqxcMGdk850lcIRb81M0fyY1MQ6udY134= github.com/cortexproject/cortex v1.2.1-0.20200805064754-d8edc95e2c91/go.mod h1:PVPxNLrxKH+yc8asaJOxuz7TiRmMizFfnSMOnRzM6oM= -github.com/cortexproject/cortex v1.3.1-0.20200901115931-255ff3306960/go.mod h1:ub8BpRZrRa02BOM8NJTnI2YklxW/mGhEkJDrhsDfcfg= github.com/cortexproject/cortex v1.3.1-0.20200923145333-8587ea61fe17/go.mod h1:dJ9gpW7dzQ7z09cKtNN9PfebumgyO4dtNdFQ6eQEed0= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= @@ -1167,8 +1166,6 @@ github.com/thanos-io/thanos v0.8.1-0.20200109203923-552ffa4c1a0d/go.mod h1:usT/T github.com/thanos-io/thanos v0.13.1-0.20200731083140-69b87607decf/go.mod h1:G8caR6G7pSDreRDvFm9wFuyjEBztmr8Ag3kBYpa/fEc= github.com/thanos-io/thanos v0.13.1-0.20200807203500-9b578afb4763 h1:c84P3YUu8bxLWE2csCSK4XJNi5FxcC+HL4WDNDEbTwA= github.com/thanos-io/thanos v0.13.1-0.20200807203500-9b578afb4763/go.mod h1:KyW0a93tsh7v4hXAwo2CVAIRYuZT1Kkf4e04gisQjAg= -github.com/thanos-io/thanos v0.13.1-0.20200923175059-57035bf8f843 h1:juk6GFI+MPKmTKaOzcYnBOUYSIYk9cEFwfVPAHkqh4I= -github.com/thanos-io/thanos v0.13.1-0.20200923175059-57035bf8f843/go.mod h1:U7HVxfAHYptOk9xCuxr8WoILGL1wWdXVqZD3t6JifNA= github.com/thanos-io/thanos v0.13.1-0.20201002105236-bb1662a1d13c h1:zrh4jhgC8AUtoQSdHoiavvpwmtIWuev4q9PypxzLN+g= github.com/thanos-io/thanos v0.13.1-0.20201002105236-bb1662a1d13c/go.mod h1:XcBmJEI7zAdrF9h7mSH2+C2pMFefq60ayosWsIE8CPY= github.com/themihai/gomemcache v0.0.0-20180902122335-24332e2d58ab h1:7ZR3hmisBWw77ZpO1/o86g+JV3VKlk3d48jopJxzTjU= @@ -1197,7 +1194,6 @@ github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtX github.com/vektah/gqlparser v1.1.2/go.mod h1:1ycwN7Ij5njmMkPPAOaRFY4rET2Enx7IkVv3vaXspKw= github.com/weaveworks/common v0.0.0-20200206153930-760e36ae819a/go.mod h1:6enWAqfQBFrE8X/XdJwZr8IKgh1chStuFR0mjU/UOUw= github.com/weaveworks/common v0.0.0-20200625145055-4b1847531bc9/go.mod h1:c98fKi5B9u8OsKGiWHLRKus6ToQ1Tubeow44ECO1uxY= -github.com/weaveworks/common v0.0.0-20200820123129-280614068c5e/go.mod h1:hz10LOsAdzC3K/iXaKoFxOKTDRgxJl+BTGX1GY+TzO4= github.com/weaveworks/common v0.0.0-20200914083218-61ffdd448099 h1:MS5M2antM8wzMUqVxIfAi+yb6yjXvDINRFvLnmNXeIw= github.com/weaveworks/common v0.0.0-20200914083218-61ffdd448099/go.mod h1:hz10LOsAdzC3K/iXaKoFxOKTDRgxJl+BTGX1GY+TzO4= github.com/weaveworks/promrus v1.2.0 h1:jOLf6pe6/vss4qGHjXmGz4oDJQA+AOCqEL3FvvZGz7M= diff --git a/vendor/modules.txt b/vendor/modules.txt index fd098b5d650..f811d748b87 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -39,7 +39,6 @@ github.com/alecthomas/template/parse ## explicit github.com/alecthomas/units # github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a -## explicit github.com/alicebob/gopher-json # github.com/alicebob/miniredis v2.5.0+incompatible ## explicit @@ -650,7 +649,6 @@ github.com/weaveworks/promrus # github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 github.com/xiang90/probing # github.com/yuin/gopher-lua v0.0.0-20200816102855-ee81675732da -## explicit github.com/yuin/gopher-lua github.com/yuin/gopher-lua/ast github.com/yuin/gopher-lua/parse From b9a51b748ae4c80393ebc5b82baca77fccee0d4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20S=CC=8Ctibrany=CC=81?= Date: Tue, 6 Oct 2020 09:17:17 +0200 Subject: [PATCH 4/7] =?UTF-8?q?Set=20segment=20files=20when=20finishing=20?= =?UTF-8?q?block.=20Signed-off-by:=20Peter=20S=CC=8Ctibrany=CC=81=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tools/blocksconvert/builder/tsdb.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/blocksconvert/builder/tsdb.go b/tools/blocksconvert/builder/tsdb.go index 1030bc8ad2b..00896094c0a 100644 --- a/tools/blocksconvert/builder/tsdb.go +++ b/tools/blocksconvert/builder/tsdb.go @@ -19,6 +19,7 @@ import ( "github.com/prometheus/prometheus/tsdb/chunkenc" "github.com/prometheus/prometheus/tsdb/chunks" "github.com/prometheus/prometheus/tsdb/index" + "github.com/thanos-io/thanos/pkg/block" "github.com/thanos-io/thanos/pkg/block/metadata" "github.com/cortexproject/cortex/pkg/chunk" @@ -204,8 +205,9 @@ func (d *tsdbBuilder) finishBlock(source string, labels map[string]string) (ulid }, Thanos: metadata.Thanos{ - Labels: labels, - Source: metadata.SourceType(source), + Labels: labels, + Source: metadata.SourceType(source), + SegmentFiles: block.GetSegmentFiles(d.tmpBlockDir), }, } From 77bbc861f10c3d40747d4b324bea8a9e481b288f Mon Sep 17 00:00:00 2001 From: Marco Pracucci Date: Mon, 19 Oct 2020 18:10:25 +0200 Subject: [PATCH 5/7] Upgraded Thanos to latest master Signed-off-by: Marco Pracucci --- go.mod | 2 +- go.sum | 5 +- pkg/querier/block.go | 8 +- pkg/querier/block_test.go | 36 +- pkg/querier/blocks_store_queryable_test.go | 10 +- pkg/storegateway/bucket_stores_test.go | 4 +- pkg/storegateway/gateway_test.go | 2 +- .../thanos/pkg/discovery/dns/provider.go | 2 +- .../thanos/pkg/discovery/dns/resolver.go | 22 +- .../thanos/pkg/objstore/azure/helpers.go | 9 + .../thanos/pkg/rules/rulespb/custom.go | 5 +- .../thanos/pkg/rules/rulespb/rpc.pb.go | 172 ++++----- .../thanos/pkg/rules/rulespb/rpc.proto | 16 +- .../thanos-io/thanos/pkg/shipper/shipper.go | 1 + .../thanos-io/thanos/pkg/store/bucket.go | 10 +- .../thanos/pkg/store/labelpb/label.go | 148 ++++---- .../thanos/pkg/store/labelpb/types.pb.go | 342 +++++++++--------- .../thanos/pkg/store/labelpb/types.proto | 14 +- .../thanos-io/thanos/pkg/store/local.go | 8 +- .../thanos-io/thanos/pkg/store/multitsdb.go | 4 +- .../thanos-io/thanos/pkg/store/prometheus.go | 22 +- .../thanos-io/thanos/pkg/store/proxy.go | 12 +- .../thanos/pkg/store/storepb/custom.go | 14 +- .../pkg/store/storepb/prompb/types.pb.go | 89 ++--- .../pkg/store/storepb/prompb/types.proto | 7 +- .../thanos/pkg/store/storepb/rpc.pb.go | 146 ++++---- .../thanos/pkg/store/storepb/rpc.proto | 6 +- .../pkg/store/storepb/testutil/series.go | 2 +- .../thanos/pkg/store/storepb/types.pb.go | 75 ++-- .../thanos/pkg/store/storepb/types.proto | 4 +- .../thanos-io/thanos/pkg/store/tsdb.go | 8 +- vendor/modules.txt | 2 +- 32 files changed, 617 insertions(+), 590 deletions(-) diff --git a/go.mod b/go.mod index 2410f857df8..40e6fe84b7d 100644 --- a/go.mod +++ b/go.mod @@ -52,7 +52,7 @@ require ( github.com/sony/gobreaker v0.4.1 github.com/spf13/afero v1.2.2 github.com/stretchr/testify v1.6.1 - github.com/thanos-io/thanos v0.13.1-0.20201002105236-bb1662a1d13c + github.com/thanos-io/thanos v0.13.1-0.20201019130456-f41940581d9a github.com/uber/jaeger-client-go v2.25.0+incompatible github.com/weaveworks/common v0.0.0-20200914083218-61ffdd448099 go.etcd.io/bbolt v1.3.5-0.20200615073812-232d8fc87f50 diff --git a/go.sum b/go.sum index 46a7e22c2b6..9abb8bb42f1 100644 --- a/go.sum +++ b/go.sum @@ -1042,7 +1042,6 @@ github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB8 github.com/prometheus/common v0.11.1 h1:0ZISXCMRuCZcxF77aT1BXY5m74mX2vrGYl1dSwBI0Jo= github.com/prometheus/common v0.11.1/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= github.com/prometheus/common v0.12.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.13.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= github.com/prometheus/common v0.14.0 h1:RHRyE8UocrbjU+6UvRzwi6HjiDfxrrBU91TtbKzkGp4= github.com/prometheus/common v0.14.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= github.com/prometheus/node_exporter v1.0.0-rc.0.0.20200428091818-01054558c289 h1:dTUS1vaLWq+Y6XKOTnrFpoVsQKLCbCp1OLj24TDi7oM= @@ -1166,8 +1165,8 @@ github.com/thanos-io/thanos v0.8.1-0.20200109203923-552ffa4c1a0d/go.mod h1:usT/T github.com/thanos-io/thanos v0.13.1-0.20200731083140-69b87607decf/go.mod h1:G8caR6G7pSDreRDvFm9wFuyjEBztmr8Ag3kBYpa/fEc= github.com/thanos-io/thanos v0.13.1-0.20200807203500-9b578afb4763 h1:c84P3YUu8bxLWE2csCSK4XJNi5FxcC+HL4WDNDEbTwA= github.com/thanos-io/thanos v0.13.1-0.20200807203500-9b578afb4763/go.mod h1:KyW0a93tsh7v4hXAwo2CVAIRYuZT1Kkf4e04gisQjAg= -github.com/thanos-io/thanos v0.13.1-0.20201002105236-bb1662a1d13c h1:zrh4jhgC8AUtoQSdHoiavvpwmtIWuev4q9PypxzLN+g= -github.com/thanos-io/thanos v0.13.1-0.20201002105236-bb1662a1d13c/go.mod h1:XcBmJEI7zAdrF9h7mSH2+C2pMFefq60ayosWsIE8CPY= +github.com/thanos-io/thanos v0.13.1-0.20201019130456-f41940581d9a h1:4rNkFHeY+EIR7UdiYn5fZE7Q35Y3Dmae8q1Qbb90tcY= +github.com/thanos-io/thanos v0.13.1-0.20201019130456-f41940581d9a/go.mod h1:A3qUEEbsVkplJnxyDLwuIuvTDaJPByTH+hMdTl9ujAA= github.com/themihai/gomemcache v0.0.0-20180902122335-24332e2d58ab h1:7ZR3hmisBWw77ZpO1/o86g+JV3VKlk3d48jopJxzTjU= github.com/themihai/gomemcache v0.0.0-20180902122335-24332e2d58ab/go.mod h1:eheTFp954zcWZXCU8d0AT76ftsQOTo4DTqkN/h3k1MY= github.com/tidwall/pretty v0.0.0-20180105212114-65a9db5fad51/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= diff --git a/pkg/querier/block.go b/pkg/querier/block.go index 6f32c6d8145..489d1ef2b1a 100644 --- a/pkg/querier/block.go +++ b/pkg/querier/block.go @@ -56,7 +56,7 @@ func (bqss *blockQuerierSeriesSet) Next() bool { return false } - currLabels := bqss.series[bqss.next].Labels + currLabels := labelpb.ZLabelsToPromLabels(bqss.series[bqss.next].Labels) currChunks := bqss.series[bqss.next].Chunks bqss.next++ @@ -64,7 +64,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(labelpb.LabelsToPromLabels(currLabels), labelpb.LabelsToPromLabels(bqss.series[bqss.next].Labels)) == 0 { + for bqss.next < len(bqss.series) && labels.Compare(currLabels, labelpb.ZLabelsToPromLabels(bqss.series[bqss.next].Labels)) == 0 { currChunks = append(currChunks, bqss.series[bqss.next].Chunks...) bqss.next++ } @@ -86,12 +86,12 @@ func (bqss *blockQuerierSeriesSet) Warnings() storage.Warnings { } // newBlockQuerierSeries makes a new blockQuerierSeries. Input labels must be already sorted by name. -func newBlockQuerierSeries(lbls []labelpb.Label, chunks []storepb.AggrChunk) *blockQuerierSeries { +func newBlockQuerierSeries(lbls []labels.Label, chunks []storepb.AggrChunk) *blockQuerierSeries { sort.Slice(chunks, func(i, j int) bool { return chunks[i].MinTime < chunks[j].MinTime }) - return &blockQuerierSeries{labels: labelpb.LabelsToPromLabels(lbls), chunks: chunks} + return &blockQuerierSeries{labels: lbls, chunks: chunks} } type blockQuerierSeries struct { diff --git a/pkg/querier/block_test.go b/pkg/querier/block_test.go index d822f598cf6..12a62e8e39f 100644 --- a/pkg/querier/block_test.go +++ b/pkg/querier/block_test.go @@ -40,7 +40,7 @@ func TestBlockQuerierSeries(t *testing.T) { }, "should return series on success": { series: &storepb.Series{ - Labels: []labelpb.Label{ + Labels: []labelpb.ZLabel{ {Name: "foo", Value: "bar"}, }, Chunks: []storepb.AggrChunk{ @@ -57,7 +57,7 @@ func TestBlockQuerierSeries(t *testing.T) { }, "should return error on failure while reading encoded chunk data": { series: &storepb.Series{ - Labels: []labelpb.Label{{Name: "foo", Value: "bar"}}, + Labels: []labelpb.ZLabel{{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}}}, }, @@ -71,7 +71,7 @@ func TestBlockQuerierSeries(t *testing.T) { testData := testData t.Run(testName, func(t *testing.T) { - series := newBlockQuerierSeries(testData.series.Labels, testData.series.Chunks) + series := newBlockQuerierSeries(labelpb.ZLabelsToPromLabels(testData.series.Labels), testData.series.Chunks) assert.Equal(t, testData.expectedMetric, series.Labels()) @@ -120,7 +120,7 @@ func TestBlockQuerierSeriesSet(t *testing.T) { series: []*storepb.Series{ // first, with one chunk. { - Labels: mkLabels("__name__", "first", "a", "a"), + Labels: mkZLabels("__name__", "first", "a", "a"), Chunks: []storepb.AggrChunk{ createAggrChunkWithSineSamples(now, now.Add(100*time.Second), 3*time.Millisecond), // ceil(100 / 0.003) samples (= 33334) }, @@ -128,7 +128,7 @@ func TestBlockQuerierSeriesSet(t *testing.T) { // continuation of previous series. Must have exact same labels. { - Labels: mkLabels("__name__", "first", "a", "a"), + Labels: mkZLabels("__name__", "first", "a", "a"), Chunks: []storepb.AggrChunk{ createAggrChunkWithSineSamples(now.Add(100*time.Second), now.Add(200*time.Second), 3*time.Millisecond), // ceil(100 / 0.003) samples more, 66668 in total }, @@ -136,7 +136,7 @@ func TestBlockQuerierSeriesSet(t *testing.T) { // second, with multiple chunks { - Labels: mkLabels("__name__", "second"), + Labels: mkZLabels("__name__", "second"), Chunks: []storepb.AggrChunk{ // unordered chunks createAggrChunkWithSineSamples(now.Add(400*time.Second), now.Add(600*time.Second), 5*time.Millisecond), // 200 / 0.005 (= 40000 samples, = 120000 in total) @@ -147,13 +147,13 @@ func TestBlockQuerierSeriesSet(t *testing.T) { // overlapping { - Labels: mkLabels("__name__", "overlapping"), + Labels: mkZLabels("__name__", "overlapping"), Chunks: []storepb.AggrChunk{ createAggrChunkWithSineSamples(now, now.Add(10*time.Second), 5*time.Millisecond), // 10 / 0.005 = 2000 samples }, }, { - Labels: mkLabels("__name__", "overlapping"), + Labels: mkZLabels("__name__", "overlapping"), Chunks: []storepb.AggrChunk{ // 10 / 0.005 = 2000 samples, but first 1000 are overlapping with previous series, so this chunk only contributes 1000 createAggrChunkWithSineSamples(now.Add(5*time.Second), now.Add(15*time.Second), 5*time.Millisecond), @@ -162,21 +162,21 @@ func TestBlockQuerierSeriesSet(t *testing.T) { // overlapping 2. Chunks here come in wrong order. { - Labels: mkLabels("__name__", "overlapping2"), + Labels: mkZLabels("__name__", "overlapping2"), Chunks: []storepb.AggrChunk{ // entire range overlaps with the next chunk, so this chunks contributes 0 samples (it will be sorted as second) createAggrChunkWithSineSamples(now.Add(3*time.Second), now.Add(7*time.Second), 5*time.Millisecond), }, }, { - Labels: mkLabels("__name__", "overlapping2"), + Labels: mkZLabels("__name__", "overlapping2"), Chunks: []storepb.AggrChunk{ // this chunk has completely overlaps previous chunk. Since its minTime is lower, it will be sorted as first. createAggrChunkWithSineSamples(now, now.Add(10*time.Second), 5*time.Millisecond), // 10 / 0.005 = 2000 samples }, }, { - Labels: mkLabels("__name__", "overlapping2"), + Labels: mkZLabels("__name__", "overlapping2"), Chunks: []storepb.AggrChunk{ // no samples createAggrChunkWithSineSamples(now, now, 5*time.Millisecond), @@ -184,7 +184,7 @@ func TestBlockQuerierSeriesSet(t *testing.T) { }, { - Labels: mkLabels("__name__", "overlapping2"), + Labels: mkZLabels("__name__", "overlapping2"), Chunks: []storepb.AggrChunk{ // 2000 samples more (10 / 0.005) createAggrChunkWithSineSamples(now.Add(20*time.Second), now.Add(30*time.Second), 5*time.Millisecond), @@ -263,11 +263,11 @@ func createAggrChunk(minTime, maxTime int64, samples ...promql.Point) storepb.Ag } } -func mkLabels(s ...string) []labelpb.Label { - var result []labelpb.Label +func mkZLabels(s ...string) []labelpb.ZLabel { + var result []labelpb.ZLabel for i := 0; i+1 < len(s); i = i + 2 { - result = append(result, labelpb.Label{ + result = append(result, labelpb.ZLabel{ Name: s[i], Value: s[i+1], }) @@ -276,6 +276,10 @@ func mkLabels(s ...string) []labelpb.Label { return result } +func mkLabels(s ...string) []labels.Label { + return labelpb.ZLabelsToPromLabels(mkZLabels(s...)) +} + func Benchmark_newBlockQuerierSeries(b *testing.B) { lbls := mkLabels( "__name__", "test", @@ -309,7 +313,7 @@ func Benchmark_blockQuerierSeriesSet_iteration(b *testing.B) { // Generate series. series := make([]*storepb.Series, 0, numSeries) for seriesID := 0; seriesID < numSeries; seriesID++ { - lbls := mkLabels("__name__", "test", "series_id", strconv.Itoa(seriesID)) + lbls := mkZLabels("__name__", "test", "series_id", strconv.Itoa(seriesID)) chunks := make([]storepb.AggrChunk, 0, numChunksPerSeries) // Create chunks with 1 sample per second. diff --git a/pkg/querier/blocks_store_queryable_test.go b/pkg/querier/blocks_store_queryable_test.go index 8d77f104388..3f2d20dd187 100644 --- a/pkg/querier/blocks_store_queryable_test.go +++ b/pkg/querier/blocks_store_queryable_test.go @@ -625,8 +625,8 @@ func TestBlocksStoreQuerier_SelectSortedShouldHonorQueryStoreAfter(t *testing.T) func TestBlocksStoreQuerier_PromQLExecution(t *testing.T) { block1 := ulid.MustNew(1, nil) block2 := ulid.MustNew(2, nil) - series1 := []labelpb.Label{{Name: "__name__", Value: "metric_1"}} - series2 := []labelpb.Label{{Name: "__name__", Value: "metric_2"}} + series1 := []labelpb.ZLabel{{Name: "__name__", Value: "metric_1"}} + series2 := []labelpb.ZLabel{{Name: "__name__", Value: "metric_2"}} series1Samples := []promql.Point{ {T: 1589759955000, V: 1}, @@ -738,8 +738,8 @@ func TestBlocksStoreQuerier_PromQLExecution(t *testing.T) { require.NoError(t, err) require.Len(t, matrix, 2) - assert.Equal(t, labelpb.LabelsToPromLabels(series1), matrix[0].Metric) - assert.Equal(t, labelpb.LabelsToPromLabels(series2), matrix[1].Metric) + assert.Equal(t, labelpb.ZLabelsToPromLabels(series1), matrix[0].Metric) + assert.Equal(t, labelpb.ZLabelsToPromLabels(series2), matrix[1].Metric) assert.Equal(t, series1Samples, matrix[0].Points) assert.Equal(t, series2Samples, matrix[1].Points) } @@ -841,7 +841,7 @@ func mockSeriesResponse(lbls labels.Labels, timeMillis int64, value float64) *st return &storepb.SeriesResponse{ Result: &storepb.SeriesResponse_Series{ Series: &storepb.Series{ - Labels: labelpb.LabelsFromPromLabels(lbls), + Labels: labelpb.ZLabelsFromPromLabels(lbls), Chunks: []storepb.AggrChunk{ {MinTime: timeMillis, MaxTime: timeMillis, Raw: &storepb.Chunk{Type: storepb.Chunk_XOR, Data: chunkData}}, }, diff --git a/pkg/storegateway/bucket_stores_test.go b/pkg/storegateway/bucket_stores_test.go index d96b9092b89..357e1f0d394 100644 --- a/pkg/storegateway/bucket_stores_test.go +++ b/pkg/storegateway/bucket_stores_test.go @@ -69,7 +69,7 @@ func TestBucketStores_InitialSync(t *testing.T) { require.NoError(t, err) assert.Empty(t, warnings) require.Len(t, seriesSet, 1) - assert.Equal(t, []labelpb.Label{{Name: labels.MetricName, Value: metricName}}, seriesSet[0].Labels) + assert.Equal(t, []labelpb.ZLabel{{Name: labels.MetricName, Value: metricName}}, seriesSet[0].Labels) } // Query series of another user. @@ -147,7 +147,7 @@ func TestBucketStores_SyncBlocks(t *testing.T) { require.NoError(t, err) assert.Empty(t, warnings) assert.Len(t, seriesSet, 1) - assert.Equal(t, []labelpb.Label{{Name: labels.MetricName, Value: metricName}}, seriesSet[0].Labels) + assert.Equal(t, []labelpb.ZLabel{{Name: labels.MetricName, Value: metricName}}, seriesSet[0].Labels) assert.NoError(t, testutil.GatherAndCompare(reg, strings.NewReader(` # HELP cortex_bucket_store_blocks_loaded Number of currently loaded blocks. diff --git a/pkg/storegateway/gateway_test.go b/pkg/storegateway/gateway_test.go index 3ae54429ad6..e8de4ab6a7b 100644 --- a/pkg/storegateway/gateway_test.go +++ b/pkg/storegateway/gateway_test.go @@ -696,7 +696,7 @@ func TestStoreGateway_SeriesQueryingShouldRemoveExternalLabels(t *testing.T) { actual := srv.SeriesSet[seriesID] // Ensure Cortex external labels have been removed. - assert.Equal(t, []labelpb.Label{{Name: "series_id", Value: strconv.Itoa(seriesID)}}, actual.Labels) + assert.Equal(t, []labelpb.ZLabel{{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/vendor/github.com/thanos-io/thanos/pkg/discovery/dns/provider.go b/vendor/github.com/thanos-io/thanos/pkg/discovery/dns/provider.go index e80f7aac49f..75c3b02fd19 100644 --- a/vendor/github.com/thanos-io/thanos/pkg/discovery/dns/provider.go +++ b/vendor/github.com/thanos-io/thanos/pkg/discovery/dns/provider.go @@ -57,7 +57,7 @@ func (t ResolverType) ToResolver(logger log.Logger) ipLookupResolver { // If empty resolver type is net.DefaultResolver. func NewProvider(logger log.Logger, reg prometheus.Registerer, resolverType ResolverType) *Provider { p := &Provider{ - resolver: NewResolver(resolverType.ToResolver(logger)), + resolver: NewResolver(resolverType.ToResolver(logger), logger), resolved: make(map[string][]string), logger: logger, resolverAddrs: extprom.NewTxGaugeVec(reg, prometheus.GaugeOpts{ diff --git a/vendor/github.com/thanos-io/thanos/pkg/discovery/dns/resolver.go b/vendor/github.com/thanos-io/thanos/pkg/discovery/dns/resolver.go index ef730547689..679834f7b22 100644 --- a/vendor/github.com/thanos-io/thanos/pkg/discovery/dns/resolver.go +++ b/vendor/github.com/thanos-io/thanos/pkg/discovery/dns/resolver.go @@ -9,6 +9,9 @@ import ( "strconv" "strings" + "github.com/go-kit/kit/log" + "github.com/go-kit/kit/log/level" + "github.com/pkg/errors" ) @@ -38,11 +41,12 @@ type ipLookupResolver interface { type dnsSD struct { resolver ipLookupResolver + logger log.Logger } // NewResolver creates a resolver with given underlying resolver. -func NewResolver(resolver ipLookupResolver) Resolver { - return &dnsSD{resolver: resolver} +func NewResolver(resolver ipLookupResolver, logger log.Logger) Resolver { + return &dnsSD{resolver: resolver, logger: logger} } func (s *dnsSD) Resolve(ctx context.Context, name string, qtype QType) ([]string, error) { @@ -71,7 +75,15 @@ func (s *dnsSD) Resolve(ctx context.Context, name string, qtype QType) ([]string } ips, err := s.resolver.LookupIPAddr(ctx, host) if err != nil { - return nil, errors.Wrapf(err, "lookup IP addresses %q", host) + // We exclude error from std Golang resolver for the case of the domain (e.g `NXDOMAIN`) not being found by DNS + // server. Since `miekg` does not consider this as an error, when the host cannot be found, empty slice will be + // returned. + if dnsErr, ok := err.(*net.DNSError); !ok || !dnsErr.IsNotFound { + return nil, errors.Wrapf(err, "lookup IP addresses %q", host) + } + if ips == nil { + level.Error(s.logger).Log("msg", "failed to lookup IP addresses", "host", host, "err", err) + } } for _, ip := range ips { res = append(res, appendScheme(scheme, net.JoinHostPort(ip.String(), port))) @@ -106,6 +118,10 @@ func (s *dnsSD) Resolve(ctx context.Context, name string, qtype QType) ([]string return nil, errors.Errorf("invalid lookup scheme %q", qtype) } + if res == nil && err == nil { + level.Warn(s.logger).Log("msg", "IP address lookup yielded no results. No host found or no addresses found", "host", host) + } + return res, nil } diff --git a/vendor/github.com/thanos-io/thanos/pkg/objstore/azure/helpers.go b/vendor/github.com/thanos-io/thanos/pkg/objstore/azure/helpers.go index 0189a49acf9..a372878ac95 100644 --- a/vendor/github.com/thanos-io/thanos/pkg/objstore/azure/helpers.go +++ b/vendor/github.com/thanos-io/thanos/pkg/objstore/azure/helpers.go @@ -10,6 +10,7 @@ import ( "regexp" "time" + "github.com/Azure/azure-pipeline-go/pipeline" blob "github.com/Azure/azure-storage-blob-go/azblob" ) @@ -34,6 +35,14 @@ func getContainerURL(ctx context.Context, conf Config) (blob.ContainerURL, error p := blob.NewPipeline(c, blob.PipelineOptions{ Retry: retryOptions, Telemetry: blob.TelemetryOptions{Value: "Thanos"}, + RequestLog: blob.RequestLogOptions{ + // Log a warning if an operation takes longer than the specified duration. + // (-1=no logging; 0=default 3s threshold) + LogWarningIfTryOverThreshold: -1, + }, + Log: pipeline.LogOptions{ + ShouldLog: nil, + }, }) u, err := url.Parse(fmt.Sprintf("https://%s.%s", conf.StorageAccountName, conf.Endpoint)) if err != nil { diff --git a/vendor/github.com/thanos-io/thanos/pkg/rules/rulespb/custom.go b/vendor/github.com/thanos-io/thanos/pkg/rules/rulespb/custom.go index a2708075b87..567c154edda 100644 --- a/vendor/github.com/thanos-io/thanos/pkg/rules/rulespb/custom.go +++ b/vendor/github.com/thanos-io/thanos/pkg/rules/rulespb/custom.go @@ -13,7 +13,6 @@ import ( "github.com/pkg/errors" "github.com/prometheus/prometheus/pkg/labels" "github.com/thanos-io/thanos/pkg/store/labelpb" - storepb "github.com/thanos-io/thanos/pkg/store/storepb" ) const ( @@ -84,10 +83,10 @@ func (r *Rule) GetLabels() labels.Labels { } func (r *Rule) SetLabels(ls labels.Labels) { - var result storepb.LabelSet + var result labelpb.ZLabelSet if len(ls) > 0 { - result = storepb.LabelSet{Labels: labelpb.LabelsFromPromLabels(ls)} + result = labelpb.ZLabelSet{Labels: labelpb.ZLabelsFromPromLabels(ls)} } switch { diff --git a/vendor/github.com/thanos-io/thanos/pkg/rules/rulespb/rpc.pb.go b/vendor/github.com/thanos-io/thanos/pkg/rules/rulespb/rpc.pb.go index 72785cb90ae..a4e85327975 100644 --- a/vendor/github.com/thanos-io/thanos/pkg/rules/rulespb/rpc.pb.go +++ b/vendor/github.com/thanos-io/thanos/pkg/rules/rulespb/rpc.pb.go @@ -402,11 +402,11 @@ func (*Rule) XXX_OneofWrappers() []interface{} { } type AlertInstance struct { - Labels labelpb.LabelSet `protobuf:"bytes,1,opt,name=labels,proto3" json:"labels"` - Annotations labelpb.LabelSet `protobuf:"bytes,2,opt,name=annotations,proto3" json:"annotations"` - State AlertState `protobuf:"varint,3,opt,name=state,proto3,enum=thanos.AlertState" json:"state"` - ActiveAt *time.Time `protobuf:"bytes,4,opt,name=active_at,json=activeAt,proto3,stdtime" json:"activeAt,omitempty"` - Value string `protobuf:"bytes,5,opt,name=value,proto3" json:"value"` + Labels labelpb.ZLabelSet `protobuf:"bytes,1,opt,name=labels,proto3" json:"labels"` + Annotations labelpb.ZLabelSet `protobuf:"bytes,2,opt,name=annotations,proto3" json:"annotations"` + State AlertState `protobuf:"varint,3,opt,name=state,proto3,enum=thanos.AlertState" json:"state"` + ActiveAt *time.Time `protobuf:"bytes,4,opt,name=active_at,json=activeAt,proto3,stdtime" json:"activeAt,omitempty"` + Value string `protobuf:"bytes,5,opt,name=value,proto3" json:"value"` // Thanos specific. Used mainly for alert API purposes. PartialResponseStrategy storepb.PartialResponseStrategy `protobuf:"varint,6,opt,name=PartialResponseStrategy,proto3,enum=thanos.PartialResponseStrategy" json:"partialResponseStrategy"` } @@ -446,17 +446,17 @@ var xxx_messageInfo_AlertInstance proto.InternalMessageInfo type Alert struct { /// state returns the maximum state of alert instances for this rule. - State AlertState `protobuf:"varint,1,opt,name=state,proto3,enum=thanos.AlertState" json:"state"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name"` - Query string `protobuf:"bytes,3,opt,name=query,proto3" json:"query"` - DurationSeconds float64 `protobuf:"fixed64,4,opt,name=duration_seconds,json=durationSeconds,proto3" json:"duration"` - Labels labelpb.LabelSet `protobuf:"bytes,5,opt,name=labels,proto3" json:"labels"` - Annotations labelpb.LabelSet `protobuf:"bytes,6,opt,name=annotations,proto3" json:"annotations"` - Alerts []*AlertInstance `protobuf:"bytes,7,rep,name=alerts,proto3" json:"alerts"` - Health string `protobuf:"bytes,8,opt,name=health,proto3" json:"health"` - LastError string `protobuf:"bytes,9,opt,name=last_error,json=lastError,proto3" json:"lastError,omitempty"` - EvaluationDurationSeconds float64 `protobuf:"fixed64,10,opt,name=evaluation_duration_seconds,json=evaluationDurationSeconds,proto3" json:"evaluationTime"` - LastEvaluation time.Time `protobuf:"bytes,11,opt,name=last_evaluation,json=lastEvaluation,proto3,stdtime" json:"lastEvaluation"` + State AlertState `protobuf:"varint,1,opt,name=state,proto3,enum=thanos.AlertState" json:"state"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name"` + Query string `protobuf:"bytes,3,opt,name=query,proto3" json:"query"` + DurationSeconds float64 `protobuf:"fixed64,4,opt,name=duration_seconds,json=durationSeconds,proto3" json:"duration"` + Labels labelpb.ZLabelSet `protobuf:"bytes,5,opt,name=labels,proto3" json:"labels"` + Annotations labelpb.ZLabelSet `protobuf:"bytes,6,opt,name=annotations,proto3" json:"annotations"` + Alerts []*AlertInstance `protobuf:"bytes,7,rep,name=alerts,proto3" json:"alerts"` + Health string `protobuf:"bytes,8,opt,name=health,proto3" json:"health"` + LastError string `protobuf:"bytes,9,opt,name=last_error,json=lastError,proto3" json:"lastError,omitempty"` + EvaluationDurationSeconds float64 `protobuf:"fixed64,10,opt,name=evaluation_duration_seconds,json=evaluationDurationSeconds,proto3" json:"evaluationTime"` + LastEvaluation time.Time `protobuf:"bytes,11,opt,name=last_evaluation,json=lastEvaluation,proto3,stdtime" json:"lastEvaluation"` } func (m *Alert) Reset() { *m = Alert{} } @@ -493,13 +493,13 @@ func (m *Alert) XXX_DiscardUnknown() { var xxx_messageInfo_Alert proto.InternalMessageInfo type RecordingRule struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name"` - Query string `protobuf:"bytes,2,opt,name=query,proto3" json:"query"` - Labels labelpb.LabelSet `protobuf:"bytes,3,opt,name=labels,proto3" json:"labels"` - Health string `protobuf:"bytes,4,opt,name=health,proto3" json:"health"` - LastError string `protobuf:"bytes,5,opt,name=last_error,json=lastError,proto3" json:"lastError,omitempty"` - EvaluationDurationSeconds float64 `protobuf:"fixed64,6,opt,name=evaluation_duration_seconds,json=evaluationDurationSeconds,proto3" json:"evaluationTime"` - LastEvaluation time.Time `protobuf:"bytes,7,opt,name=last_evaluation,json=lastEvaluation,proto3,stdtime" json:"lastEvaluation"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name"` + Query string `protobuf:"bytes,2,opt,name=query,proto3" json:"query"` + Labels labelpb.ZLabelSet `protobuf:"bytes,3,opt,name=labels,proto3" json:"labels"` + Health string `protobuf:"bytes,4,opt,name=health,proto3" json:"health"` + LastError string `protobuf:"bytes,5,opt,name=last_error,json=lastError,proto3" json:"lastError,omitempty"` + EvaluationDurationSeconds float64 `protobuf:"fixed64,6,opt,name=evaluation_duration_seconds,json=evaluationDurationSeconds,proto3" json:"evaluationTime"` + LastEvaluation time.Time `protobuf:"bytes,7,opt,name=last_evaluation,json=lastEvaluation,proto3,stdtime" json:"lastEvaluation"` } func (m *RecordingRule) Reset() { *m = RecordingRule{} } @@ -551,69 +551,69 @@ func init() { func init() { proto.RegisterFile("rules/rulespb/rpc.proto", fileDescriptor_91b1d28f30eb5efb) } var fileDescriptor_91b1d28f30eb5efb = []byte{ - // 983 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0x4f, 0x6f, 0xe3, 0x44, - 0x14, 0xb7, 0x9b, 0xd8, 0x89, 0x5f, 0xda, 0x6e, 0x98, 0xdd, 0xaa, 0x6e, 0x16, 0xc5, 0x55, 0xa4, - 0x45, 0x05, 0xb1, 0x09, 0x6a, 0xb5, 0x0b, 0x9c, 0x50, 0xd2, 0x86, 0x36, 0x52, 0x55, 0x56, 0x93, - 0x88, 0x03, 0x1c, 0xc2, 0x24, 0x9d, 0x4d, 0x23, 0x39, 0xb6, 0x77, 0x66, 0x52, 0x94, 0x33, 0x5f, - 0x60, 0xaf, 0x7c, 0x10, 0xbe, 0x00, 0xa7, 0x5e, 0x90, 0xf6, 0xc8, 0x29, 0x40, 0x7b, 0xcb, 0xa7, - 0x40, 0x33, 0x63, 0xc7, 0x69, 0xb7, 0xa5, 0xbb, 0x10, 0x2e, 0x7e, 0x33, 0xef, 0xfd, 0xde, 0xfc, - 0x79, 0xef, 0xe7, 0x9f, 0x0d, 0x9b, 0x6c, 0xec, 0x53, 0x5e, 0x53, 0xcf, 0xa8, 0x57, 0x63, 0x51, - 0xbf, 0x1a, 0xb1, 0x50, 0x84, 0xc8, 0x16, 0x67, 0x24, 0x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, 0x56, 0xca, 0x8f, 0xcc, 0x7b, 0xf2, 0x23, 0xed, 0x4d, 0xf6, 0x1d, 0x7b, 0x63, - 0x2d, 0xab, 0x37, 0xf6, 0x92, 0x7a, 0x93, 0x5b, 0x66, 0x6f, 0x3e, 0xd9, 0x03, 0x48, 0x25, 0x00, - 0xad, 0x42, 0xbe, 0x75, 0x52, 0xdf, 0xef, 0xb4, 0xbe, 0x6d, 0x16, 0x0d, 0x54, 0x80, 0xdc, 0x8b, - 0xe6, 0xc9, 0x41, 0xeb, 0xe4, 0x50, 0xff, 0xf5, 0x7c, 0xdd, 0xc2, 0x72, 0xbc, 0xb2, 0xfb, 0x15, - 0x58, 0xea, 0xaf, 0x07, 0x3d, 0x4f, 0x06, 0x8f, 0x6e, 0xfb, 0x5b, 0x2b, 0x6d, 0xdc, 0xf0, 0x6a, - 0x75, 0xfa, 0xcc, 0x6c, 0x3c, 0xb9, 0xf8, 0xab, 0x6c, 0x5c, 0x5c, 0x96, 0xcd, 0x37, 0x97, 0x65, - 0xf3, 0xcf, 0xcb, 0xb2, 0xf9, 0xfa, 0xaa, 0x6c, 0xbc, 0xb9, 0x2a, 0x1b, 0xbf, 0x5f, 0x95, 0x8d, - 0xef, 0x72, 0xf1, 0x1f, 0x6a, 0xcf, 0x56, 0x97, 0xdb, 0xfb, 0x3b, 0x00, 0x00, 0xff, 0xff, 0x6d, - 0xf1, 0x63, 0x71, 0xb9, 0x0a, 0x00, 0x00, + // 981 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xcd, 0x6e, 0xdb, 0x46, + 0x10, 0x26, 0x2d, 0x91, 0x12, 0xc7, 0x76, 0xa2, 0x6e, 0x62, 0x98, 0x56, 0x0a, 0xd1, 0x10, 0x90, + 0xc2, 0x2d, 0x1a, 0xa9, 0xb0, 0x91, 0x14, 0x39, 0x15, 0x92, 0xad, 0xc6, 0x02, 0x0c, 0x37, 0x58, + 0x09, 0x3d, 0xa4, 0x07, 0x75, 0x25, 0x6f, 0x64, 0x01, 0x14, 0xc9, 0xec, 0xae, 0x5c, 0xe8, 0x01, + 0x7a, 0xcf, 0xb9, 0x2f, 0xd2, 0x7b, 0x4f, 0xbe, 0x14, 0xc8, 0xb1, 0x27, 0xb5, 0xb5, 0x6f, 0x7a, + 0x8a, 0x62, 0x77, 0x49, 0x51, 0x56, 0xe5, 0x3a, 0x69, 0xd5, 0x0b, 0x67, 0x77, 0xe6, 0x9b, 0xfd, + 0x99, 0xf9, 0xf8, 0x91, 0xb0, 0xcd, 0x46, 0x3e, 0xe5, 0x55, 0xf5, 0x8c, 0xba, 0x55, 0x16, 0xf5, + 0x2a, 0x11, 0x0b, 0x45, 0x88, 0x6c, 0x71, 0x4e, 0x82, 0x90, 0x17, 0x77, 0xb8, 0x08, 0x19, 0xad, + 0xaa, 0x67, 0xd4, 0xad, 0x8a, 0x71, 0x44, 0xb9, 0x86, 0x24, 0x21, 0x9f, 0x74, 0xa9, 0xbf, 0x10, + 0x7a, 0xd8, 0x0f, 0xfb, 0xa1, 0x1a, 0x56, 0xe5, 0x28, 0xf6, 0x7a, 0xfd, 0x30, 0xec, 0xfb, 0xb4, + 0xaa, 0x66, 0xdd, 0xd1, 0xeb, 0xaa, 0x18, 0x0c, 0x29, 0x17, 0x64, 0x18, 0x69, 0x40, 0xf9, 0x17, + 0x13, 0x36, 0xb0, 0x3c, 0x0a, 0xa6, 0x6f, 0x46, 0x94, 0x0b, 0xf4, 0x04, 0xb2, 0x72, 0x59, 0xd7, + 0xdc, 0x35, 0xf7, 0xee, 0xed, 0xef, 0x54, 0xf4, 0xa1, 0x2a, 0xf3, 0x98, 0x4a, 0x7b, 0x1c, 0x51, + 0xac, 0x60, 0xe8, 0x3b, 0xd8, 0x89, 0x08, 0x13, 0x03, 0xe2, 0x77, 0x18, 0xe5, 0x51, 0x18, 0x70, + 0xda, 0xe1, 0x82, 0x11, 0x41, 0x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2e, 0x19, 0xaf, 0x72, + 0xf1, 0x6f, 0x6a, 0xd7, 0x56, 0x97, 0x3b, 0xf8, 0x2b, 0x00, 0x00, 0xff, 0xff, 0x02, 0xf0, 0xe5, + 0x62, 0xbe, 0x0a, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/vendor/github.com/thanos-io/thanos/pkg/rules/rulespb/rpc.proto b/vendor/github.com/thanos-io/thanos/pkg/rules/rulespb/rpc.proto index b6da4ef8d1a..2d791f6cf09 100644 --- a/vendor/github.com/thanos-io/thanos/pkg/rules/rulespb/rpc.proto +++ b/vendor/github.com/thanos-io/thanos/pkg/rules/rulespb/rpc.proto @@ -101,11 +101,11 @@ enum AlertState { } message AlertInstance { - LabelSet labels = 1 [(gogoproto.jsontag) = "labels", (gogoproto.nullable) = false ]; - LabelSet annotations = 2 [(gogoproto.jsontag) = "annotations", (gogoproto.nullable) = false ]; - AlertState state = 3 [(gogoproto.jsontag) = "state" ]; - google.protobuf.Timestamp active_at = 4 [(gogoproto.jsontag) = "activeAt,omitempty", (gogoproto.stdtime) = true]; - string value = 5 [(gogoproto.jsontag) = "value" ]; + ZLabelSet labels = 1 [(gogoproto.jsontag) = "labels", (gogoproto.nullable) = false ]; + ZLabelSet annotations = 2 [(gogoproto.jsontag) = "annotations", (gogoproto.nullable) = false ]; + AlertState state = 3 [(gogoproto.jsontag) = "state" ]; + google.protobuf.Timestamp active_at = 4 [(gogoproto.jsontag) = "activeAt,omitempty", (gogoproto.stdtime) = true]; + string value = 5 [(gogoproto.jsontag) = "value" ]; // Thanos specific. Used mainly for alert API purposes. PartialResponseStrategy PartialResponseStrategy = 6 [(gogoproto.jsontag) = "partialResponseStrategy" ]; @@ -117,8 +117,8 @@ message Alert { string name = 2 [(gogoproto.jsontag) = "name" ]; string query = 3 [(gogoproto.jsontag) = "query" ]; double duration_seconds = 4 [(gogoproto.jsontag) = "duration" ]; - LabelSet labels = 5 [(gogoproto.jsontag) = "labels", (gogoproto.nullable) = false ]; - LabelSet annotations = 6 [(gogoproto.jsontag) = "annotations", (gogoproto.nullable) = false ]; + ZLabelSet labels = 5 [(gogoproto.jsontag) = "labels", (gogoproto.nullable) = false ]; + ZLabelSet annotations = 6 [(gogoproto.jsontag) = "annotations", (gogoproto.nullable) = false ]; repeated AlertInstance alerts = 7 [(gogoproto.jsontag) = "alerts" ]; string health = 8 [(gogoproto.jsontag) = "health" ]; string last_error = 9 [(gogoproto.jsontag) = "lastError,omitempty" ]; @@ -129,7 +129,7 @@ message Alert { message RecordingRule { string name = 1 [(gogoproto.jsontag) = "name" ]; string query = 2 [(gogoproto.jsontag) = "query" ]; - LabelSet labels = 3 [(gogoproto.jsontag) = "labels", (gogoproto.nullable) = false ]; + ZLabelSet labels = 3 [(gogoproto.jsontag) = "labels", (gogoproto.nullable) = false ]; string health = 4 [(gogoproto.jsontag) = "health" ]; string last_error = 5 [(gogoproto.jsontag) = "lastError,omitempty" ]; double evaluation_duration_seconds = 6 [(gogoproto.jsontag) = "evaluationTime" ]; diff --git a/vendor/github.com/thanos-io/thanos/pkg/shipper/shipper.go b/vendor/github.com/thanos-io/thanos/pkg/shipper/shipper.go index 6804f0f2e44..06b8391e3f5 100644 --- a/vendor/github.com/thanos-io/thanos/pkg/shipper/shipper.go +++ b/vendor/github.com/thanos-io/thanos/pkg/shipper/shipper.go @@ -282,6 +282,7 @@ func (s *Shipper) Sync(ctx context.Context) (uploaded int, err error) { return 0, errors.Wrap(err, "check exists") } if ok { + meta.Uploaded = append(meta.Uploaded, m.ULID) continue } diff --git a/vendor/github.com/thanos-io/thanos/pkg/store/bucket.go b/vendor/github.com/thanos-io/thanos/pkg/store/bucket.go index 188cbbe1403..2c162c4885c 100644 --- a/vendor/github.com/thanos-io/thanos/pkg/store/bucket.go +++ b/vendor/github.com/thanos-io/thanos/pkg/store/bucket.go @@ -273,7 +273,7 @@ type BucketStore struct { partitioner partitioner filterConfig *FilterConfig - advLabelSets []storepb.LabelSet + advLabelSets []labelpb.ZLabelSet enableCompatibilityLabel bool // Reencode postings using diff+varint+snappy when storing to cache. @@ -412,10 +412,10 @@ func (s *BucketStore) SyncBlocks(ctx context.Context) error { // Sync advertise labels. var storeLabels labels.Labels s.mtx.Lock() - s.advLabelSets = make([]storepb.LabelSet, 0, len(s.advLabelSets)) + s.advLabelSets = make([]labelpb.ZLabelSet, 0, len(s.advLabelSets)) for _, bs := range s.blockSets { storeLabels = storeLabels[:0] - s.advLabelSets = append(s.advLabelSets, storepb.LabelSet{Labels: labelpb.LabelsFromPromLabels(append(storeLabels, bs.labels...))}) + s.advLabelSets = append(s.advLabelSets, labelpb.ZLabelSet{Labels: labelpb.ZLabelsFromPromLabels(append(storeLabels, bs.labels...))}) } sort.Slice(s.advLabelSets, func(i, j int) bool { return strings.Compare(s.advLabelSets[i].String(), s.advLabelSets[j].String()) < 0 @@ -604,7 +604,7 @@ func (s *BucketStore) Info(context.Context, *storepb.InfoRequest) (*storepb.Info if s.enableCompatibilityLabel && len(res.LabelSets) > 0 { // This is for compatibility with Querier v0.7.0. // See query.StoreCompatibilityTypeLabelName comment for details. - res.LabelSets = append(res.LabelSets, storepb.LabelSet{Labels: []storepb.Label{{Name: CompatibilityTypeLabelName, Value: "store"}}}) + res.LabelSets = append(res.LabelSets, labelpb.ZLabelSet{Labels: []labelpb.ZLabel{{Name: CompatibilityTypeLabelName, Value: "store"}}}) } return res, nil } @@ -1015,7 +1015,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.LabelsFromPromLabels(lset) + series.Labels = labelpb.ZLabelsFromPromLabels(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/vendor/github.com/thanos-io/thanos/pkg/store/labelpb/label.go b/vendor/github.com/thanos-io/thanos/pkg/store/labelpb/label.go index bc4b58d6450..5638f69e5f1 100644 --- a/vendor/github.com/thanos-io/thanos/pkg/store/labelpb/label.go +++ b/vendor/github.com/thanos-io/thanos/pkg/store/labelpb/label.go @@ -1,7 +1,8 @@ // Copyright (c) The Thanos Authors. // Licensed under the Apache License 2.0. -// Package containing Zero Copy Labels adapter. +// 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 @@ -18,23 +19,39 @@ import ( ) func noAllocString(buf []byte) string { - return *((*string)(unsafe.Pointer(&buf))) + return *(*string)(unsafe.Pointer(&buf)) } -// LabelsFromPromLabels converts Prometheus labels to slice of storepb.Label in type unsafe manner. +func noAllocBytes(buf string) []byte { + return *(*[]byte)(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. +func ZLabelsToPromLabels(lset []ZLabel) labels.Labels { + return *(*labels.Labels)(unsafe.Pointer(&lset)) +} + +// LabelsFromPromLabels 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 LabelsFromPromLabels(lset labels.Labels) []Label { return *(*[]Label)(unsafe.Pointer(&lset)) } -// LabelsToPromLabels convert slice of storepb.Label to Prometheus labels in type unsafe manner. +// LabelsToPromLabels convert slice of labelpb.ZLabel to Prometheus labels in type unsafe manner. // It reuses the same memory. Caller should abort using passed []Label. func LabelsToPromLabels(lset []Label) labels.Labels { return *(*labels.Labels)(unsafe.Pointer(&lset)) } -// LabelSetsToPromLabelSets converts slice of storepb.LabelSet to slice of Prometheus labels. -func LabelSetsToPromLabelSets(lss ...LabelSet) []labels.Labels { +// ZLabelSetsToPromLabelSets converts slice of labelpb.ZLabelSet to slice of Prometheus labels. +func ZLabelSetsToPromLabelSets(lss ...ZLabelSet) []labels.Labels { res := make([]labels.Labels, 0, len(lss)) for _, ls := range lss { res = append(res, ls.PromLabels()) @@ -42,49 +59,29 @@ func LabelSetsToPromLabelSets(lss ...LabelSet) []labels.Labels { return res } -// Label is a labels.Label that can be marshaled to/from protobuf reusing the same -// memory address for string bytes. -type Label labels.Label +// 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 unmarshal use exactly same bytes that were allocated for protobuf, this will 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 *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 *ZLabel) MarshalTo(data []byte) (int, error) { + f := Label(*m) + return f.MarshalTo(data) } -func (m *Label) MarshalTo(data []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(data[:size]) +func (m *ZLabel) MarshalToSizedBuffer(data []byte) (int, error) { + f := Label(*m) + return f.MarshalToSizedBuffer(data) } -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 *Label) Unmarshal(data []byte) error { +// Unmarshal unmarshalls gRPC protobuf into ZLabel struct. ZLabel string is directly using bytes passed in `data`. +// To use it add (gogoproto.customtype) = "github.com/thanos-io/thanos/pkg/store/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 @@ -106,10 +103,10 @@ func (m *Label) Unmarshal(data []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Label: wiretype end group for non-group") + return fmt.Errorf("proto: ZLabel: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Label: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ZLabel: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -201,46 +198,37 @@ func (m *Label) Unmarshal(data []byte) error { return nil } -func (m *Label) UnmarshalJSON(entry []byte) error { - l := FullCopyLabel{} - - if err := json.Unmarshal(entry, &l); err != 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.Name = l.Name - m.Value = l.Value + *m = ZLabel(f) return nil } -func (m *Label) MarshalJSON() ([]byte, error) { - return json.Marshal(&FullCopyLabel{Name: m.Name, Value: m.Value}) +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 *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 *ZLabel) Size() (n int) { + f := Label(*m) + return f.Size() } // Equal implements proto.Equaler. -func (m *Label) Equal(other Label) bool { +func (m *ZLabel) Equal(other ZLabel) bool { return m.Name == other.Name && m.Value == other.Value } // Compare implements proto.Comparer. -func (m *Label) Compare(other Label) int { +func (m *ZLabel) Compare(other ZLabel) int { if c := strings.Compare(m.Name, other.Name); c != 0 { return c } @@ -279,21 +267,31 @@ func PromLabelSetsToString(lsets []labels.Labels) string { return strings.Join(s, ",") } -func (m *LabelSet) UnmarshalJSON(entry []byte) error { +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 = LabelsFromPromLabels(lbls) + m.Labels = ZLabelsFromPromLabels(lbls) return nil } -func (m *LabelSet) MarshalJSON() ([]byte, error) { +func (m *ZLabelSet) MarshalJSON() ([]byte, error) { return m.PromLabels().MarshalJSON() } // PromLabels return Prometheus labels.Labels without extra allocation. -func (m *LabelSet) PromLabels() labels.Labels { - return LabelsToPromLabels(m.Labels) +func (m *ZLabelSet) PromLabels() labels.Labels { + return ZLabelsToPromLabels(m.Labels) +} + +// DeepCopy copies labels and each label's string to separate bytes. +func DeepCopy(lbls []ZLabel) []ZLabel { + ret := make([]ZLabel, len(lbls)) + for i := range lbls { + ret[i].Name = string(noAllocBytes(lbls[i].Name)) + ret[i].Value = string(noAllocBytes(lbls[i].Value)) + } + return ret } diff --git a/vendor/github.com/thanos-io/thanos/pkg/store/labelpb/types.pb.go b/vendor/github.com/thanos-io/thanos/pkg/store/labelpb/types.pb.go index 1dad0b24257..e43a110d8c7 100644 --- a/vendor/github.com/thanos-io/thanos/pkg/store/labelpb/types.pb.go +++ b/vendor/github.com/thanos-io/thanos/pkg/store/labelpb/types.pb.go @@ -24,22 +24,23 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -type LabelSet struct { - Labels []Label `protobuf:"bytes,1,rep,name=labels,proto3,customtype=Label" json:"labels"` +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 *LabelSet) Reset() { *m = LabelSet{} } -func (m *LabelSet) String() string { return proto.CompactTextString(m) } -func (*LabelSet) ProtoMessage() {} -func (*LabelSet) Descriptor() ([]byte, []int) { +func (m *Label) Reset() { *m = Label{} } +func (m *Label) String() string { return proto.CompactTextString(m) } +func (*Label) ProtoMessage() {} +func (*Label) Descriptor() ([]byte, []int) { return fileDescriptor_cdcc9e7dae4870e8, []int{0} } -func (m *LabelSet) XXX_Unmarshal(b []byte) error { +func (m *Label) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *LabelSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *Label) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_LabelSet.Marshal(b, m, deterministic) + return xxx_messageInfo_Label.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -49,35 +50,34 @@ func (m *LabelSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (m *LabelSet) XXX_Merge(src proto.Message) { - xxx_messageInfo_LabelSet.Merge(m, src) +func (m *Label) XXX_Merge(src proto.Message) { + xxx_messageInfo_Label.Merge(m, src) } -func (m *LabelSet) XXX_Size() int { +func (m *Label) XXX_Size() int { return m.Size() } -func (m *LabelSet) XXX_DiscardUnknown() { - xxx_messageInfo_LabelSet.DiscardUnknown(m) +func (m *Label) XXX_DiscardUnknown() { + xxx_messageInfo_Label.DiscardUnknown(m) } -var xxx_messageInfo_LabelSet proto.InternalMessageInfo +var xxx_messageInfo_Label proto.InternalMessageInfo -type FullCopyLabel 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"` +type LabelSet struct { + Labels []Label `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels"` } -func (m *FullCopyLabel) Reset() { *m = FullCopyLabel{} } -func (m *FullCopyLabel) String() string { return proto.CompactTextString(m) } -func (*FullCopyLabel) ProtoMessage() {} -func (*FullCopyLabel) Descriptor() ([]byte, []int) { +func (m *LabelSet) Reset() { *m = LabelSet{} } +func (m *LabelSet) String() string { return proto.CompactTextString(m) } +func (*LabelSet) ProtoMessage() {} +func (*LabelSet) Descriptor() ([]byte, []int) { return fileDescriptor_cdcc9e7dae4870e8, []int{1} } -func (m *FullCopyLabel) XXX_Unmarshal(b []byte) error { +func (m *LabelSet) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *FullCopyLabel) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *LabelSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_FullCopyLabel.Marshal(b, m, deterministic) + return xxx_messageInfo_LabelSet.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -87,34 +87,34 @@ func (m *FullCopyLabel) XXX_Marshal(b []byte, deterministic bool) ([]byte, error return b[:n], nil } } -func (m *FullCopyLabel) XXX_Merge(src proto.Message) { - xxx_messageInfo_FullCopyLabel.Merge(m, src) +func (m *LabelSet) XXX_Merge(src proto.Message) { + xxx_messageInfo_LabelSet.Merge(m, src) } -func (m *FullCopyLabel) XXX_Size() int { +func (m *LabelSet) XXX_Size() int { return m.Size() } -func (m *FullCopyLabel) XXX_DiscardUnknown() { - xxx_messageInfo_FullCopyLabel.DiscardUnknown(m) +func (m *LabelSet) XXX_DiscardUnknown() { + xxx_messageInfo_LabelSet.DiscardUnknown(m) } -var xxx_messageInfo_FullCopyLabel proto.InternalMessageInfo +var xxx_messageInfo_LabelSet proto.InternalMessageInfo -type FullCopyLabelSet struct { - Labels []FullCopyLabel `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels"` +type ZLabelSet struct { + Labels []ZLabel `protobuf:"bytes,1,rep,name=labels,proto3,customtype=ZLabel" json:"labels"` } -func (m *FullCopyLabelSet) Reset() { *m = FullCopyLabelSet{} } -func (m *FullCopyLabelSet) String() string { return proto.CompactTextString(m) } -func (*FullCopyLabelSet) ProtoMessage() {} -func (*FullCopyLabelSet) Descriptor() ([]byte, []int) { +func (m *ZLabelSet) Reset() { *m = ZLabelSet{} } +func (m *ZLabelSet) String() string { return proto.CompactTextString(m) } +func (*ZLabelSet) ProtoMessage() {} +func (*ZLabelSet) Descriptor() ([]byte, []int) { return fileDescriptor_cdcc9e7dae4870e8, []int{2} } -func (m *FullCopyLabelSet) XXX_Unmarshal(b []byte) error { +func (m *ZLabelSet) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *FullCopyLabelSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *ZLabelSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_FullCopyLabelSet.Marshal(b, m, deterministic) + return xxx_messageInfo_ZLabelSet.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -124,45 +124,45 @@ func (m *FullCopyLabelSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return b[:n], nil } } -func (m *FullCopyLabelSet) XXX_Merge(src proto.Message) { - xxx_messageInfo_FullCopyLabelSet.Merge(m, src) +func (m *ZLabelSet) XXX_Merge(src proto.Message) { + xxx_messageInfo_ZLabelSet.Merge(m, src) } -func (m *FullCopyLabelSet) XXX_Size() int { +func (m *ZLabelSet) XXX_Size() int { return m.Size() } -func (m *FullCopyLabelSet) XXX_DiscardUnknown() { - xxx_messageInfo_FullCopyLabelSet.DiscardUnknown(m) +func (m *ZLabelSet) XXX_DiscardUnknown() { + xxx_messageInfo_ZLabelSet.DiscardUnknown(m) } -var xxx_messageInfo_FullCopyLabelSet proto.InternalMessageInfo +var xxx_messageInfo_ZLabelSet proto.InternalMessageInfo func init() { + proto.RegisterType((*Label)(nil), "thanos.Label") proto.RegisterType((*LabelSet)(nil), "thanos.LabelSet") - proto.RegisterType((*FullCopyLabel)(nil), "thanos.FullCopyLabel") - proto.RegisterType((*FullCopyLabelSet)(nil), "thanos.FullCopyLabelSet") + proto.RegisterType((*ZLabelSet)(nil), "thanos.ZLabelSet") } func init() { proto.RegisterFile("store/labelpb/types.proto", fileDescriptor_cdcc9e7dae4870e8) } var fileDescriptor_cdcc9e7dae4870e8 = []byte{ - // 222 bytes of a gzipped FileDescriptorProto + // 212 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2c, 0x2e, 0xc9, 0x2f, 0x4a, 0xd5, 0xcf, 0x49, 0x4c, 0x4a, 0xcd, 0x29, 0x48, 0xd2, 0x2f, 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, 0x0f, 0x2e, 0x0e, 0x1f, 0x90, - 0xa6, 0xe0, 0xd4, 0x12, 0x21, 0x1b, 0x2e, 0x36, 0xb0, 0x01, 0xc5, 0x12, 0x8c, 0x0a, 0xcc, 0x1a, - 0xdc, 0x46, 0xa2, 0x7a, 0x10, 0xad, 0x7a, 0x6e, 0xa5, 0x39, 0x39, 0xce, 0xf9, 0x05, 0x95, 0x60, - 0x95, 0x4e, 0xbc, 0x27, 0xee, 0xc9, 0x33, 0xdc, 0xba, 0x27, 0xcf, 0x0a, 0xe6, 0x06, 0x41, 0xf5, - 0x28, 0x59, 0x72, 0xf1, 0xa2, 0xa8, 0x13, 0x12, 0xe2, 0x62, 0xc9, 0x4b, 0xcc, 0x4d, 0x95, 0x60, - 0x54, 0x60, 0xd4, 0xe0, 0x0c, 0x02, 0xb3, 0x85, 0x44, 0xb8, 0x58, 0xcb, 0x12, 0x73, 0x4a, 0x53, - 0x25, 0x98, 0xc0, 0x82, 0x10, 0x8e, 0x92, 0x3b, 0x97, 0x00, 0x8a, 0x56, 0x90, 0x63, 0x8c, 0x89, - 0x73, 0x0c, 0x0b, 0xc8, 0x31, 0x30, 0x37, 0x38, 0xa9, 0x9e, 0x78, 0x28, 0xc7, 0x70, 0xe2, 0x91, - 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1, - 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72, 0x0c, 0x51, 0xec, 0xd0, 0xe0, 0x49, 0x62, 0x03, 0xfb, 0xdd, - 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x92, 0x8d, 0xbe, 0xf8, 0x36, 0x01, 0x00, 0x00, -} - -func (m *LabelSet) Marshal() (dAtA []byte, err error) { + 0xcf, 0x4f, 0xcf, 0x07, 0x0b, 0xe9, 0x83, 0x58, 0x10, 0x59, 0x25, 0x43, 0x2e, 0x56, 0x1f, 0x90, + 0x26, 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, 0x81, 0xed, 0x2c, + 0x96, 0x60, 0x54, 0x60, 0xd6, 0xe0, 0x36, 0xe2, 0xd5, 0x83, 0xd8, 0xa6, 0x07, 0x56, 0xe1, 0xc4, + 0x72, 0xe2, 0x9e, 0x3c, 0x43, 0x10, 0x54, 0x89, 0x92, 0x13, 0x17, 0x67, 0x14, 0x5c, 0xa7, 0x29, + 0x7e, 0x9d, 0x7c, 0x20, 0x9d, 0xb7, 0xee, 0xc9, 0xb3, 0x41, 0x74, 0xc0, 0xcc, 0x70, 0x52, 0x3d, + 0xf1, 0x50, 0x8e, 0xe1, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, + 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0xa2, 0xd8, 0xa1, + 0x01, 0x90, 0xc4, 0x06, 0xf6, 0x9d, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0xd0, 0x80, 0xe8, 0x16, + 0x18, 0x01, 0x00, 0x00, +} + +func (m *Label) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -172,34 +172,34 @@ func (m *LabelSet) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *LabelSet) MarshalTo(dAtA []byte) (int, error) { +func (m *Label) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *LabelSet) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *Label) 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 - } + 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 *FullCopyLabel) Marshal() (dAtA []byte, err error) { +func (m *LabelSet) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -209,34 +209,34 @@ func (m *FullCopyLabel) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *FullCopyLabel) MarshalTo(dAtA []byte) (int, error) { +func (m *LabelSet) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *FullCopyLabel) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *LabelSet) 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 + 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 *FullCopyLabelSet) Marshal() (dAtA []byte, err error) { +func (m *ZLabelSet) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -246,12 +246,12 @@ func (m *FullCopyLabelSet) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *FullCopyLabelSet) MarshalTo(dAtA []byte) (int, error) { +func (m *ZLabelSet) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *FullCopyLabelSet) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ZLabelSet) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -259,11 +259,11 @@ func (m *FullCopyLabelSet) MarshalToSizedBuffer(dAtA []byte) (int, error) { 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 { + size := m.Labels[iNdEx].Size() + i -= size + if _, err := m.Labels[iNdEx].MarshalTo(dAtA[i:]); err != nil { return 0, err } - i -= size i = encodeVarintTypes(dAtA, i, uint64(size)) } i-- @@ -284,39 +284,39 @@ func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *LabelSet) Size() (n int) { +func (m *Label) 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)) - } + 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 *FullCopyLabel) Size() (n int) { +func (m *LabelSet) 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)) + if len(m.Labels) > 0 { + for _, e := range m.Labels { + l = e.Size() + n += 1 + l + sovTypes(uint64(l)) + } } return n } -func (m *FullCopyLabelSet) Size() (n int) { +func (m *ZLabelSet) Size() (n int) { if m == nil { return 0 } @@ -337,7 +337,7 @@ func sovTypes(x uint64) (n int) { func sozTypes(x uint64) (n int) { return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *LabelSet) Unmarshal(dAtA []byte) error { +func (m *Label) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -360,17 +360,17 @@ func (m *LabelSet) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: LabelSet: wiretype end group for non-group") + return fmt.Errorf("proto: Label: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: LabelSet: illegal tag %d (wire type %d)", fieldNum, wire) + 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 Labels", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -380,25 +380,55 @@ func (m *LabelSet) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen 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 + 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 @@ -424,7 +454,7 @@ func (m *LabelSet) Unmarshal(dAtA []byte) error { } return nil } -func (m *FullCopyLabel) Unmarshal(dAtA []byte) error { +func (m *LabelSet) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -447,17 +477,17 @@ func (m *FullCopyLabel) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: FullCopyLabel: wiretype end group for non-group") + return fmt.Errorf("proto: LabelSet: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: FullCopyLabel: illegal tag %d (wire type %d)", fieldNum, wire) + 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 Name", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypes @@ -467,55 +497,25 @@ func (m *FullCopyLabel) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthTypes } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen 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.Labels = append(m.Labels, Label{}) + if err := m.Labels[len(m.Labels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - m.Value = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -541,7 +541,7 @@ func (m *FullCopyLabel) Unmarshal(dAtA []byte) error { } return nil } -func (m *FullCopyLabelSet) Unmarshal(dAtA []byte) error { +func (m *ZLabelSet) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -564,10 +564,10 @@ func (m *FullCopyLabelSet) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: FullCopyLabelSet: wiretype end group for non-group") + return fmt.Errorf("proto: ZLabelSet: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: FullCopyLabelSet: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ZLabelSet: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -599,7 +599,7 @@ func (m *FullCopyLabelSet) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Labels = append(m.Labels, FullCopyLabel{}) + m.Labels = append(m.Labels, ZLabel{}) if err := m.Labels[len(m.Labels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/vendor/github.com/thanos-io/thanos/pkg/store/labelpb/types.proto b/vendor/github.com/thanos-io/thanos/pkg/store/labelpb/types.proto index f5f56d70606..65aa195ec12 100644 --- a/vendor/github.com/thanos-io/thanos/pkg/store/labelpb/types.proto +++ b/vendor/github.com/thanos-io/thanos/pkg/store/labelpb/types.proto @@ -19,15 +19,15 @@ option (gogoproto.goproto_unkeyed_all) = false; option (gogoproto.goproto_unrecognized_all) = false; option (gogoproto.goproto_sizecache_all) = false; -message LabelSet { - repeated FullCopyLabel labels = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "Label"]; -} - -message FullCopyLabel { +message Label { string name = 1; string value = 2; } -message FullCopyLabelSet { - repeated FullCopyLabel labels = 1 [(gogoproto.nullable) = false]; +message LabelSet { + repeated Label labels = 1 [(gogoproto.nullable) = false]; +} + +message ZLabelSet { + repeated Label labels = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "ZLabel"]; } diff --git a/vendor/github.com/thanos-io/thanos/pkg/store/local.go b/vendor/github.com/thanos-io/thanos/pkg/store/local.go index 98f4b587857..1eee0ea2cac 100644 --- a/vendor/github.com/thanos-io/thanos/pkg/store/local.go +++ b/vendor/github.com/thanos-io/thanos/pkg/store/local.go @@ -68,8 +68,8 @@ func NewLocalStoreFromJSONMmappableFile( extLabels: extLabels, c: f, info: &storepb.InfoResponse{ - LabelSets: []storepb.LabelSet{ - {Labels: labelpb.LabelsFromPromLabels(extLabels)}, + LabelSets: []labelpb.ZLabelSet{ + {Labels: labelpb.ZLabelsFromPromLabels(extLabels)}, }, StoreType: component.ToProto(), MinTime: math.MaxInt64, @@ -169,7 +169,7 @@ func (s *LocalStore) Series(r *storepb.SeriesRequest, srv storepb.Store_SeriesSe var chosen []int for si, series := range s.series { - lbls := labelpb.LabelsToPromLabels(series.Labels) + lbls := labelpb.ZLabelsToPromLabels(series.Labels) var noMatch bool for _, m := range matchers { extValue := lbls.Get(m.Name) @@ -237,7 +237,7 @@ func (s *LocalStore) LabelValues(_ context.Context, r *storepb.LabelValuesReques ) { vals := map[string]struct{}{} for _, series := range s.series { - lbls := labelpb.LabelsToPromLabels(series.Labels) + lbls := labelpb.ZLabelsToPromLabels(series.Labels) val := lbls.Get(r.Label) if val == "" { continue diff --git a/vendor/github.com/thanos-io/thanos/pkg/store/multitsdb.go b/vendor/github.com/thanos-io/thanos/pkg/store/multitsdb.go index 9fa504d0ed6..0301304ea78 100644 --- a/vendor/github.com/thanos-io/thanos/pkg/store/multitsdb.go +++ b/vendor/github.com/thanos-io/thanos/pkg/store/multitsdb.go @@ -82,7 +82,7 @@ func (s *MultiTSDBStore) Info(ctx context.Context, req *storepb.InfoRequest) (*s // We can rely on every underlying TSDB to only have one labelset, so this // will always allocate the correct length immediately. - resp.LabelSets = make([]storepb.LabelSet, 0, len(infos)) + resp.LabelSets = make([]labelpb.ZLabelSet, 0, len(infos)) for _, info := range infos { resp.LabelSets = append(resp.LabelSets, info.LabelSets...) } @@ -245,7 +245,7 @@ func (s *MultiTSDBStore) Series(r *storepb.SeriesRequest, srv storepb.Store_Seri for mergedSet.Next() { lset, chks := mergedSet.At() respSender.send(storepb.NewSeriesResponse(&storepb.Series{ - Labels: labelpb.LabelsFromPromLabels(lset), + Labels: labelpb.ZLabelsFromPromLabels(lset), Chunks: chks, })) } diff --git a/vendor/github.com/thanos-io/thanos/pkg/store/prometheus.go b/vendor/github.com/thanos-io/thanos/pkg/store/prometheus.go index 78e10733a3d..0e4210084a0 100644 --- a/vendor/github.com/thanos-io/thanos/pkg/store/prometheus.go +++ b/vendor/github.com/thanos-io/thanos/pkg/store/prometheus.go @@ -104,18 +104,18 @@ func (p *PrometheusStore) Info(_ context.Context, _ *storepb.InfoRequest) (*stor mint, maxt := p.timestamps() res := &storepb.InfoResponse{ - Labels: make([]storepb.Label, 0, len(lset)), + Labels: make([]labelpb.ZLabel, 0, len(lset)), StoreType: p.component.ToProto(), MinTime: mint, MaxTime: maxt, } - res.Labels = append(res.Labels, labelpb.LabelsFromPromLabels(lset)...) + res.Labels = append(res.Labels, labelpb.ZLabelsFromPromLabels(lset)...) // Until we deprecate the single labels in the reply, we just duplicate // them here for migration/compatibility purposes. - res.LabelSets = []storepb.LabelSet{} + res.LabelSets = []labelpb.ZLabelSet{} if len(res.Labels) > 0 { - res.LabelSets = append(res.LabelSets, storepb.LabelSet{ + res.LabelSets = append(res.LabelSets, labelpb.ZLabelSet{ Labels: res.Labels, }) } @@ -160,11 +160,11 @@ func (p *PrometheusStore) Series(r *storepb.SeriesRequest, s storepb.Store_Serie return err } for _, lbm := range labelMaps { - lset := make([]storepb.Label, 0, len(lbm)+len(externalLabels)) + lset := make([]labelpb.ZLabel, 0, len(lbm)+len(externalLabels)) for k, v := range lbm { - lset = append(lset, storepb.Label{Name: k, Value: v}) + lset = append(lset, labelpb.ZLabel{Name: k, Value: v}) } - lset = append(lset, labelpb.LabelsFromPromLabels(externalLabels)...) + lset = append(lset, labelpb.ZLabelsFromPromLabels(externalLabels)...) sort.Slice(lset, func(i, j int) bool { return lset[i].Name < lset[j].Name }) @@ -232,7 +232,7 @@ func (p *PrometheusStore) handleSampledPrometheusResponse(s storepb.Store_Series span.SetTag("series_count", len(resp.Results[0].Timeseries)) for _, e := range resp.Results[0].Timeseries { - lset := labelpb.ExtendLabels(labelpb.LabelsToPromLabels(e.Labels), externalLabels) + lset := labelpb.ExtendLabels(labelpb.ZLabelsToPromLabels(e.Labels), externalLabels) if len(e.Samples) == 0 { // As found in https://github.com/thanos-io/thanos/issues/381 // Prometheus can give us completely empty time series. Ignore these with log until we figure out that @@ -252,7 +252,7 @@ func (p *PrometheusStore) handleSampledPrometheusResponse(s storepb.Store_Series } if err := s.Send(storepb.NewSeriesResponse(&storepb.Series{ - Labels: labelpb.LabelsFromPromLabels(lset), + Labels: labelpb.ZLabelsFromPromLabels(lset), Chunks: aggregatedChunks, })); err != nil { return err @@ -315,8 +315,8 @@ func (p *PrometheusStore) handleStreamedPrometheusResponse(s storepb.Store_Serie } if err := s.Send(storepb.NewSeriesResponse(&storepb.Series{ - Labels: labelpb.LabelsFromPromLabels( - labelpb.ExtendLabels(labelpb.LabelsToPromLabels(series.Labels), externalLabels), + Labels: labelpb.ZLabelsFromPromLabels( + labelpb.ExtendLabels(labelpb.ZLabelsToPromLabels(series.Labels), externalLabels), ), Chunks: thanosChks, })); err != nil { diff --git a/vendor/github.com/thanos-io/thanos/pkg/store/proxy.go b/vendor/github.com/thanos-io/thanos/pkg/store/proxy.go index 9c9bfe2b743..4bb9f2f1a53 100644 --- a/vendor/github.com/thanos-io/thanos/pkg/store/proxy.go +++ b/vendor/github.com/thanos-io/thanos/pkg/store/proxy.go @@ -114,7 +114,7 @@ func NewProxyStore( func (s *ProxyStore) Info(_ context.Context, _ *storepb.InfoRequest) (*storepb.InfoResponse, error) { res := &storepb.InfoResponse{ StoreType: s.component.ToProto(), - Labels: labelpb.LabelsFromPromLabels(s.selectorLabels), + Labels: labelpb.ZLabelsFromPromLabels(s.selectorLabels), } minTime := int64(math.MaxInt64) @@ -142,15 +142,15 @@ func (s *ProxyStore) Info(_ context.Context, _ *storepb.InfoRequest) (*storepb.I res.MaxTime = maxTime res.MinTime = minTime - labelSets := make(map[uint64]storepb.LabelSet, len(stores)) + labelSets := make(map[uint64]labelpb.ZLabelSet, len(stores)) for _, st := range stores { for _, lset := range st.LabelSets() { mergedLabelSet := labelpb.ExtendLabels(lset, s.selectorLabels) - labelSets[mergedLabelSet.Hash()] = storepb.LabelSet{Labels: labelpb.LabelsFromPromLabels(mergedLabelSet)} + labelSets[mergedLabelSet.Hash()] = labelpb.ZLabelSet{Labels: labelpb.ZLabelsFromPromLabels(mergedLabelSet)} } } - res.LabelSets = make([]storepb.LabelSet, 0, len(labelSets)) + res.LabelSets = make([]labelpb.ZLabelSet, 0, len(labelSets)) for _, v := range labelSets { res.LabelSets = append(res.LabelSets, v) } @@ -160,7 +160,7 @@ func (s *ProxyStore) Info(_ context.Context, _ *storepb.InfoRequest) (*storepb.I // store-proxy's discovered stores, then we still want to enforce // announcing this subset by announcing the selector as the label-set. if len(res.LabelSets) == 0 && len(res.Labels) > 0 { - res.LabelSets = append(res.LabelSets, storepb.LabelSet{Labels: res.Labels}) + res.LabelSets = append(res.LabelSets, labelpb.ZLabelSet{Labels: res.Labels}) } return res, nil @@ -296,7 +296,7 @@ func (s *ProxyStore) Series(r *storepb.SeriesRequest, srv storepb.Store_SeriesSe mergedSet := storepb.MergeSeriesSets(seriesSet...) for mergedSet.Next() { lset, chk := mergedSet.At() - respSender.send(storepb.NewSeriesResponse(&storepb.Series{Labels: labelpb.LabelsFromPromLabels(lset), Chunks: chk})) + respSender.send(storepb.NewSeriesResponse(&storepb.Series{Labels: labelpb.ZLabelsFromPromLabels(lset), Chunks: chk})) } return mergedSet.Err() }) diff --git a/vendor/github.com/thanos-io/thanos/pkg/store/storepb/custom.go b/vendor/github.com/thanos-io/thanos/pkg/store/storepb/custom.go index 8b1f13366c1..41f90952722 100644 --- a/vendor/github.com/thanos-io/thanos/pkg/store/storepb/custom.go +++ b/vendor/github.com/thanos-io/thanos/pkg/store/storepb/custom.go @@ -231,13 +231,13 @@ func (s *uniqueSeriesSet) Next() bool { } lset, chks := s.SeriesSet.At() if s.peek == nil { - s.peek = &Series{Labels: labelpb.LabelsFromPromLabels(lset), Chunks: chks} + s.peek = &Series{Labels: labelpb.ZLabelsFromPromLabels(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.LabelsFromPromLabels(lset), Chunks: chks} + s.peek = &Series{Labels: labelpb.ZLabelsFromPromLabels(lset), Chunks: chks} return true } @@ -435,25 +435,25 @@ func (x LabelMatcher_Type) PromString() string { // PromLabels return Prometheus labels.Labels without extra allocation. func (m *Series) PromLabels() labels.Labels { - return labelpb.LabelsToPromLabels(m.Labels) + return labelpb.ZLabelsToPromLabels(m.Labels) } // Deprecated. // TODO(bwplotka): Remove this once Cortex dep will stop using it. -type Label = labelpb.Label +type Label = labelpb.ZLabel // Deprecated. // TODO(bwplotka): Remove this in next PR. Done to reduce diff only. -type LabelSet = labelpb.LabelSet +type LabelSet = labelpb.ZLabelSet // Deprecated. // TODO(bwplotka): Remove this once Cortex dep will stop using it. func CompareLabels(a, b []Label) int { - return labels.Compare(labelpb.LabelsToPromLabels(a), labelpb.LabelsToPromLabels(b)) + return labels.Compare(labelpb.ZLabelsToPromLabels(a), labelpb.ZLabelsToPromLabels(b)) } // Deprecated. // TODO(bwplotka): Remove this once Cortex dep will stop using it. func LabelsToPromLabelsUnsafe(lset []Label) labels.Labels { - return labelpb.LabelsToPromLabels(lset) + return labelpb.ZLabelsToPromLabels(lset) } diff --git a/vendor/github.com/thanos-io/thanos/pkg/store/storepb/prompb/types.pb.go b/vendor/github.com/thanos-io/thanos/pkg/store/storepb/prompb/types.pb.go index 6916e78ec2f..f9b8bbc1314 100644 --- a/vendor/github.com/thanos-io/thanos/pkg/store/storepb/prompb/types.pb.go +++ b/vendor/github.com/thanos-io/thanos/pkg/store/storepb/prompb/types.pb.go @@ -138,8 +138,9 @@ func (m *Sample) GetTimestamp() int64 { // TimeSeries represents samples and labels for a single time series. type TimeSeries struct { - Labels []github_com_thanos_io_thanos_pkg_store_labelpb.Label `protobuf:"bytes,1,rep,name=labels,proto3,customtype=github.com/thanos-io/thanos/pkg/store/labelpb.Label" json:"labels"` - Samples []Sample `protobuf:"bytes,2,rep,name=samples,proto3" json:"samples"` + // TODO(bwplotka): Don't use zero copy ZLabels, see https://github.com/thanos-io/thanos/pull/3279 for details. + Labels []github_com_thanos_io_thanos_pkg_store_labelpb.ZLabel `protobuf:"bytes,1,rep,name=labels,proto3,customtype=github.com/thanos-io/thanos/pkg/store/labelpb.ZLabel" json:"labels"` + Samples []Sample `protobuf:"bytes,2,rep,name=samples,proto3" json:"samples"` } func (m *TimeSeries) Reset() { *m = TimeSeries{} } @@ -408,7 +409,7 @@ func (m *Chunk) GetData() []byte { // ChunkedSeries represents single, encoded time series. type ChunkedSeries struct { // Labels should be sorted. - Labels []github_com_thanos_io_thanos_pkg_store_labelpb.Label `protobuf:"bytes,1,rep,name=labels,proto3,customtype=github.com/thanos-io/thanos/pkg/store/labelpb.Label" json:"labels"` + Labels []github_com_thanos_io_thanos_pkg_store_labelpb.ZLabel `protobuf:"bytes,1,rep,name=labels,proto3,customtype=github.com/thanos-io/thanos/pkg/store/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"` } @@ -467,45 +468,45 @@ func init() { func init() { proto.RegisterFile("store/storepb/prompb/types.proto", fileDescriptor_166e07899dab7c14) } var fileDescriptor_166e07899dab7c14 = []byte{ - // 604 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x54, 0xcd, 0x6e, 0xd3, 0x4c, - 0x14, 0xcd, 0xc4, 0x89, 0x93, 0x4c, 0xfb, 0xf5, 0x8b, 0x46, 0x2d, 0x4d, 0x2b, 0xe4, 0x5a, 0x5e, - 0x65, 0x83, 0x2d, 0xb5, 0x08, 0x16, 0xb0, 0x6a, 0x15, 0x84, 0x04, 0x49, 0xd5, 0x69, 0x11, 0x88, - 0x4d, 0x35, 0x4e, 0x06, 0xc7, 0x34, 0x9e, 0x19, 0x79, 0xc6, 0xa8, 0x79, 0x0b, 0xd6, 0xbc, 0x05, - 0x3c, 0x45, 0x97, 0x5d, 0x22, 0x16, 0x15, 0x6a, 0x5f, 0x04, 0xcd, 0xb5, 0xd3, 0x50, 0xca, 0x9e, - 0x4d, 0x74, 0x7f, 0xce, 0x9c, 0x73, 0xff, 0x62, 0xec, 0x6b, 0x23, 0x73, 0x1e, 0xc1, 0xaf, 0x8a, - 0x23, 0x95, 0xcb, 0x4c, 0xc5, 0x91, 0x99, 0x2b, 0xae, 0x43, 0x95, 0x4b, 0x23, 0xc9, 0xff, 0x36, - 0xc6, 0xcd, 0x94, 0x17, 0xfa, 0x74, 0x2c, 0xd5, 0x7c, 0x7b, 0x3d, 0x91, 0x89, 0x84, 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, 0xec, 0xdc, 0xdb, 0x04, 0xa8, 0x84, - 0x03, 0x31, 0x96, 0x93, 0x54, 0x24, 0xcb, 0x35, 0x4c, 0x98, 0x61, 0xd0, 0xda, 0x2a, 0x05, 0x3b, - 0xf0, 0x71, 0x7b, 0x81, 0x22, 0x2b, 0xb8, 0xf5, 0x66, 0xf4, 0x6a, 0x74, 0xf8, 0x76, 0x54, 0x4e, - 0xfe, 0xdd, 0x21, 0xed, 0x22, 0x3b, 0xe8, 0xff, 0x80, 0x8e, 0x4f, 0xfe, 0xc1, 0xf1, 0x3e, 0xc6, - 0xee, 0xd8, 0x8a, 0x2f, 0x6e, 0xf7, 0xc1, 0xdf, 0x5b, 0xad, 0x4e, 0xb7, 0xc2, 0xee, 0xfb, 0x17, - 0xd7, 0x1e, 0xba, 0xbc, 0xf6, 0xd0, 0xcf, 0x6b, 0x0f, 0x7d, 0xbe, 0xf1, 0x6a, 0x97, 0x37, 0x5e, - 0xed, 0xfb, 0x8d, 0x57, 0x7b, 0xef, 0x96, 0xdf, 0x86, 0xd8, 0x85, 0x3f, 0xf5, 0xde, 0xaf, 0x00, - 0x00, 0x00, 0xff, 0xff, 0xd4, 0x4e, 0x4f, 0x77, 0x3a, 0x04, 0x00, 0x00, + // 599 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x54, 0xcb, 0x6e, 0xd3, 0x4c, + 0x14, 0xce, 0xc4, 0x89, 0x93, 0x9c, 0x5e, 0xfe, 0x68, 0xd4, 0x9f, 0xa6, 0x15, 0x72, 0x2d, 0xaf, + 0xb2, 0xc1, 0x96, 0xda, 0x0a, 0x36, 0x5d, 0x15, 0x45, 0x42, 0x82, 0xa4, 0xea, 0xb4, 0x08, 0xd4, + 0x4d, 0x35, 0x76, 0x06, 0xc7, 0x6a, 0x3c, 0xb6, 0x3c, 0x13, 0xd4, 0xbc, 0x05, 0x6b, 0x1e, 0x81, +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 0xde, 0xb3, 0x5d, 0xd2, 0x6f, 0xb3, 0x7a, + 0x38, 0x37, 0xec, 0x05, 0x97, 0xb1, 0x30, 0x24, 0xad, 0x92, 0x1d, 0xfd, 0xa1, 0xf2, 0xbe, 0x11, + 0x68, 0xbe, 0x9c, 0xcc, 0xe4, 0x05, 0x75, 0x60, 0x25, 0x4d, 0xe4, 0xb9, 0x11, 0xc6, 0xb2, 0xe7, + 0x4e, 0x9a, 0x48, 0x23, 0x8e, 0xa1, 0xc2, 0x3c, 0xbf, 0xbc, 0xcf, 0x57, 0x3a, 0x4a, 0xf9, 0x65, + 0x95, 0xdf, 0xab, 0x2e, 0x61, 0xe1, 0x25, 0x76, 0x1e, 0x5d, 0x02, 0xab, 0xf8, 0x03, 0x19, 0x65, + 0xe3, 0x44, 0xc6, 0xcb, 0x33, 0x8c, 0xb9, 0xe6, 0x38, 0xda, 0x2a, 0x43, 0xdb, 0x73, 0xa1, 0xbd, + 0x40, 0xd1, 0x15, 0x68, 0xbd, 0x1d, 0xbd, 0x1e, 0x1d, 0xbd, 0x1b, 0x95, 0x9b, 0x7f, 0x7f, 0xc4, + 0xba, 0xc4, 0x48, 0x76, 0x0d, 0xe9, 0xc4, 0xf8, 0x5f, 0xaa, 0x76, 0x1f, 0xec, 0xc8, 0x54, 0x5d, + 0x88, 0xf6, 0xc9, 0xdf, 0x67, 0xac, 0x34, 0x5b, 0x61, 0x0f, 0xdd, 0xab, 0x5b, 0x87, 0x5c, 0xdf, + 0x3a, 0xe4, 0xe7, 0xad, 0x43, 0x3e, 0xdd, 0x39, 0xb5, 0xeb, 0x3b, 0xa7, 0xf6, 0xfd, 0xce, 0xa9, + 0x9d, 0xd9, 0xe5, 0xd7, 0x20, 0xb4, 0xf1, 0x6f, 0xbc, 0xf7, 0x2b, 0x00, 0x00, 0xff, 0xff, 0x4e, + 0x61, 0x3c, 0xe9, 0x2c, 0x04, 0x00, 0x00, } func (m *Sample) Marshal() (dAtA []byte, err error) { @@ -1091,7 +1092,7 @@ func (m *TimeSeries) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Labels = append(m.Labels, github_com_thanos_io_thanos_pkg_store_labelpb.Label{}) + m.Labels = append(m.Labels, github_com_thanos_io_thanos_pkg_store_labelpb.ZLabel{}) if err := m.Labels[len(m.Labels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -1705,7 +1706,7 @@ func (m *ChunkedSeries) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Labels = append(m.Labels, github_com_thanos_io_thanos_pkg_store_labelpb.Label{}) + m.Labels = append(m.Labels, github_com_thanos_io_thanos_pkg_store_labelpb.ZLabel{}) if err := m.Labels[len(m.Labels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/vendor/github.com/thanos-io/thanos/pkg/store/storepb/prompb/types.proto b/vendor/github.com/thanos-io/thanos/pkg/store/storepb/prompb/types.proto index dbdb32f2bf9..2b7ac257754 100644 --- a/vendor/github.com/thanos-io/thanos/pkg/store/storepb/prompb/types.proto +++ b/vendor/github.com/thanos-io/thanos/pkg/store/storepb/prompb/types.proto @@ -35,8 +35,9 @@ message Sample { // TimeSeries represents samples and labels for a single time series. message TimeSeries { - repeated thanos.FullCopyLabel labels = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/thanos-io/thanos/pkg/store/labelpb.Label"]; - repeated Sample samples = 2 [(gogoproto.nullable) = false]; + // 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/thanos-io/thanos/pkg/store/labelpb.ZLabel"]; + repeated Sample samples = 2 [(gogoproto.nullable) = false]; } // Matcher specifies a rule, which can match or set of labels or not. @@ -80,7 +81,7 @@ message Chunk { // ChunkedSeries represents single, encoded time series. message ChunkedSeries { // Labels should be sorted. - repeated thanos.FullCopyLabel labels = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/thanos-io/thanos/pkg/store/labelpb.Label"]; + repeated thanos.Label labels = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/thanos-io/thanos/pkg/store/labelpb.ZLabel"]; // Chunks will be in start time order and may overlap. repeated Chunk chunks = 2 [(gogoproto.nullable) = false]; } diff --git a/vendor/github.com/thanos-io/thanos/pkg/store/storepb/rpc.pb.go b/vendor/github.com/thanos-io/thanos/pkg/store/storepb/rpc.pb.go index 288e37c69a4..a93999b1f47 100644 --- a/vendor/github.com/thanos-io/thanos/pkg/store/storepb/rpc.pb.go +++ b/vendor/github.com/thanos-io/thanos/pkg/store/storepb/rpc.pb.go @@ -223,12 +223,12 @@ var xxx_messageInfo_InfoRequest proto.InternalMessageInfo type InfoResponse struct { // Deprecated. Use label_sets instead. - Labels []github_com_thanos_io_thanos_pkg_store_labelpb.Label `protobuf:"bytes,1,rep,name=labels,proto3,customtype=github.com/thanos-io/thanos/pkg/store/labelpb.Label" json:"labels"` - MinTime int64 `protobuf:"varint,2,opt,name=min_time,json=minTime,proto3" json:"min_time,omitempty"` - MaxTime int64 `protobuf:"varint,3,opt,name=max_time,json=maxTime,proto3" json:"max_time,omitempty"` - StoreType StoreType `protobuf:"varint,4,opt,name=storeType,proto3,enum=thanos.StoreType" json:"storeType,omitempty"` - // label_sets is an unsorted list of `LabelSet`s. - LabelSets []labelpb.LabelSet `protobuf:"bytes,5,rep,name=label_sets,json=labelSets,proto3" json:"label_sets"` + Labels []github_com_thanos_io_thanos_pkg_store_labelpb.ZLabel `protobuf:"bytes,1,rep,name=labels,proto3,customtype=github.com/thanos-io/thanos/pkg/store/labelpb.ZLabel" json:"labels"` + MinTime int64 `protobuf:"varint,2,opt,name=min_time,json=minTime,proto3" json:"min_time,omitempty"` + MaxTime int64 `protobuf:"varint,3,opt,name=max_time,json=maxTime,proto3" json:"max_time,omitempty"` + StoreType StoreType `protobuf:"varint,4,opt,name=storeType,proto3,enum=thanos.StoreType" json:"storeType,omitempty"` + // label_sets is an unsorted list of `ZLabelSet`s. + LabelSets []labelpb.ZLabelSet `protobuf:"bytes,5,rep,name=label_sets,json=labelSets,proto3" json:"label_sets"` } func (m *InfoResponse) Reset() { *m = InfoResponse{} } @@ -590,72 +590,72 @@ func init() { func init() { proto.RegisterFile("store/storepb/rpc.proto", fileDescriptor_a938d55a388af629) } var fileDescriptor_a938d55a388af629 = []byte{ - // 1039 bytes of a gzipped FileDescriptorProto + // 1031 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0x4b, 0x6f, 0x23, 0x45, - 0x10, 0xf6, 0x78, 0xfc, 0x2c, 0x27, 0x61, 0xb6, 0xe3, 0x64, 0x27, 0x5e, 0xc9, 0xb1, 0x2c, 0x21, - 0x59, 0xd1, 0x62, 0x83, 0x57, 0x20, 0xf1, 0xb8, 0xd8, 0x8e, 0x43, 0x22, 0x36, 0x0e, 0xb4, 0xe3, - 0x0d, 0x0f, 0x21, 0x6b, 0xec, 0xf4, 0x8e, 0x87, 0x8c, 0x67, 0x86, 0xe9, 0x36, 0x89, 0xaf, 0x70, - 0x47, 0x1c, 0xf9, 0x43, 0x48, 0x39, 0xee, 0x81, 0x03, 0xe2, 0xb0, 0x82, 0xe4, 0xc8, 0x9f, 0x40, - 0xfd, 0x18, 0xc7, 0x13, 0xb2, 0xb9, 0x84, 0x8b, 0xd5, 0x55, 0x5f, 0x55, 0x75, 0xd5, 0x57, 0x55, - 0xed, 0x81, 0xc7, 0x94, 0xf9, 0x21, 0x69, 0x88, 0xdf, 0x60, 0xd4, 0x08, 0x83, 0x71, 0x3d, 0x08, - 0x7d, 0xe6, 0xa3, 0x0c, 0x9b, 0x58, 0x9e, 0x4f, 0x4b, 0x5b, 0x71, 0x03, 0x36, 0x0f, 0x08, 0x95, - 0x26, 0xa5, 0xa2, 0xed, 0xdb, 0xbe, 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x10, 0xa6, 0x64, 0x2d, 0xba, 0xca, 0xa6, 0xf5, 0xdf, + 0x74, 0x58, 0x91, 0x92, 0xc7, 0xad, 0x5a, 0x26, 0xac, 0xbd, 0x9b, 0x70, 0x3a, 0x49, 0xf8, 0x29, + 0x87, 0xd8, 0x64, 0x4a, 0x22, 0x6a, 0xea, 0x62, 0xf7, 0x72, 0x42, 0xcd, 0x03, 0x09, 0x2a, 0x02, + 0x8b, 0x58, 0xd4, 0x86, 0x75, 0x5e, 0x32, 0x22, 0x34, 0x70, 0x67, 0xcc, 0x09, 0xfc, 0xd1, 0x99, + 0xe3, 0x9f, 0x04, 0x67, 0xe2, 0xd0, 0x3a, 0x5e, 0xf3, 0xac, 0x73, 0xbc, 0xc0, 0x8e, 0x05, 0x84, + 0x9e, 0x00, 0x58, 0xb6, 0x1d, 0x11, 0xdb, 0x62, 0x44, 0x9e, 0x75, 0xb5, 0xfd, 0x20, 0xde, 0xad, + 0x63, 0xdb, 0x11, 0x5e, 0xc2, 0xd1, 0x67, 0xb0, 0x19, 0x5a, 0x11, 0x73, 0x2c, 0x97, 0xef, 0x22, + 0x3a, 0x3f, 0x3a, 0x71, 0xa8, 0x35, 0x76, 0xc9, 0x89, 0x99, 0xab, 0x69, 0x8d, 0x02, 0x7e, 0xa4, + 0x02, 0xe2, 0x9b, 0xb1, 0xab, 0x60, 0xf4, 0xed, 0x2d, 0xb9, 0x94, 0x45, 0x16, 0x23, 0xf6, 0xdc, + 0xcc, 0x8b, 0xb6, 0x6c, 0xc5, 0x1b, 0x7f, 0x99, 0xac, 0x31, 0x50, 0x61, 0xff, 0x29, 0x1e, 0x03, + 0x68, 0x0b, 0x4a, 0xf4, 0xd4, 0x09, 0x47, 0x93, 0xe9, 0xcc, 0x3f, 0xa5, 0x66, 0x41, 0x50, 0x01, + 0xee, 0xda, 0x11, 0x1e, 0xb4, 0x0d, 0xd9, 0xa9, 0xe3, 0x33, 0x6a, 0x16, 0x6b, 0x9a, 0x10, 0x54, + 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0xac, 0x95, 0xc7, 0xb7, + 0x62, 0xb2, 0x4e, 0xbb, 0x0f, 0xab, 0xe2, 0x0b, 0x80, 0xdf, 0x42, 0x29, 0xc6, 0x33, 0x28, 0x61, + 0xe2, 0x05, 0x8c, 0x08, 0x3f, 0x5a, 0x1c, 0x7f, 0xf9, 0x43, 0xa1, 0xb2, 0x7e, 0xc3, 0xab, 0x3e, + 0x28, 0x52, 0xdd, 0xf7, 0x2f, 0xfe, 0xae, 0xa6, 0x2e, 0x2e, 0xab, 0xda, 0x9b, 0xcb, 0xaa, 0xf6, + 0xd7, 0x65, 0x55, 0xfb, 0xe5, 0xaa, 0x9a, 0x7a, 0x73, 0x55, 0x4d, 0xfd, 0x71, 0x55, 0x4d, 0xbd, + 0xca, 0xab, 0x6f, 0x9a, 0x71, 0x4e, 0xbc, 0x4b, 0x1f, 0xff, 0x1b, 0x00, 0x00, 0xff, 0xff, 0xd2, + 0x17, 0x25, 0x76, 0x3d, 0x09, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -2084,7 +2084,7 @@ func (m *InfoResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Labels = append(m.Labels, github_com_thanos_io_thanos_pkg_store_labelpb.Label{}) + m.Labels = append(m.Labels, github_com_thanos_io_thanos_pkg_store_labelpb.ZLabel{}) if err := m.Labels[len(m.Labels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -2175,7 +2175,7 @@ func (m *InfoResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.LabelSets = append(m.LabelSets, labelpb.LabelSet{}) + m.LabelSets = append(m.LabelSets, labelpb.ZLabelSet{}) if err := m.LabelSets[len(m.LabelSets)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/vendor/github.com/thanos-io/thanos/pkg/store/storepb/rpc.proto b/vendor/github.com/thanos-io/thanos/pkg/store/storepb/rpc.proto index e81dae63972..2418d30c336 100644 --- a/vendor/github.com/thanos-io/thanos/pkg/store/storepb/rpc.proto +++ b/vendor/github.com/thanos-io/thanos/pkg/store/storepb/rpc.proto @@ -78,12 +78,12 @@ enum StoreType { message InfoResponse { // Deprecated. Use label_sets instead. - repeated FullCopyLabel labels = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/thanos-io/thanos/pkg/store/labelpb.Label"]; + repeated Label labels = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/thanos-io/thanos/pkg/store/labelpb.ZLabel"]; int64 min_time = 2; int64 max_time = 3; StoreType storeType = 4; - // label_sets is an unsorted list of `LabelSet`s. - repeated LabelSet label_sets = 5 [(gogoproto.nullable) = false]; + // label_sets is an unsorted list of `ZLabelSet`s. + repeated ZLabelSet label_sets = 5 [(gogoproto.nullable) = false]; } message SeriesRequest { diff --git a/vendor/github.com/thanos-io/thanos/pkg/store/storepb/testutil/series.go b/vendor/github.com/thanos-io/thanos/pkg/store/storepb/testutil/series.go index a63648a336a..213b6335bf9 100644 --- a/vendor/github.com/thanos-io/thanos/pkg/store/storepb/testutil/series.go +++ b/vendor/github.com/thanos-io/thanos/pkg/store/storepb/testutil/series.go @@ -104,7 +104,7 @@ func CreateHeadWithSeries(t testing.TB, j int, opts HeadGenOptions) (*tsdb.Head, all := allPostings(t, ir) for all.Next() { testutil.Ok(t, ir.Series(all.At(), &lset, &chunkMetas)) - expected = append(expected, &storepb.Series{Labels: labelpb.LabelsFromPromLabels(append(opts.PrependLabels.Copy(), lset...))}) + expected = append(expected, &storepb.Series{Labels: labelpb.ZLabelsFromPromLabels(append(opts.PrependLabels.Copy(), lset...))}) if opts.SkipChunks { continue diff --git a/vendor/github.com/thanos-io/thanos/pkg/store/storepb/types.pb.go b/vendor/github.com/thanos-io/thanos/pkg/store/storepb/types.pb.go index 5320ce2ac08..903612be2d6 100644 --- a/vendor/github.com/thanos-io/thanos/pkg/store/storepb/types.pb.go +++ b/vendor/github.com/thanos-io/thanos/pkg/store/storepb/types.pb.go @@ -152,8 +152,8 @@ func (m *Chunk) XXX_DiscardUnknown() { var xxx_messageInfo_Chunk proto.InternalMessageInfo type Series struct { - Labels []github_com_thanos_io_thanos_pkg_store_labelpb.Label `protobuf:"bytes,1,rep,name=labels,proto3,customtype=github.com/thanos-io/thanos/pkg/store/labelpb.Label" json:"labels"` - Chunks []AggrChunk `protobuf:"bytes,2,rep,name=chunks,proto3" json:"chunks"` + Labels []github_com_thanos_io_thanos_pkg_store_labelpb.ZLabel `protobuf:"bytes,1,rep,name=labels,proto3,customtype=github.com/thanos-io/thanos/pkg/store/labelpb.ZLabel" json:"labels"` + Chunks []AggrChunk `protobuf:"bytes,2,rep,name=chunks,proto3" json:"chunks"` } func (m *Series) Reset() { *m = Series{} } @@ -286,41 +286,40 @@ func init() { func init() { proto.RegisterFile("store/storepb/types.proto", fileDescriptor_121fba57de02d8e0) } var fileDescriptor_121fba57de02d8e0 = []byte{ - // 530 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x93, 0xd1, 0x6e, 0xd3, 0x3c, - 0x14, 0xc7, 0xe3, 0x24, 0x4d, 0x5b, 0x6f, 0xdf, 0xa7, 0x60, 0x06, 0x64, 0xbb, 0x48, 0xab, 0x20, - 0x44, 0x35, 0x69, 0x89, 0xd4, 0x5d, 0x72, 0xd5, 0x4e, 0xe5, 0x0a, 0x36, 0xe6, 0x55, 0x02, 0x21, - 0x24, 0xe4, 0x76, 0x56, 0x6a, 0x96, 0xd8, 0x51, 0xe2, 0x40, 0xfb, 0x16, 0x20, 0x9e, 0x81, 0x77, - 0xe9, 0xe5, 0x2e, 0x11, 0x17, 0x13, 0xb4, 0x2f, 0x82, 0xec, 0xa4, 0x40, 0xa5, 0xde, 0x44, 0x27, - 0xe7, 0xff, 0x3b, 0xe7, 0x6f, 0x1f, 0x1d, 0xc3, 0xc3, 0x42, 0x8a, 0x9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x91, 0x09, 0x5e, 0xd0, 0x2b, 0x99, 0x13, 0x49, 0xe3, - 0x05, 0x6a, 0x41, 0xfb, 0xf5, 0x00, 0x9f, 0xbb, 0x06, 0x6a, 0xc3, 0xc6, 0x60, 0x78, 0x81, 0xc7, - 0x2e, 0x18, 0x3e, 0x59, 0xfe, 0xf2, 0x8d, 0xe5, 0xca, 0x07, 0xb7, 0x2b, 0x1f, 0xfc, 0x5c, 0xf9, - 0xe0, 0xf3, 0xda, 0x37, 0x6e, 0xd7, 0xbe, 0xf1, 0x7d, 0xed, 0x1b, 0x6f, 0x9b, 0xf5, 0x5b, 0x9a, - 0x38, 0xfa, 0x35, 0x9c, 0xfe, 0x0e, 0x00, 0x00, 0xff, 0xff, 0x31, 0xba, 0x19, 0x3e, 0x63, 0x03, - 0x00, 0x00, + // 522 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x93, 0xc1, 0x6f, 0xd3, 0x3e, + 0x14, 0xc7, 0xe3, 0x24, 0x4d, 0x5b, 0xff, 0xf6, 0x43, 0xc1, 0x4c, 0x90, 0xee, 0x90, 0x56, 0x41, + 0x88, 0x6a, 0xd2, 0x12, 0x69, 0x70, 0xe4, 0xd2, 0xa2, 0xde, 0x60, 0x63, 0x5e, 0x25, 0xd0, 0x84, + 0x84, 0xdc, 0xcc, 0x4a, 0xad, 0x35, 0x76, 0x94, 0x38, 0xd0, 0xfe, 0x17, 0x20, 0xee, 0xfc, 0x3d, + 0x3d, 0xee, 0x88, 0x38, 0x4c, 0xd0, 0xfe, 0x23, 0xc8, 0x4e, 0x0a, 0x54, 0xca, 0x25, 0x7a, 0x79, + 0xdf, 0xcf, 0x7b, 0xdf, 0xf8, 0xe5, 0x19, 0xf6, 0x0a, 0x29, 0x72, 0x1a, 0xe9, 0x67, 0x36, 0x8b, + 0xe4, 0x2a, 0xa3, 0x45, 0x98, 0xe5, 0x42, 0x0a, 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d, 0xcf, 0xf1, 0xd4, 0x05, 0xe3, 0x27, 0xeb, 0x5f, 0xbe, 0xb1, 0xde, + 0xf8, 0xe0, 0x76, 0xe3, 0x83, 0x9f, 0x1b, 0x1f, 0x7c, 0xde, 0xfa, 0xc6, 0xed, 0xd6, 0x37, 0xbe, + 0x6f, 0x7d, 0xe3, 0xaa, 0x5d, 0x5f, 0xa2, 0x99, 0xa3, 0xaf, 0xc1, 0xb3, 0xdf, 0x01, 0x00, 0x00, + 0xff, 0xff, 0xd5, 0x63, 0x3a, 0x23, 0x5c, 0x03, 0x00, 0x00, } func (m *Chunk) Marshal() (dAtA []byte, err error) { @@ -833,7 +832,7 @@ func (m *Series) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Labels = append(m.Labels, github_com_thanos_io_thanos_pkg_store_labelpb.Label{}) + m.Labels = append(m.Labels, github_com_thanos_io_thanos_pkg_store_labelpb.ZLabel{}) if err := m.Labels[len(m.Labels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/vendor/github.com/thanos-io/thanos/pkg/store/storepb/types.proto b/vendor/github.com/thanos-io/thanos/pkg/store/storepb/types.proto index a88c8cf7c11..2cf255713b9 100644 --- a/vendor/github.com/thanos-io/thanos/pkg/store/storepb/types.proto +++ b/vendor/github.com/thanos-io/thanos/pkg/store/storepb/types.proto @@ -29,8 +29,8 @@ message Chunk { } message Series { - repeated FullCopyLabel labels = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/thanos-io/thanos/pkg/store/labelpb.Label"]; - repeated AggrChunk chunks = 2 [(gogoproto.nullable) = false]; + repeated Label labels = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/thanos-io/thanos/pkg/store/labelpb.ZLabel"]; + repeated AggrChunk chunks = 2 [(gogoproto.nullable) = false]; } message AggrChunk { diff --git a/vendor/github.com/thanos-io/thanos/pkg/store/tsdb.go b/vendor/github.com/thanos-io/thanos/pkg/store/tsdb.go index 87ab161999b..a700b48eb22 100644 --- a/vendor/github.com/thanos-io/thanos/pkg/store/tsdb.go +++ b/vendor/github.com/thanos-io/thanos/pkg/store/tsdb.go @@ -74,7 +74,7 @@ func (s *TSDBStore) Info(_ context.Context, _ *storepb.InfoRequest) (*storepb.In } res := &storepb.InfoResponse{ - Labels: labelpb.LabelsFromPromLabels(s.externalLabels), + Labels: labelpb.ZLabelsFromPromLabels(s.externalLabels), StoreType: s.component.ToProto(), MinTime: minTime, MaxTime: math.MaxInt64, @@ -82,9 +82,9 @@ func (s *TSDBStore) Info(_ context.Context, _ *storepb.InfoRequest) (*storepb.In // Until we deprecate the single labels in the reply, we just duplicate // them here for migration/compatibility purposes. - res.LabelSets = []storepb.LabelSet{} + res.LabelSets = []labelpb.ZLabelSet{} if len(res.Labels) > 0 { - res.LabelSets = append(res.LabelSets, storepb.LabelSet{ + res.LabelSets = append(res.LabelSets, labelpb.ZLabelSet{ Labels: res.Labels, }) } @@ -134,7 +134,7 @@ func (s *TSDBStore) Series(r *storepb.SeriesRequest, srv storepb.Store_SeriesSer // Stream at most one series per frame; series may be split over multiple frames according to maxBytesInFrame. for set.Next() { series := set.At() - seriesLabels := storepb.Series{Labels: labelpb.LabelsFromPromLabels(labelpb.ExtendLabels(series.Labels(), s.externalLabels))} + seriesLabels := storepb.Series{Labels: labelpb.ZLabelsFromPromLabels(labelpb.ExtendLabels(series.Labels(), s.externalLabels))} if r.SkipChunks { if err := srv.Send(storepb.NewSeriesResponse(&seriesLabels)); err != nil { return status.Error(codes.Aborted, err.Error()) diff --git a/vendor/modules.txt b/vendor/modules.txt index f811d748b87..a8176a6f14b 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -565,7 +565,7 @@ github.com/stretchr/objx github.com/stretchr/testify/assert github.com/stretchr/testify/mock github.com/stretchr/testify/require -# github.com/thanos-io/thanos v0.13.1-0.20201002105236-bb1662a1d13c +# github.com/thanos-io/thanos v0.13.1-0.20201019130456-f41940581d9a ## explicit github.com/thanos-io/thanos/pkg/block github.com/thanos-io/thanos/pkg/block/indexheader From 202c725e41c5d98c4a18f04b417e0a115f75ed4b Mon Sep 17 00:00:00 2001 From: Marco Pracucci Date: Mon, 19 Oct 2020 18:36:10 +0200 Subject: [PATCH 6/7] Updated CHANGELOG Signed-off-by: Marco Pracucci --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e078d282e4..b99d7a8dc71 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -81,6 +81,7 @@ * [ENHANCEMENT] Ruler: only load rules that belong to the ruler. Improves rules synching performances when ruler sharding is enabled. #3269 * [ENHANCEMENT] Added `-.redis.tls-insecure-skip-verify` flag. #3298 * [ENHANCEMENT] Added `cortex_alertmanager_config_last_reload_successful_seconds` metric to show timestamp of last successful AM config reload. #3289 +* [ENHANCEMENT] Blocks storage: reduced number of bucket listing operations to list block content (applies to newly created blocks only). #3363 * [BUGFIX] No-longer-needed ingester operations for queries triggered by queriers and rulers are now canceled. #3178 * [BUGFIX] Ruler: directories in the configured `rules-path` will be removed on startup and shutdown in order to ensure they don't persist between runs. #3195 * [BUGFIX] Handle hash-collisions in the query path. #3192 From 9cc84b1e05495fa0545f754bd59454e606df891a Mon Sep 17 00:00:00 2001 From: Marco Pracucci Date: Mon, 19 Oct 2020 18:42:24 +0200 Subject: [PATCH 7/7] Rebased master Signed-off-by: Marco Pracucci --- go.sum | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/go.sum b/go.sum index 9abb8bb42f1..cbe62671fee 100644 --- a/go.sum +++ b/go.sum @@ -56,6 +56,7 @@ github.com/Azure/azure-sdk-for-go v43.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9mo github.com/Azure/azure-sdk-for-go v44.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/azure-sdk-for-go v44.2.0+incompatible h1:d0WY8HTXhnurVBAkLXzv4bRpd+P5r3U/W17Z88PJWiI= github.com/Azure/azure-sdk-for-go v44.2.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= +github.com/Azure/azure-sdk-for-go v45.1.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/azure-sdk-for-go v46.4.0+incompatible h1:fCN6Pi+tEiEwFa8RSmtVlFHRXEZ+DJm9gfx/MKqYWw4= github.com/Azure/azure-sdk-for-go v46.4.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/azure-storage-blob-go v0.8.0 h1:53qhf0Oxa0nOjgbDeeYPUeyiNmafAFEY95rZLK0Tj6o= @@ -71,6 +72,7 @@ github.com/Azure/go-autorest/autorest v0.9.6/go.mod h1:/FALq9T/kS7b5J5qsQ+RSTUdA github.com/Azure/go-autorest/autorest v0.10.2/go.mod h1:/FALq9T/kS7b5J5qsQ+RSTUdAmGFqi0vUdVNNx8q630= github.com/Azure/go-autorest/autorest v0.11.2 h1:BR5GoSGobeiMwGOOIxXuvNKNPy+HMGdteKB8kJUDnBE= github.com/Azure/go-autorest/autorest v0.11.2/go.mod h1:JFgpikqFJ/MleTTxwepExTKnFUKKszPS8UavbQYUMuw= +github.com/Azure/go-autorest/autorest v0.11.4/go.mod h1:JFgpikqFJ/MleTTxwepExTKnFUKKszPS8UavbQYUMuw= github.com/Azure/go-autorest/autorest v0.11.10 h1:j5sGbX7uj1ieYYkQ3Mpvewd4DCsEQ+ZeJpqnSM9pjnM= github.com/Azure/go-autorest/autorest v0.11.10/go.mod h1:eipySxLmqSyC5s5k1CLupqet0PSENBEDP93LQ9a8QYw= github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= @@ -79,6 +81,7 @@ github.com/Azure/go-autorest/autorest/adal v0.8.2/go.mod h1:ZjhuQClTqx435SRJ2iMl github.com/Azure/go-autorest/autorest/adal v0.8.3/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q= github.com/Azure/go-autorest/autorest/adal v0.9.0 h1:SigMbuFNuKgc1xcGhaeapbh+8fgsu+GxgDRFyg7f5lM= github.com/Azure/go-autorest/autorest/adal v0.9.0/go.mod h1:/c022QCutn2P7uY+/oQWWNcK9YU+MH96NgK+jErpbcg= +github.com/Azure/go-autorest/autorest/adal v0.9.2/go.mod h1:/3SMAM86bP6wC9Ev35peQDUeqFZBMH07vvUOmg4z/fE= github.com/Azure/go-autorest/autorest/adal v0.9.5 h1:Y3bBUV4rTuxenJJs41HU3qmqsb+auo+a3Lz+PlJPpL0= github.com/Azure/go-autorest/autorest/adal v0.9.5/go.mod h1:B7KF7jKIeC9Mct5spmyCB/A8CG/sEz1vwIRGv/bbw7A= github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= @@ -182,6 +185,7 @@ github.com/aws/aws-sdk-go v1.31.9/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU github.com/aws/aws-sdk-go v1.33.5/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= github.com/aws/aws-sdk-go v1.33.12 h1:eydMoSwfrSTD9PWKUJOiDL7+/UwDW8AjInUGVE5Llh4= github.com/aws/aws-sdk-go v1.33.12/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= +github.com/aws/aws-sdk-go v1.34.9/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= github.com/aws/aws-sdk-go v1.35.5 h1:doSEOxC0UkirPcle20Rc+1kAhJ4Ip+GSEeZ3nKl7Qlk= github.com/aws/aws-sdk-go v1.35.5/go.mod h1:tlPOdRjfxPBpNIwqDj61rmsnA85v9jc0Ps9+muhnW+k= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= @@ -280,6 +284,7 @@ github.com/digitalocean/godo v1.37.0/go.mod h1:p7dOjjtSBqCTUksqtA5Fd3uaKs9kyTq2x github.com/digitalocean/godo v1.38.0/go.mod h1:p7dOjjtSBqCTUksqtA5Fd3uaKs9kyTq2xcz76ulEJRU= github.com/digitalocean/godo v1.42.0 h1:xQlEFLhQ1zZUryJAfiWb8meLPPCWnLO901U5Imhh0Mc= github.com/digitalocean/godo v1.42.0/go.mod h1:p7dOjjtSBqCTUksqtA5Fd3uaKs9kyTq2xcz76ulEJRU= +github.com/digitalocean/godo v1.42.1/go.mod h1:p7dOjjtSBqCTUksqtA5Fd3uaKs9kyTq2xcz76ulEJRU= github.com/digitalocean/godo v1.46.0 h1:WRbwjATilgz2NE4NGMeSDpeicy9h4xSKNGuRJ/Nq/fA= github.com/digitalocean/godo v1.46.0/go.mod h1:p7dOjjtSBqCTUksqtA5Fd3uaKs9kyTq2xcz76ulEJRU= github.com/docker/distribution v2.7.0+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= @@ -316,6 +321,7 @@ github.com/ema/qdisc v0.0.0-20190904071900-b82c76788043/go.mod h1:ix4kG2zvdUd8kE github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/evanphx/json-patch v0.0.0-20200808040245-162e5629780b/go.mod h1:NAJj0yf/KaRKURN6nyi7A9IZydMivZEm9oQLWNjfKDc= github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch v4.5.0+incompatible h1:ouOWdg56aJriqS0huScTkVXPC5IcNrDCXZ6OoTAWu7M= github.com/evanphx/json-patch v4.5.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= @@ -446,6 +452,7 @@ github.com/go-openapi/validate v0.19.2/go.mod h1:1tRCw7m3jtI8eNWEEliiAqUIcBztB2K github.com/go-openapi/validate v0.19.3/go.mod h1:90Vh6jjkTn+OT1Eefm0ZixWNFjhtOH7vS9k0lo6zwJo= github.com/go-openapi/validate v0.19.8 h1:YFzsdWIDfVuLvIOF+ZmKjVg1MbPJ1QgY9PihMwei1ys= github.com/go-openapi/validate v0.19.8/go.mod h1:8DJv2CVJQ6kGNpFW6eV9N3JviE1C85nY1c2z52x1Gk4= +github.com/go-redis/redis/v8 v8.0.0-beta.10.0.20200905143926-df7fe4e2ce72/go.mod h1:CJP1ZIHwhosNYwIdaHPZK9vHsM3+roNBaZ7U9Of1DXc= github.com/go-redis/redis/v8 v8.2.3 h1:eNesND+DWt/sjQOtPFxAbQkTIXaXX00qNLxjVWkZ70k= github.com/go-redis/redis/v8 v8.2.3/go.mod h1:ysgGY09J/QeDYbu3HikWEIPCwaeOkuNoTgKayTEaEOw= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= @@ -636,6 +643,7 @@ github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoP github.com/hashicorp/consul/api v1.4.0/go.mod h1:xc8u05kyMa3Wjr9eEAsIAo3dg8+LywT5E/Cl7cNS5nU= github.com/hashicorp/consul/api v1.5.0 h1:Yo2bneoGy68A7aNwmuETFnPhjyBEm7n3vzRacEVMjvI= github.com/hashicorp/consul/api v1.5.0/go.mod h1:LqwrLNW876eYSuUOo4ZLHBcdKc038txr/IMfbLPATa4= +github.com/hashicorp/consul/api v1.6.0/go.mod h1:1NSuaUUkFaJzMasbfq/11wKYWSR67Xn6r2DXKhuDNFg= github.com/hashicorp/consul/api v1.7.0 h1:tGs8Oep67r8CcA2Ycmb/8BLBcJ70St44mF2X10a/qPg= github.com/hashicorp/consul/api v1.7.0/go.mod h1:1NSuaUUkFaJzMasbfq/11wKYWSR67Xn6r2DXKhuDNFg= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= @@ -699,6 +707,7 @@ github.com/hashicorp/serf v0.9.0 h1:+Zd/16AJ9lxk9RzfTDyv/TLhZ8UerqYS0/+JGCIDaa0= github.com/hashicorp/serf v0.9.0/go.mod h1:YL0HO+FifKOW2u1ke99DGVu1zhcpZzNwrLIqBC7vbYU= github.com/hashicorp/serf v0.9.3 h1:AVF6JDQQens6nMHT9OGERBvK0f8rPrAGILnsKLr6lzM= github.com/hashicorp/serf v0.9.3/go.mod h1:UWDWwZeL5cuWDJdl0C6wrvrUwEqtQ4ZKBKKENpqIUyk= +github.com/hetznercloud/hcloud-go v1.21.1/go.mod h1:xng8lbDUg+xM1dgc0yGHX5EeqbwIq7UYlMWMTx3SQVg= github.com/hetznercloud/hcloud-go v1.22.0 h1:CC0jwkaBzwP4ObFE0sdJBTvGh5DE9kB/tuDETnRfOik= github.com/hetznercloud/hcloud-go v1.22.0/go.mod h1:xng8lbDUg+xM1dgc0yGHX5EeqbwIq7UYlMWMTx3SQVg= github.com/hodgesds/perf-utils v0.0.8/go.mod h1:F6TfvsbtrF88i++hou29dTXlI2sfsJv+gRZDtmTJkAs= @@ -713,6 +722,7 @@ github.com/influxdata/flux v0.65.1/go.mod h1:J754/zds0vvpfwuq7Gc2wRdVwEodfpCFM7m github.com/influxdata/influxdb v1.7.7/go.mod h1:qZna6X/4elxqT3yI9iZYdZrWWdeFOOprn86kgg4+IzY= github.com/influxdata/influxdb v1.8.0/go.mod h1:SIzcnsjaHRFpmlxpJ4S3NT64qtEKYweNTUMb/vh0OMQ= github.com/influxdata/influxdb v1.8.1/go.mod h1:SIzcnsjaHRFpmlxpJ4S3NT64qtEKYweNTUMb/vh0OMQ= +github.com/influxdata/influxdb v1.8.2/go.mod h1:SIzcnsjaHRFpmlxpJ4S3NT64qtEKYweNTUMb/vh0OMQ= github.com/influxdata/influxdb v1.8.3/go.mod h1:JugdFhsvvI8gadxOI6noqNeeBHvWNTbfYGtiAn+2jhI= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= github.com/influxdata/influxql v1.1.0/go.mod h1:KpVI7okXjK6PRi3Z5B+mtKZli+R1DnZgb3N+tzevNgo= @@ -940,6 +950,7 @@ github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+ github.com/onsi/ginkgo v1.11.0 h1:JAKSXpt1YjtLA7YpPiqO9ss6sNXEsPfSGdwN0UHqzrw= github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo v1.14.1 h1:jMU0WaQrP0a/YAEq8eJmJKjBoMs+pClEr1vDMlM/Do4= github.com/onsi/ginkgo v1.14.1/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= @@ -1068,6 +1079,7 @@ github.com/prometheus/prometheus v1.8.2-0.20200722151933-4a8531a64b32/go.mod h1: github.com/prometheus/prometheus v1.8.2-0.20200805082714-e0cf219f0de2/go.mod h1:i1KZsZmyDTJRvnR7zE8z/u2v+tkpPjoiPpnWp6nwhr0= github.com/prometheus/prometheus v1.8.2-0.20200819132913-cb830b0a9c78 h1:tHIAD+hgCIb86T0/Du7vGyfHa6J1+XsImQoY8Ete+c8= github.com/prometheus/prometheus v1.8.2-0.20200819132913-cb830b0a9c78/go.mod h1:zfAqy/MwhMFajB9E2n12/9gG2fvofIE9uKDtlZCDxqs= +github.com/prometheus/prometheus v1.8.2-0.20200923143134-7e2db3d092f3/go.mod h1:9VNWoDFHOMovlubld5uKKxfCDcPBj2GMOCjcUFXkYaM= github.com/prometheus/prometheus v1.8.2-0.20201014093524-73e2ce1bd643 h1:BDAexvKlOVjE5A8MlqRxzwkEpPl1/v6ydU1/J7kJtZc= github.com/prometheus/prometheus v1.8.2-0.20201014093524-73e2ce1bd643/go.mod h1:XYjkJiog7fyQu3puQNivZPI2pNq1C/775EIoHfDvuvY= github.com/rafaeljusto/redigomock v0.0.0-20190202135759-257e089e14a1 h1:+kGqA4dNN5hn7WwvKdzHl0rdN5AEkbNZd0VjRltAiZg= @@ -1309,6 +1321,7 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/exp v0.0.0-20200821190819-94841d0725da/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= @@ -1483,6 +1496,7 @@ golang.org/x/sys v0.0.0-20200728102440-3e129f6d46b1 h1:sIky/MyNRSHTrdxfsiUSS4WIA golang.org/x/sys v0.0.0-20200728102440-3e129f6d46b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200918174421-af09f7315aff/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201008064518-c1f3e3309c71 h1:ZPX6UakxrJCxWiyGWpXtFY+fp86Esy7xJT/jJCG8bgU= golang.org/x/sys v0.0.0-20201008064518-c1f3e3309c71/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1571,6 +1585,7 @@ golang.org/x/tools v0.0.0-20200725200936-102e7d357031 h1:VtIxiVHWPhnny2ZTi4f9/2d golang.org/x/tools v0.0.0-20200725200936-102e7d357031/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200822203824-307de81be3f4/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= golang.org/x/tools v0.0.0-20201008025239-9df69603baec h1:RY2OghEV/7X1MLaecgm1mwFd3sGvUddm5pGVSxQvX0c= @@ -1735,6 +1750,7 @@ k8s.io/api v0.18.3/go.mod h1:UOaMwERbqJMfeeeHc8XJKawj4P9TgDRnViIqqBeH2QA= k8s.io/api v0.18.5/go.mod h1:tN+e/2nbdGKOAH55NMV8oGrMG+3uRlA9GaRfvnCCSNk= k8s.io/api v0.18.6 h1:osqrAXbOQjkKIWDTjrqxWQ3w0GkKb1KA1XkUGHHYpeE= k8s.io/api v0.18.6/go.mod h1:eeyxr+cwCjMdLAmr2W3RyDI0VvTawSg/3RFFBEnmZGI= +k8s.io/api v0.18.8/go.mod h1:d/CXqwWv+Z2XEG1LgceeDmHQwpUJhROPx16SlxJgERY= k8s.io/api v0.19.2 h1:q+/krnHWKsL7OBZg/rxnycsl9569Pud76UJ77MvKXms= k8s.io/api v0.19.2/go.mod h1:IQpK0zFQ1xc5iNIQPqzgoOwuFugaYHK4iCknlAQP9nI= k8s.io/apimachinery v0.0.0-20190809020650-423f5d784010/go.mod h1:Waf/xTS2FGRrgXCkO5FP3XxTOWh0qLf2QhL1qFZZ/R8= @@ -1743,6 +1759,7 @@ k8s.io/apimachinery v0.18.3/go.mod h1:OaXp26zu/5J7p0f92ASynJa1pZo06YlV9fG7BoWbCk k8s.io/apimachinery v0.18.5/go.mod h1:OaXp26zu/5J7p0f92ASynJa1pZo06YlV9fG7BoWbCko= k8s.io/apimachinery v0.18.6 h1:RtFHnfGNfd1N0LeSrKCUznz5xtUP1elRGvHJbL3Ntag= k8s.io/apimachinery v0.18.6/go.mod h1:OaXp26zu/5J7p0f92ASynJa1pZo06YlV9fG7BoWbCko= +k8s.io/apimachinery v0.18.8/go.mod h1:6sQd+iHEqmOtALqOFjSWp2KZ9F0wlU/nWm0ZgsYWMig= k8s.io/apimachinery v0.19.2 h1:5Gy9vQpAGTKHPVOh5c4plE274X8D/6cuEiTO2zve7tc= k8s.io/apimachinery v0.19.2/go.mod h1:DnPGDnARWFvYa3pMHgSxtbZb7gpzzAZ1pTfaUNDVlmA= k8s.io/client-go v0.19.2 h1:gMJuU3xJZs86L1oQ99R4EViAADUPMHHtS9jFshasHSc=