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 b98f5ae
Show file tree
Hide file tree
Showing 18 changed files with 55 additions and 55 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
15 changes: 7 additions & 8 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 @@ -107,10 +107,10 @@ require (
)

require (
cloud.google.com/go v0.102.0 // indirect
cloud.google.com/go v0.104.0 // indirect
cloud.google.com/go/compute v1.7.0 // indirect
cloud.google.com/go/iam v0.3.0 // indirect
cloud.google.com/go/storage v1.22.1 // indirect
cloud.google.com/go/storage v1.27.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.1.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 // indirect
Expand All @@ -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 Expand Up @@ -177,8 +177,7 @@ require (
github.com/google/pprof v0.0.0-20220829040838-70bd9ae97f40 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.1.0 // indirect
github.com/googleapis/gax-go/v2 v2.4.0 // indirect
github.com/googleapis/go-type-adapters v1.0.0 // indirect
github.com/googleapis/gax-go/v2 v2.5.1 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-hclog v0.16.2 // indirect
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
Expand Down Expand Up @@ -239,7 +238,7 @@ require (
golang.org/x/tools v0.1.12 // indirect
golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f // indirect
gonum.org/v1/gonum v0.12.0 // indirect
google.golang.org/api v0.96.0 // indirect
google.golang.org/api v0.97.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/ini.v1 v1.66.6 // indirect
Expand Down
24 changes: 13 additions & 11 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW
cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc=
cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA=
cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w99A=
cloud.google.com/go v0.102.0 h1:DAq3r8y4mDgyB/ZPJ9v/5VJNqjgJAxTn6ZYLlUywOu8=
cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc=
cloud.google.com/go v0.104.0 h1:gSmWO7DY1vOm0MVU6DNXM11BWHHsTUmsC5cv1fuW5X8=
cloud.google.com/go v0.104.0/go.mod h1:OO6xxXdJyvuJPcEPBLN9BJPD+jep5G1+2U5B5gkRYtA=
cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o=
cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE=
cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc=
Expand All @@ -54,8 +55,9 @@ cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0Zeo
cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk=
cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
cloud.google.com/go/storage v1.22.1 h1:F6IlQJZrZM++apn9V5/VfS3gbTUYg98PS3EMQAzqtfg=
cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y=
cloud.google.com/go/storage v1.27.0 h1:YOO045NZI9RKfCj1c5A/ZtuuENUc8OAW+gHdGnDgyMQ=
cloud.google.com/go/storage v1.27.0/go.mod h1:x9DOL8TK/ygDUMieqwfhdpQryTeEkhGKMi80i/iqR2s=
cloud.google.com/go/trace v1.2.0 h1:oIaB4KahkIUOpLSAAjEJ8y2desbjY/x/RfP4O3KAtTI=
cloud.google.com/go/trace v1.2.0/go.mod h1:Wc8y/uYyOhPy12KEnXG9XGrvfMz5F5SrYecQlbW1rwM=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
Expand Down Expand Up @@ -139,8 +141,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 @@ -503,9 +505,9 @@ github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pf
github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM=
github.com/googleapis/gax-go/v2 v2.2.0/go.mod h1:as02EH8zWkzwUoLbBaFeQ+arQaj/OthfcblKl4IGNaM=
github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99EXz9pXxye9YM=
github.com/googleapis/gax-go/v2 v2.4.0 h1:dS9eYAjhrE2RjmzYw2XAPvcXfmcQLtFEQWn0CR82awk=
github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c=
github.com/googleapis/go-type-adapters v1.0.0 h1:9XdMn+d/G57qq1s8dNc5IesGCXHf6V2HZ2JwRxfA2tA=
github.com/googleapis/gax-go/v2 v2.5.1 h1:kBRZU0PSuI7PspsSb/ChWoVResUcwNVIdpB049pKTiw=
github.com/googleapis/gax-go/v2 v2.5.1/go.mod h1:h6B0KMMFNtI2ddbGJn3T3ZbwkeT6yqEF02fYlzkUCyo=
github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4=
github.com/googleinterns/cloud-operations-api-mock v0.0.0-20200709193332-a1e58c29bdd3 h1:eHv/jVY/JNop1xg2J9cBb4EzyMpWZoNCP1BslSAIkOI=
github.com/gophercloud/gophercloud v1.0.0 h1:9nTGx0jizmHxDobe4mck89FyQHVyA3CaXLIUSGJjP9k=
Expand Down Expand Up @@ -935,8 +937,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 +1081,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 Expand Up @@ -1445,8 +1447,8 @@ google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69
google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw=
google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg=
google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o=
google.golang.org/api v0.96.0 h1:F60cuQPJq7K7FzsxMYHAUJSiXh2oKctHxBMbDygxhfM=
google.golang.org/api v0.96.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s=
google.golang.org/api v0.97.0 h1:x/vEL1XDF/2V4xzdNgFPaKHluRESo2aTsL7QzHnBtGQ=
google.golang.org/api v0.97.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s=
google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
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
Loading

0 comments on commit b98f5ae

Please sign in to comment.