Skip to content

Commit

Permalink
*: update dependency
Browse files Browse the repository at this point in the history
Update prometheus dependency.

Signed-off-by: Giedrius Statkevičius <[email protected]>
  • Loading branch information
GiedriusS committed Oct 4, 2022
1 parent 84d22a1 commit fb6f97f
Show file tree
Hide file tree
Showing 18 changed files with 43 additions and 44 deletions.
3 changes: 1 addition & 2 deletions cmd/thanos/receive.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ func registerReceive(app *extkingpin.App) {
RetentionDuration: int64(time.Duration(*conf.retention) / time.Millisecond),
NoLockfile: conf.noLockFile,
WALCompression: conf.walCompression,
AllowOverlappingBlocks: conf.tsdbAllowOverlappingBlocks,
MaxExemplars: conf.tsdbMaxExemplars,
EnableExemplarStorage: true,
HeadChunksWriteQueueSize: int(conf.tsdbWriteQueueSize),
Expand Down Expand Up @@ -837,7 +836,7 @@ func (rc *receiveConfig) registerFlag(cmd extkingpin.FlagClause) {

rc.tsdbMaxBlockDuration = extkingpin.ModelDuration(cmd.Flag("tsdb.max-block-duration", "Max duration for local TSDB blocks").Default("2h").Hidden())

cmd.Flag("tsdb.allow-overlapping-blocks", "Allow overlapping blocks, which in turn enables vertical compaction and vertical query merge.").Default("false").BoolVar(&rc.tsdbAllowOverlappingBlocks)
cmd.Flag("tsdb.allow-overlapping-blocks", "Allow overlapping blocks, which in turn enables vertical compaction and vertical query merge. Does not do anything, enabled all the time.").Default("false").BoolVar(&rc.tsdbAllowOverlappingBlocks)

cmd.Flag("tsdb.wal-compression", "Compress the tsdb WAL.").Default("true").BoolVar(&rc.walCompression)

Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ require (
github.com/prometheus/common v0.37.0
github.com/prometheus/exporter-toolkit v0.7.1
// Prometheus maps version 2.x.y to tags v0.x.y.
github.com/prometheus/prometheus v0.38.0
github.com/prometheus/prometheus v0.38.1-0.20221003141934-f7a7b18cdcca
github.com/sony/gobreaker v0.5.0
github.com/stretchr/testify v1.8.0
github.com/thanos-community/promql-engine v0.0.0-20220926123320-18a0a4b4be8f
github.com/thanos-community/promql-engine v0.0.0-20221004075442-da92170150df
github.com/thanos-io/objstore v0.0.0-20220923084403-cec51c61948b
github.com/uber/jaeger-client-go v2.30.0+incompatible
github.com/uber/jaeger-lib v2.4.1+incompatible
Expand Down Expand Up @@ -124,7 +124,7 @@ require (
github.com/aliyun/aliyun-oss-go-sdk v2.2.2+incompatible // indirect
github.com/armon/go-radix v1.0.0 // indirect
github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d // indirect
github.com/aws/aws-sdk-go v1.44.102 // indirect
github.com/aws/aws-sdk-go v1.44.109 // indirect
github.com/aws/aws-sdk-go-v2 v1.16.0 // indirect
github.com/aws/aws-sdk-go-v2/config v1.15.1 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.11.0 // indirect
Expand Down
10 changes: 5 additions & 5 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQ
github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/aws/aws-sdk-go v1.38.35/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro=
github.com/aws/aws-sdk-go v1.43.11/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo=
github.com/aws/aws-sdk-go v1.44.102 h1:6tUCTGL2UDbFZae1TLGk8vTgeXuzkb8KbAe2FiAeKHc=
github.com/aws/aws-sdk-go v1.44.102/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo=
github.com/aws/aws-sdk-go v1.44.109 h1:+Na5JPeS0kiEHoBp5Umcuuf+IDqXqD0lXnM920E31YI=
github.com/aws/aws-sdk-go v1.44.109/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo=
github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g=
github.com/aws/aws-sdk-go-v2 v1.16.0 h1:cBAYjiiexRAg9v2z9vb6IdxAa7ef4KCtjW7w7e3GxGo=
github.com/aws/aws-sdk-go-v2 v1.16.0/go.mod h1:lJYcuZZEHWNIb6ugJjbQY1fykdoobWbOS7kJYb4APoI=
Expand Down Expand Up @@ -935,8 +935,8 @@ github.com/tencentyun/cos-go-sdk-v5 v0.7.34 h1:xm+Pg+6m486y4eugRI7/E4WasbVmpY1hp
github.com/tencentyun/cos-go-sdk-v5 v0.7.34/go.mod h1:4dCEtLHGh8QPxHEkgq+nFaky7yZxQuYwgSJM87icDaw=
github.com/thanos-community/galaxycache v0.0.0-20211122094458-3a32041a1f1e h1:f1Zsv7OAU9iQhZwigp50Yl38W10g/vd5NC8Rdk1Jzng=
github.com/thanos-community/galaxycache v0.0.0-20211122094458-3a32041a1f1e/go.mod h1:jXcofnrSln/cLI6/dhlBxPQZEEQHVPCcFaH75M+nSzM=
github.com/thanos-community/promql-engine v0.0.0-20220926123320-18a0a4b4be8f h1:S+IFfNs2XA2pbd0cRtk8aOpLH8D/Q7Ipess3WRfcgPw=
github.com/thanos-community/promql-engine v0.0.0-20220926123320-18a0a4b4be8f/go.mod h1:IEJ3g2fmXAun4Rj39T4Anfm1AYvcDmxqWWSuYdn2TRM=
github.com/thanos-community/promql-engine v0.0.0-20221004075442-da92170150df h1:vrevr7p2FtiqD48UiuuPyFvu2t8WdHEENDD+6jMyFyU=
github.com/thanos-community/promql-engine v0.0.0-20221004075442-da92170150df/go.mod h1:xPhabVMItFWDcYsyOJ1QBZtjl0zBytHdgv8P+6dPtPM=
github.com/thanos-io/objstore v0.0.0-20220923084403-cec51c61948b h1:P+MnJn+NoU6N2v7wLexTVRCu6ZvcOdPU4L8f2dgEfiY=
github.com/thanos-io/objstore v0.0.0-20220923084403-cec51c61948b/go.mod h1:Vx5dZs9ElxEhNLnum/OgB0pNTqNdI2zdXL82BeJr3T4=
github.com/themihai/gomemcache v0.0.0-20180902122335-24332e2d58ab h1:7ZR3hmisBWw77ZpO1/o86g+JV3VKlk3d48jopJxzTjU=
Expand Down Expand Up @@ -1079,8 +1079,8 @@ golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u0
golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
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 h1:QE6XYQK6naiK1EPAe1g/ILLxN5RBoH5xkJk3CqlMI/Y=
golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e h1:+WEEuIdZHnUeJJmEUjyYC2gfUMj69yZXw17EnHg/otA=
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=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
Expand Down
2 changes: 1 addition & 1 deletion internal/cortex/chunk/series_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ func injectShardLabels(chunks []Chunk, shard astmapper.ShardAnnotation) {
b := labels.NewBuilder(chunk.Metric)
l := shard.Label()
b.Set(l.Name, l.Value)
chunk.Metric = b.Labels()
chunk.Metric = b.Labels(nil)
chunks[i] = chunk
}
}
Expand Down
20 changes: 10 additions & 10 deletions internal/cortex/ingester/client/compat_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,19 +109,19 @@ func TestFingerprintCollisions(t *testing.T) {
const _label2 = "KiqbryhzUpn"

metric := labels.NewBuilder(labels.FromStrings("__name__", "logs"))
c1 = metric.Set("_", _label1).Labels()
c2 = metric.Set("_", _label2).Labels()
c1 = metric.Set("_", _label1).Labels(nil)
c2 = metric.Set("_", _label2).Labels(nil)
verifyCollision(t, true, c1, c2)

metric = labels.NewBuilder(labels.FromStrings("__name__", "up", "instance", "hello"))
c1 = metric.Set("_", _label1).Labels()
c2 = metric.Set("_", _label2).Labels()
c1 = metric.Set("_", _label1).Labels(nil)
c2 = metric.Set("_", _label2).Labels(nil)
verifyCollision(t, true, c1, c2)

// here it breaks, because "Z" label is sorted before "_" label.
metric = labels.NewBuilder(labels.FromStrings("__name__", "up", "Z", "hello"))
c1 = metric.Set("_", _label1).Labels()
c2 = metric.Set("_", _label2).Labels()
c1 = metric.Set("_", _label1).Labels(nil)
c2 = metric.Set("_", _label2).Labels(nil)
verifyCollision(t, false, c1, c2)

// A="K6sjsNNczPl" and A="cswpLMIZpwt" label has similar property.
Expand All @@ -132,14 +132,14 @@ func TestFingerprintCollisions(t *testing.T) {
const Alabel2 = "cswpLMIZpwt"

metric = labels.NewBuilder(labels.FromStrings("__name__", "up", "Z", "hello"))
c1 = metric.Set("A", Alabel1).Labels()
c2 = metric.Set("A", Alabel2).Labels()
c1 = metric.Set("A", Alabel1).Labels(nil)
c2 = metric.Set("A", Alabel2).Labels(nil)
verifyCollision(t, true, c1, c2)

// Adding the same suffix to the "A" label also works.
metric = labels.NewBuilder(labels.FromStrings("__name__", "up", "Z", "hello"))
c1 = metric.Set("A", Alabel1+"suffix").Labels()
c2 = metric.Set("A", Alabel2+"suffix").Labels()
c1 = metric.Set("A", Alabel1+"suffix").Labels(nil)
c2 = metric.Set("A", Alabel2+"suffix").Labels(nil)
verifyCollision(t, true, c1, c2)
}

Expand Down
2 changes: 1 addition & 1 deletion internal/cortex/querier/querier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ func mockTSDB(t *testing.T, mint model.Time, samples int, step, chunkOffset time
opts := tsdb.DefaultHeadOptions()
opts.ChunkDirRoot = t.TempDir()
// We use TSDB head only. By using full TSDB DB, and appending samples to it, closing it would cause unnecessary HEAD compaction, which slows down the test.
head, err := tsdb.NewHead(nil, nil, nil, opts, nil)
head, err := tsdb.NewHead(nil, nil, nil, nil, opts, nil)
require.NoError(t, err)
t.Cleanup(func() {
_ = head.Close()
Expand Down
4 changes: 2 additions & 2 deletions internal/cortex/util/metrics_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ func FromLabelPairsToLabels(pairs []*dto.LabelPair) labels.Labels {
for _, pair := range pairs {
builder.Set(pair.GetName(), pair.GetValue())
}
return builder.Labels()
return builder.Labels(nil)
}

// GetSumOfHistogramSampleCount returns the sum of samples count of histograms matching the provided metric name
Expand Down Expand Up @@ -782,7 +782,7 @@ nextMetric:

lbls.Set(lp.GetName(), lp.GetValue())
}
result = append(result, lbls.Labels())
result = append(result, lbls.Labels(nil))
}

return result, errs.Err()
Expand Down
2 changes: 1 addition & 1 deletion pkg/alert/alert.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ func (q *Queue) Push(alerts []*notifier.Alert) {
for _, l := range q.toAddLset {
lb.Set(l.Name, l.Value)
}
a.Labels = relabel.Process(lb.Labels(), q.alertRelabelConfigs...)
a.Labels = relabel.Process(lb.Labels(nil), q.alertRelabelConfigs...)
if a.Labels != nil {
relabeledAlerts = append(relabeledAlerts, a)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/block/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ func rewrite(
sort.Sort(lset)

for i, c := range chks {
chks[i].Chunk, err = chunkr.Chunk(c.Ref)
chks[i].Chunk, err = chunkr.Chunk(c)
if err != nil {
return errors.Wrap(err, "chunk read")
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/compact/downsample/downsample.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func Downsample(
// While #183 exists, we sanitize the chunks we retrieved from the block
// before retrieving their samples.
for i, c := range chks {
chk, err := chunkr.Chunk(c.Ref)
chk, err := chunkr.Chunk(c)
if err != nil {
return id, errors.Wrapf(err, "get chunk %d, series %d", c.Ref, postings.At())
}
Expand Down
10 changes: 5 additions & 5 deletions pkg/compact/downsample/downsample_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ func TestDownsample(t *testing.T) {

var got []map[AggrType][]sample
for _, c := range chks {
chk, err := chunkr.Chunk(c.Ref)
chk, err := chunkr.Chunk(c)
testutil.Ok(t, err)

m := map[AggrType][]sample{}
Expand Down Expand Up @@ -982,12 +982,12 @@ func (b *memBlock) Series(id storage.SeriesRef, lset *labels.Labels, chks *[]chu
return nil
}

func (b *memBlock) Chunk(id chunks.ChunkRef) (chunkenc.Chunk, error) {
if uint64(id) >= b.numberOfChunks {
return nil, errors.Wrapf(storage.ErrNotFound, "chunk with ID %d does not exist", id)
func (b *memBlock) Chunk(m chunks.Meta) (chunkenc.Chunk, error) {
if uint64(m.Ref) >= b.numberOfChunks {
return nil, errors.Wrapf(storage.ErrNotFound, "chunk with ID %d does not exist", m.Ref)
}

return b.chunks[id], nil
return b.chunks[m.Ref], nil
}

func (b *memBlock) Symbols() index.StringIter {
Expand Down
2 changes: 1 addition & 1 deletion pkg/compactv2/chunk_series_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func (e errChunk) Compact() {}
func (l *lazyPopulatableChunk) populate() {
// TODO(bwplotka): In most cases we don't need to parse anything, just copy. Extend reader/writer for this.
var err error
l.populated, err = l.cr.Chunk(l.m.Ref)
l.populated, err = l.cr.Chunk(*l.m)
if err != nil {
l.m.Chunk = errChunk{err: errChunkIterator{err: errors.Wrapf(err, "cannot populate chunk %d", l.m.Ref)}}
return
Expand Down
2 changes: 1 addition & 1 deletion pkg/compactv2/compactor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ func readBlockSeries(t *testing.T, bDir string) []seriesSamples {
testutil.Ok(t, indexr.Series(all.At(), &s.lset, &chks))

for _, c := range chks {
c.Chunk, err = chunkr.Chunk(c.Ref)
c.Chunk, err = chunkr.Chunk(c)
testutil.Ok(t, err)

var chk []sample
Expand Down
2 changes: 1 addition & 1 deletion pkg/dedup/iter.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func NewSeriesSet(set storage.SeriesSet, replicaLabels map[string]struct{}, f st
// trimPushdownMarker trims the pushdown marker from the given labels.
// Returns true if there was a pushdown marker.
func trimPushdownMarker(lbls labels.Labels) (labels.Labels, bool) {
return labels.NewBuilder(lbls).Del(PushdownMarker.Name).Labels(), lbls.Has(PushdownMarker.Name)
return labels.NewBuilder(lbls).Del(PushdownMarker.Name).Labels(nil), lbls.Has(PushdownMarker.Name)
}

func (s *dedupSeriesSet) Next() bool {
Expand Down
10 changes: 5 additions & 5 deletions pkg/store/bucket_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1084,7 +1084,7 @@ func uploadTestBlock(t testing.TB, tmpDir string, bkt objstore.Bucket, series in
headOpts := tsdb.DefaultHeadOptions()
headOpts.ChunkDirRoot = tmpDir
headOpts.ChunkRange = 1000
h, err := tsdb.NewHead(nil, nil, nil, headOpts, nil)
h, err := tsdb.NewHead(nil, nil, nil, nil, headOpts, nil)
testutil.Ok(t, err)
defer func() {
testutil.Ok(t, h.Close())
Expand Down Expand Up @@ -1462,7 +1462,7 @@ func TestBucketSeries_OneBlock_InMemIndexCacheSegfault(t *testing.T) {
// This allows to pick time range that will correspond to number of series picked 1:1.
{
// Block 1.
h, err := tsdb.NewHead(nil, nil, nil, headOpts, nil)
h, err := tsdb.NewHead(nil, nil, nil, nil, headOpts, nil)
testutil.Ok(t, err)
defer func() { testutil.Ok(t, h.Close()) }()

Expand Down Expand Up @@ -1501,7 +1501,7 @@ func TestBucketSeries_OneBlock_InMemIndexCacheSegfault(t *testing.T) {
var b2 *bucketBlock
{
// Block 2, do not load this block yet.
h, err := tsdb.NewHead(nil, nil, nil, headOpts, nil)
h, err := tsdb.NewHead(nil, nil, nil, nil, headOpts, nil)
testutil.Ok(t, err)
defer func() { testutil.Ok(t, h.Close()) }()

Expand Down Expand Up @@ -1742,7 +1742,7 @@ func TestSeries_BlockWithMultipleChunks(t *testing.T) {
headOpts.ChunkDirRoot = filepath.Join(tmpDir, "block")
headOpts.ChunkRange = 10000000000

h, err := tsdb.NewHead(nil, nil, nil, headOpts, nil)
h, err := tsdb.NewHead(nil, nil, nil, nil, headOpts, nil)
testutil.Ok(t, err)
defer func() { testutil.Ok(t, h.Close()) }()

Expand Down Expand Up @@ -1889,7 +1889,7 @@ func createBlockWithOneSeriesWithStep(t testutil.TB, dir string, lbls labels.Lab
headOpts := tsdb.DefaultHeadOptions()
headOpts.ChunkDirRoot = dir
headOpts.ChunkRange = int64(totalSamples) * step
h, err := tsdb.NewHead(nil, nil, nil, headOpts, nil)
h, err := tsdb.NewHead(nil, nil, nil, nil, headOpts, nil)
testutil.Ok(t, err)
defer func() { testutil.Ok(t, h.Close()) }()

Expand Down
2 changes: 1 addition & 1 deletion pkg/store/postings_codec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func TestDiffVarintCodec(t *testing.T) {
headOpts := tsdb.DefaultHeadOptions()
headOpts.ChunkDirRoot = chunksDir
headOpts.ChunkRange = 1000
h, err := tsdb.NewHead(nil, nil, nil, headOpts, nil)
h, err := tsdb.NewHead(nil, nil, nil, nil, headOpts, nil)
testutil.Ok(t, err)
defer func() {
testutil.Ok(t, h.Close())
Expand Down
4 changes: 2 additions & 2 deletions pkg/store/storepb/testutil/series.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func CreateHeadWithSeries(t testing.TB, j int, opts HeadGenOptions) (*tsdb.Head,

headOpts := tsdb.DefaultHeadOptions()
headOpts.ChunkDirRoot = opts.TSDBDir
h, err := tsdb.NewHead(nil, nil, w, headOpts, nil)
h, err := tsdb.NewHead(nil, nil, nil, w, headOpts, nil)
testutil.Ok(t, err)

app := h.Appender(context.Background())
Expand Down Expand Up @@ -129,7 +129,7 @@ func CreateHeadWithSeries(t testing.TB, j int, opts HeadGenOptions) (*tsdb.Head,
}

for _, c := range chunkMetas {
chEnc, err := chks.Chunk(c.Ref)
chEnc, err := chks.Chunk(c)
testutil.Ok(t, err)

// Open Chunk.
Expand Down
2 changes: 1 addition & 1 deletion pkg/testutil/e2eutil/prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ func createBlock(
headOpts := tsdb.DefaultHeadOptions()
headOpts.ChunkDirRoot = filepath.Join(dir, "chunks")
headOpts.ChunkRange = 10000000000
h, err := tsdb.NewHead(nil, nil, nil, headOpts, nil)
h, err := tsdb.NewHead(nil, nil, nil, nil, headOpts, nil)
if err != nil {
return id, errors.Wrap(err, "create head block")
}
Expand Down

0 comments on commit fb6f97f

Please sign in to comment.