diff --git a/CHANGELOG.md b/CHANGELOG.md index 81c54dbfe7..e3ca073320 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ We use *breaking :warning:* to mark changes that are not backward compatible (re - [#6891](https://github.com/thanos-io/thanos/pull/6891) Objstore: Bump `objstore` which adds support for Azure Workload Identity. - [#6453](https://github.com/thanos-io/thanos/pull/6453) Sidecar: Added `--reloader.method` to support configuration reloads via SIHUP signal. +- [#6925](https://github.com/thanos-io/thanos/pull/6925) Store Gateway: Support float native histogram. ### Changed diff --git a/pkg/store/bucket.go b/pkg/store/bucket.go index d072be132b..93a7a50892 100644 --- a/pkg/store/bucket.go +++ b/pkg/store/bucket.go @@ -1251,7 +1251,7 @@ func populateChunk(out *storepb.AggrChunk, in chunkenc.Chunk, aggrs []storepb.Ag hasher := hashPool.Get().(hash.Hash64) defer hashPool.Put(hasher) - if in.Encoding() == chunkenc.EncXOR || in.Encoding() == chunkenc.EncHistogram { + if in.Encoding() == chunkenc.EncXOR || in.Encoding() == chunkenc.EncHistogram || in.Encoding() == chunkenc.EncFloatHistogram { b, err := save(in.Bytes()) if err != nil { return err diff --git a/pkg/store/bucket_test.go b/pkg/store/bucket_test.go index 18ca0b8170..2d48c1b084 100644 --- a/pkg/store/bucket_test.go +++ b/pkg/store/bucket_test.go @@ -1301,6 +1301,13 @@ func TestBucketHistogramSeries(t *testing.T) { }) } +func TestBucketFloatHistogramSeries(t *testing.T) { + tb := testutil.NewTB(t) + storetestutil.RunSeriesInterestingCases(tb, 200e3, 200e3, func(t testutil.TB, samplesPerSeries, series int) { + benchBucketSeries(t, chunkenc.ValFloatHistogram, false, false, samplesPerSeries, series, 1) + }) +} + func TestBucketSkipChunksSeries(t *testing.T) { tb := testutil.NewTB(t) storetestutil.RunSeriesInterestingCases(tb, 200e3, 200e3, func(t testutil.TB, samplesPerSeries, series int) { diff --git a/pkg/store/storepb/prompb/types.pb.go b/pkg/store/storepb/prompb/types.pb.go index 42c1b0fd9c..46aca14f64 100644 --- a/pkg/store/storepb/prompb/types.pb.go +++ b/pkg/store/storepb/prompb/types.pb.go @@ -136,21 +136,24 @@ func (LabelMatcher_Type) EnumDescriptor() ([]byte, []int) { type Chunk_Encoding int32 const ( - Chunk_UNKNOWN Chunk_Encoding = 0 - Chunk_XOR Chunk_Encoding = 1 - Chunk_HISTOGRAM Chunk_Encoding = 2 + Chunk_UNKNOWN Chunk_Encoding = 0 + Chunk_XOR Chunk_Encoding = 1 + Chunk_HISTOGRAM Chunk_Encoding = 2 + Chunk_FLOAT_HISTOGRAM Chunk_Encoding = 3 ) var Chunk_Encoding_name = map[int32]string{ 0: "UNKNOWN", 1: "XOR", 2: "HISTOGRAM", + 3: "FLOAT_HISTOGRAM", } var Chunk_Encoding_value = map[string]int32{ - "UNKNOWN": 0, - "XOR": 1, - "HISTOGRAM": 2, + "UNKNOWN": 0, + "XOR": 1, + "HISTOGRAM": 2, + "FLOAT_HISTOGRAM": 3, } func (x Chunk_Encoding) String() string { @@ -988,79 +991,79 @@ func init() { func init() { proto.RegisterFile("store/storepb/prompb/types.proto", fileDescriptor_166e07899dab7c14) } var fileDescriptor_166e07899dab7c14 = []byte{ - // 1140 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0xcf, 0x8f, 0xda, 0xc6, - 0x17, 0xc7, 0x36, 0x18, 0xfc, 0x16, 0x88, 0x33, 0xca, 0x37, 0x71, 0xf6, 0xdb, 0x12, 0x6a, 0xf5, - 0x07, 0x8a, 0x5a, 0x90, 0x92, 0xa8, 0xbd, 0x6c, 0xab, 0x2e, 0x5b, 0x76, 0x59, 0xb5, 0x80, 0x32, - 0xb0, 0x6a, 0x93, 0x0b, 0x1a, 0x60, 0x16, 0x5b, 0x8b, 0x7f, 0xc8, 0x33, 0x44, 0x4b, 0xff, 0x8a, - 0x9e, 0x7b, 0xab, 0x7a, 0x6b, 0x4f, 0x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 0xe9, 0x73, 0x94, 0x04, 0x67, 0x11, 0xe8, 0x6b, 0x00, 0x27, 0x6d, 0x1b, 0xb3, 0xf2, 0x32, 0x7e, - 0xff, 0xed, 0x9d, 0x4d, 0x12, 0x6c, 0xc4, 0xd8, 0x3f, 0x2b, 0x50, 0x96, 0x67, 0xe9, 0x11, 0x3e, - 0x75, 0x68, 0x84, 0x3e, 0xdf, 0x5a, 0x27, 0xf6, 0x4e, 0xb2, 0x4d, 0xe7, 0xe6, 0xc6, 0x1a, 0x41, - 0x90, 0xdf, 0x58, 0x1c, 0x52, 0xce, 0x5e, 0x36, 0x4d, 0x82, 0xb1, 0x62, 0x37, 0x20, 0x2f, 0x97, - 0x82, 0x0e, 0x6a, 0xe7, 0x69, 0x3c, 0x21, 0xfd, 0xce, 0xd3, 0x78, 0x42, 0xb0, 0x58, 0x04, 0x02, - 0xc0, 0x1d, 0x53, 0xb3, 0xff, 0x50, 0xc4, 0x58, 0x91, 0x99, 0x98, 0x2a, 0x86, 0xee, 0x41, 0x91, - 0x71, 0x1a, 0x8e, 0x3d, 0x26, 0xc9, 0x69, 0x58, 0x17, 0x6a, 0x8f, 0x89, 0xd2, 0xe7, 0x4b, 0x7f, - 0x9a, 0x96, 0x16, 0x32, 0xba, 0x0f, 0x25, 0xc6, 0x49, 0xc4, 0x85, 0x77, 0xfc, 0x7a, 0x16, 0xa5, - 0xde, 0x63, 0xe8, 0x7f, 0xa0, 0x53, 0x7f, 0x36, 0x96, 0x1f, 0x4c, 0x18, 0x0a, 0xd4, 0x9f, 0xf5, - 0x18, 0xda, 0x87, 0xd2, 0x3c, 0x0a, 0x96, 0xa1, 0xeb, 0xcf, 0xad, 0x42, 0x5d, 0x6b, 0x18, 0x78, - 0xad, 0xa3, 0x2a, 0xa8, 0x93, 0x95, 0x7c, 0xc1, 0x4a, 0x58, 0x9d, 0xac, 0x44, 0xf6, 0x88, 0xf8, - 0x73, 0x2a, 0x92, 0x14, 0xe3, 0xec, 0x52, 0xef, 0x31, 0xfb, 0x4f, 0x05, 0x0a, 0x47, 0xce, 0xd2, - 0xbf, 0x40, 0x35, 0xd8, 0xf3, 0x5c, 0x7f, 0x2c, 0x2e, 0x49, 0xc6, 0xd9, 0xf0, 0x5c, 0x5f, 0x4c, - 0x67, 0x8f, 0x49, 0x3b, 0xb9, 0x5c, 0xdb, 0x93, 0x4d, 0xe4, 0x91, 0xcb, 0xc4, 0xfe, 0x38, 0xe9, - 0x84, 0x26, 0x3b, 0xf1, 0x60, 0xa7, 0x13, 0xb2, 0x4a, 0xb3, 0xe3, 0x4f, 0x83, 0x99, 0xeb, 0xcf, - 0xb3, 0x36, 0x88, 0x35, 0x2f, 0x8f, 0x56, 0xc6, 0x52, 0xb6, 0x5b, 0x50, 0x4a, 0xbd, 0x76, 0xee, - 0xe6, 0x0f, 0x03, 0xb1, 0x85, 0xb7, 0x56, 0xaf, 0x6a, 0xff, 0xa6, 0x40, 0x45, 0x66, 0xa7, 0xb3, - 0x77, 0x79, 0x8b, 0x9e, 0x80, 0x3e, 0x15, 0x55, 0xd3, 0x4b, 0x74, 0xf7, 0xdf, 0x8f, 0x9c, 0x4c, - 0x71, 0xe2, 0xdb, 0xae, 0xbf, 0xbc, 0xaa, 0x29, 0xaf, 0xae, 0x6a, 0xca, 0xdf, 0x57, 0x35, 0xe5, - 0xa7, 0xeb, 0x5a, 0xee, 0xd5, 0x75, 0x2d, 0xf7, 0xd7, 0x75, 0x2d, 0xf7, 0x5c, 0x8f, 0xff, 0x82, - 0x4d, 0x74, 0xf9, 0xdf, 0xe9, 0xf1, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x98, 0x09, 0x9b, 0xd5, - 0xa1, 0x09, 0x00, 0x00, + // 1150 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0x4f, 0x8f, 0xda, 0x46, + 0x14, 0xc7, 0x36, 0x18, 0xfc, 0x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60, 0x67, 0xe6, 0xdb, 0xcb, + 0xe9, 0x19, 0xe5, 0xc3, 0x90, 0xf8, 0xed, 0xbc, 0xe8, 0x11, 0xae, 0xa4, 0x81, 0x02, 0x63, 0xe8, + 0x73, 0xd8, 0x5f, 0x67, 0x9a, 0xd1, 0x05, 0x27, 0xcc, 0x32, 0xea, 0x5a, 0x03, 0xe1, 0x75, 0x81, + 0x87, 0x12, 0xdd, 0x72, 0x94, 0x14, 0x99, 0x05, 0x75, 0xad, 0xa1, 0x64, 0x8e, 0x92, 0x1f, 0x13, + 0xdc, 0xc2, 0x80, 0xb9, 0x1b, 0xdc, 0xf6, 0xfe, 0x37, 0xb7, 0x34, 0x70, 0xcd, 0x6d, 0x9d, 0x29, + 0xe1, 0x56, 0x8e, 0xb9, 0xa5, 0x70, 0xc6, 0x6d, 0xed, 0x98, 0x70, 0xab, 0xc4, 0xdc, 0x52, 0x38, + 0xe1, 0x76, 0x04, 0x10, 0x51, 0x46, 0xf9, 0xd8, 0x11, 0x7d, 0xa8, 0xca, 0x77, 0xe2, 0x93, 0x1d, + 0x5e, 0xeb, 0x71, 0x6a, 0x62, 0xe1, 0xdc, 0x75, 0x7d, 0x8e, 0x8d, 0x28, 0x15, 0xb7, 0xe7, 0x71, + 0xff, 0xea, 0x3c, 0xde, 0x07, 0x63, 0x1d, 0xb5, 0x7d, 0xdb, 0x8b, 0xa0, 0x3d, 0xeb, 0x0c, 0x4d, + 0x05, 0xe9, 0xa0, 0xf6, 0x07, 0xa6, 0x9a, 0xdd, 0x78, 0xad, 0x5d, 0x84, 0x82, 0x24, 0xde, 0x2e, + 0x03, 0x64, 0x53, 0x60, 0x3f, 0x00, 0xc8, 0x0e, 0x49, 0x0c, 0x62, 0x70, 0x7a, 0xca, 0x68, 0x3c, + 0xd9, 0xd7, 0x70, 0xa2, 0x09, 0x7c, 0x41, 0xfd, 0x39, 0x77, 0xe4, 0x40, 0x57, 0x70, 0xa2, 0xd9, + 0x7f, 0xa8, 0x00, 0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b9, 0x57, 0x97, + 0xb5, 0xdc, 0xdf, 0x97, 0xb5, 0xdc, 0x73, 0x3d, 0xfe, 0x5f, 0x36, 0xd1, 0xe5, 0x1f, 0xaa, 0x7b, + 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0x67, 0xa4, 0x22, 0x7f, 0xb6, 0x09, 0x00, 0x00, } func (m *MetricMetadata) Marshal() (dAtA []byte, err error) { diff --git a/pkg/store/storepb/prompb/types.proto b/pkg/store/storepb/prompb/types.proto index bf00b62e8f..c2d089b06b 100644 --- a/pkg/store/storepb/prompb/types.proto +++ b/pkg/store/storepb/prompb/types.proto @@ -172,6 +172,7 @@ message Chunk { UNKNOWN = 0; XOR = 1; HISTOGRAM = 2; + FLOAT_HISTOGRAM = 3; } Encoding type = 3; bytes data = 4; diff --git a/pkg/store/storepb/testutil/series.go b/pkg/store/storepb/testutil/series.go index a2d43b6c56..f4a6f100b9 100644 --- a/pkg/store/storepb/testutil/series.go +++ b/pkg/store/storepb/testutil/series.go @@ -120,6 +120,8 @@ func CreateHeadWithSeries(t testing.TB, j int, opts HeadGenOptions) (*tsdb.Head, appendFloatSamples(t, app, tsLabel, opts) case chunkenc.ValHistogram: appendHistogramSamples(t, app, tsLabel, opts) + case chunkenc.ValFloatHistogram: + appendFloatHistogramSamples(t, app, tsLabel, opts) } } testutil.Ok(t, app.Commit()) @@ -222,6 +224,39 @@ func appendHistogramSamples(t testing.TB, app storage.Appender, tsLabel int, opt } } +func appendFloatHistogramSamples(t testing.TB, app storage.Appender, tsLabel int, opts HeadGenOptions) { + sample := &histogram.FloatHistogram{ + ZeroThreshold: 0.01, + ZeroCount: 5.5, + Count: 15, + Sum: 11.5, + PositiveSpans: []histogram.Span{ + {Offset: -2, Length: 2}, + {Offset: 1, Length: 3}, + }, + PositiveBuckets: []float64{0.5, 0, 1.5, 2, 3.5}, + NegativeSpans: []histogram.Span{ + {Offset: 3, Length: 2}, + {Offset: 3, Length: 2}, + }, + NegativeBuckets: []float64{1.5, 0.5, 2.5, 3}, + } + + ref, err := app.AppendHistogram( + 0, + labels.FromStrings("foo", "bar", "i", fmt.Sprintf("%07d%s", tsLabel, LabelLongSuffix), "j", fmt.Sprintf("%v", tsLabel)), + int64(tsLabel)*opts.ScrapeInterval.Milliseconds(), + nil, + sample, + ) + testutil.Ok(t, err) + + for is := 1; is < opts.SamplesPerSeries; is++ { + _, err := app.AppendHistogram(ref, labels.EmptyLabels(), int64(tsLabel+is)*opts.ScrapeInterval.Milliseconds(), nil, sample) + testutil.Ok(t, err) + } +} + // SeriesServer is test gRPC storeAPI series server. type SeriesServer struct { // This field just exist to pseudo-implement the unused methods of the interface. diff --git a/pkg/testutil/e2eutil/prometheus.go b/pkg/testutil/e2eutil/prometheus.go index 9e02383342..453048a173 100644 --- a/pkg/testutil/e2eutil/prometheus.go +++ b/pkg/testutil/e2eutil/prometheus.go @@ -57,18 +57,37 @@ const ( PromAddrPlaceHolder = "PROMETHEUS_ADDRESS" ) -var histogramSample = histogram.Histogram{ - Schema: 0, - Count: 20, - Sum: -3.1415, - ZeroCount: 12, - ZeroThreshold: 0.001, - NegativeSpans: []histogram.Span{ - {Offset: 0, Length: 4}, - {Offset: 1, Length: 1}, - }, - NegativeBuckets: []int64{1, 2, -2, 1, -1}, -} +var ( + histogramSample = histogram.Histogram{ + Schema: 0, + Count: 20, + Sum: -3.1415, + ZeroCount: 12, + ZeroThreshold: 0.001, + NegativeSpans: []histogram.Span{ + {Offset: 0, Length: 4}, + {Offset: 1, Length: 1}, + }, + NegativeBuckets: []int64{1, 2, -2, 1, -1}, + } + + floatHistogramSample = histogram.FloatHistogram{ + ZeroThreshold: 0.01, + ZeroCount: 5.5, + Count: 15, + Sum: 11.5, + PositiveSpans: []histogram.Span{ + {Offset: -2, Length: 2}, + {Offset: 1, Length: 3}, + }, + PositiveBuckets: []float64{0.5, 0, 1.5, 2, 3.5}, + NegativeSpans: []histogram.Span{ + {Offset: 3, Length: 2}, + {Offset: 3, Length: 2}, + }, + NegativeBuckets: []float64{1.5, 0.5, 2.5, 3}, + } +) func PrometheusBinary() string { return "prometheus-" + defaultPrometheusVersion @@ -463,6 +482,22 @@ func CreateHistogramBlockWithDelay( return createBlockWithDelay(ctx, dir, series, numSamples, mint, maxt, blockDelay, extLset, resolution, hashFunc, chunkenc.ValHistogram) } +// CreateFloatHistogramBlockWithDelay writes a block with the given float native histogram series and numSamples samples each. +// Samples will be in the time range [mint, maxt). +func CreateFloatHistogramBlockWithDelay( + ctx context.Context, + dir string, + series []labels.Labels, + numSamples int, + mint, maxt int64, + blockDelay time.Duration, + extLset labels.Labels, + resolution int64, + hashFunc metadata.HashFunc, +) (id ulid.ULID, err error) { + return createBlockWithDelay(ctx, dir, series, numSamples, mint, maxt, blockDelay, extLset, resolution, hashFunc, chunkenc.ValFloatHistogram) +} + func createBlockWithDelay(ctx context.Context, dir string, series []labels.Labels, numSamples int, mint int64, maxt int64, blockDelay time.Duration, extLset labels.Labels, resolution int64, hashFunc metadata.HashFunc, samplesType chunkenc.ValueType) (ulid.ULID, error) { blockID, err := createBlock(ctx, dir, series, numSamples, mint, maxt, extLset, resolution, false, hashFunc, samplesType) if err != nil { @@ -545,6 +580,8 @@ func createBlock( randMutex.Unlock() } else if sampleType == chunkenc.ValHistogram { _, err = app.AppendHistogram(0, lset, t, &histogramSample, nil) + } else if sampleType == chunkenc.ValFloatHistogram { + _, err = app.AppendHistogram(0, lset, t, nil, &floatHistogramSample) } if err != nil { if rerr := app.Rollback(); rerr != nil { diff --git a/test/e2e/store_gateway_test.go b/test/e2e/store_gateway_test.go index a28edbaafa..e13f79a495 100644 --- a/test/e2e/store_gateway_test.go +++ b/test/e2e/store_gateway_test.go @@ -96,11 +96,13 @@ metafile_content_ttl: 0s`, memcached.InternalEndpoint("memcached")) floatSeries := []labels.Labels{labels.FromStrings("a", "1", "b", "2")} nativeHistogramSeries := []labels.Labels{labels.FromStrings("a", "1", "b", "3")} + floatHistogramSeries := []labels.Labels{labels.FromStrings("a", "1", "b", "4")} extLset := labels.FromStrings("ext1", "value1", "replica", "1") extLset2 := labels.FromStrings("ext1", "value1", "replica", "2") extLset3 := labels.FromStrings("ext1", "value2", "replica", "3") extLset4 := labels.FromStrings("ext1", "value1", "replica", "3") extLset5 := labels.FromStrings("ext1", "value3", "replica", "1") + extLset6 := labels.FromStrings("ext1", "value3", "replica", "2") ctx, cancel := context.WithTimeout(context.Background(), 2*time.Minute) t.Cleanup(cancel) @@ -116,6 +118,8 @@ metafile_content_ttl: 0s`, memcached.InternalEndpoint("memcached")) testutil.Ok(t, err) id5, err := e2eutil.CreateHistogramBlockWithDelay(ctx, dir, nativeHistogramSeries, 10, timestamp.FromTime(now), timestamp.FromTime(now.Add(2*time.Hour)), 30*time.Minute, extLset5, 0, metadata.NoneFunc) testutil.Ok(t, err) + id6, err := e2eutil.CreateFloatHistogramBlockWithDelay(ctx, dir, floatHistogramSeries, 10, timestamp.FromTime(now), timestamp.FromTime(now.Add(2*time.Hour)), 30*time.Minute, extLset6, 0, metadata.NoneFunc) + testutil.Ok(t, err) l := log.NewLogfmtLogger(os.Stdout) bkt, err := s3.NewBucketWithConfig(l, e2ethanos.NewS3Config(bucket, m.Endpoint("http"), m.Dir()), "test-feed") @@ -126,13 +130,14 @@ metafile_content_ttl: 0s`, memcached.InternalEndpoint("memcached")) testutil.Ok(t, objstore.UploadDir(ctx, l, bkt, path.Join(dir, id3.String()), id3.String())) testutil.Ok(t, objstore.UploadDir(ctx, l, bkt, path.Join(dir, id4.String()), id4.String())) testutil.Ok(t, objstore.UploadDir(ctx, l, bkt, path.Join(dir, id5.String()), id5.String())) + testutil.Ok(t, objstore.UploadDir(ctx, l, bkt, path.Join(dir, id6.String()), id6.String())) // Wait for store to sync blocks. - // thanos_blocks_meta_synced: 2x loadedMeta 1x labelExcludedMeta 1x TooFreshMeta. - testutil.Ok(t, s1.WaitSumMetrics(e2emon.Equals(5), "thanos_blocks_meta_synced")) + // thanos_blocks_meta_synced: 4x loadedMeta 1x labelExcludedMeta 1x TooFreshMeta. + testutil.Ok(t, s1.WaitSumMetrics(e2emon.Equals(6), "thanos_blocks_meta_synced")) testutil.Ok(t, s1.WaitSumMetrics(e2emon.Equals(0), "thanos_blocks_meta_sync_failures_total")) - testutil.Ok(t, s1.WaitSumMetrics(e2emon.Equals(3), "thanos_bucket_store_blocks_loaded")) + testutil.Ok(t, s1.WaitSumMetrics(e2emon.Equals(4), "thanos_bucket_store_blocks_loaded")) testutil.Ok(t, s1.WaitSumMetrics(e2emon.Equals(0), "thanos_bucket_store_block_drops_total")) testutil.Ok(t, s1.WaitSumMetrics(e2emon.Equals(0), "thanos_bucket_store_block_load_failures_total")) @@ -161,13 +166,19 @@ metafile_content_ttl: 0s`, memcached.InternalEndpoint("memcached")) "ext1": "value3", "replica": "1", }, + { + "a": "1", + "b": "4", + "ext1": "value3", + "replica": "2", + }, }, ) // 2 x postings, 3 x series, 2 x chunks. - testutil.Ok(t, s1.WaitSumMetrics(e2emon.Equals(9), "thanos_bucket_store_series_data_touched")) - testutil.Ok(t, s1.WaitSumMetrics(e2emon.Equals(9), "thanos_bucket_store_series_data_fetched")) - testutil.Ok(t, s1.WaitSumMetrics(e2emon.Equals(3), "thanos_bucket_store_series_blocks_queried")) + testutil.Ok(t, s1.WaitSumMetrics(e2emon.Equals(12), "thanos_bucket_store_series_data_touched")) + testutil.Ok(t, s1.WaitSumMetrics(e2emon.Equals(12), "thanos_bucket_store_series_data_fetched")) + testutil.Ok(t, s1.WaitSumMetrics(e2emon.Equals(4), "thanos_bucket_store_series_blocks_queried")) tenant1Opts := []e2emon.MetricsOption{ e2emon.WithLabelMatchers(matchers.MustNewMatcher(matchers.MatchEqual, tenancy.MetricLabel, "test-tenant-1")), @@ -175,9 +186,9 @@ metafile_content_ttl: 0s`, memcached.InternalEndpoint("memcached")) } // Test per tenant store metrics - testutil.Ok(t, s1.WaitSumMetricsWithOptions(e2emon.Equals(9), []string{"thanos_bucket_store_series_data_touched"}, tenant1Opts...)) - testutil.Ok(t, s1.WaitSumMetricsWithOptions(e2emon.Equals(9), []string{"thanos_bucket_store_series_data_fetched"}, tenant1Opts...)) - testutil.Ok(t, s1.WaitSumMetricsWithOptions(e2emon.Equals(3), []string{"thanos_bucket_store_series_blocks_queried"}, tenant1Opts...)) + testutil.Ok(t, s1.WaitSumMetricsWithOptions(e2emon.Equals(12), []string{"thanos_bucket_store_series_data_touched"}, tenant1Opts...)) + testutil.Ok(t, s1.WaitSumMetricsWithOptions(e2emon.Equals(12), []string{"thanos_bucket_store_series_data_fetched"}, tenant1Opts...)) + testutil.Ok(t, s1.WaitSumMetricsWithOptions(e2emon.Equals(4), []string{"thanos_bucket_store_series_blocks_queried"}, tenant1Opts...)) queryAndAssertSeries(t, ctx, q.Endpoint("http"), func() string { return testQuery }, time.Now, promclient.QueryOptions{ @@ -195,6 +206,11 @@ metafile_content_ttl: 0s`, memcached.InternalEndpoint("memcached")) "b": "3", "ext1": "value3", }, + { + "a": "1", + "b": "4", + "ext1": "value3", + }, }, ) @@ -202,30 +218,30 @@ metafile_content_ttl: 0s`, memcached.InternalEndpoint("memcached")) e2emon.WithLabelMatchers(matchers.MustNewMatcher(matchers.MatchEqual, tenancy.MetricLabel, "test-tenant-2")), e2emon.WaitMissingMetrics(), } - testutil.Ok(t, s1.WaitSumMetrics(e2emon.Equals(18), "thanos_bucket_store_series_data_touched")) - testutil.Ok(t, s1.WaitSumMetrics(e2emon.Equals(12), "thanos_bucket_store_series_data_fetched")) - testutil.Ok(t, s1.WaitSumMetrics(e2emon.Equals(3+3), "thanos_bucket_store_series_blocks_queried")) + testutil.Ok(t, s1.WaitSumMetrics(e2emon.Equals(24), "thanos_bucket_store_series_data_touched")) + testutil.Ok(t, s1.WaitSumMetrics(e2emon.Equals(16), "thanos_bucket_store_series_data_fetched")) + testutil.Ok(t, s1.WaitSumMetrics(e2emon.Equals(4+4), "thanos_bucket_store_series_blocks_queried")) // Test tenant some tenant specific store metrics - testutil.Ok(t, s1.WaitSumMetricsWithOptions(e2emon.Equals(9), []string{"thanos_bucket_store_series_data_touched"}, tenant2Opts...)) - testutil.Ok(t, s1.WaitSumMetricsWithOptions(e2emon.Equals(3), []string{"thanos_bucket_store_series_data_fetched"}, tenant2Opts...)) - testutil.Ok(t, s1.WaitSumMetricsWithOptions(e2emon.Equals(3), []string{"thanos_bucket_store_series_blocks_queried"}, tenant2Opts...)) + testutil.Ok(t, s1.WaitSumMetricsWithOptions(e2emon.Equals(12), []string{"thanos_bucket_store_series_data_touched"}, tenant2Opts...)) + testutil.Ok(t, s1.WaitSumMetricsWithOptions(e2emon.Equals(4), []string{"thanos_bucket_store_series_data_fetched"}, tenant2Opts...)) + testutil.Ok(t, s1.WaitSumMetricsWithOptions(e2emon.Equals(4), []string{"thanos_bucket_store_series_blocks_queried"}, tenant2Opts...)) // the first tenants metrics should be unaffected by the additional query - testutil.Ok(t, s1.WaitSumMetricsWithOptions(e2emon.Equals(9), []string{"thanos_bucket_store_series_data_touched"}, tenant1Opts...)) - testutil.Ok(t, s1.WaitSumMetricsWithOptions(e2emon.Equals(9), []string{"thanos_bucket_store_series_data_fetched"}, tenant1Opts...)) - testutil.Ok(t, s1.WaitSumMetricsWithOptions(e2emon.Equals(3), []string{"thanos_bucket_store_series_blocks_queried"}, tenant1Opts...)) + testutil.Ok(t, s1.WaitSumMetricsWithOptions(e2emon.Equals(12), []string{"thanos_bucket_store_series_data_touched"}, tenant1Opts...)) + testutil.Ok(t, s1.WaitSumMetricsWithOptions(e2emon.Equals(12), []string{"thanos_bucket_store_series_data_fetched"}, tenant1Opts...)) + testutil.Ok(t, s1.WaitSumMetricsWithOptions(e2emon.Equals(4), []string{"thanos_bucket_store_series_blocks_queried"}, tenant1Opts...)) }) t.Run("remove meta.json from id1 block", func(t *testing.T) { testutil.Ok(t, bkt.Delete(ctx, filepath.Join(id1.String(), block.MetaFilename))) // Wait for store to sync blocks. - // thanos_blocks_meta_synced: 1x loadedMeta 1x labelExcludedMeta 1x TooFreshMeta 1x noMeta. - testutil.Ok(t, s1.WaitSumMetrics(e2emon.Equals(5), "thanos_blocks_meta_synced")) + // thanos_blocks_meta_synced: 3x loadedMeta 1x labelExcludedMeta 1x TooFreshMeta 1x noMeta. + testutil.Ok(t, s1.WaitSumMetrics(e2emon.Equals(6), "thanos_blocks_meta_synced")) testutil.Ok(t, s1.WaitSumMetrics(e2emon.Equals(0), "thanos_blocks_meta_sync_failures_total")) - testutil.Ok(t, s1.WaitSumMetrics(e2emon.Equals(2), "thanos_bucket_store_blocks_loaded")) + testutil.Ok(t, s1.WaitSumMetrics(e2emon.Equals(3), "thanos_bucket_store_blocks_loaded")) testutil.Ok(t, s1.WaitSumMetrics(e2emon.Equals(1), "thanos_bucket_store_block_drops_total")) testutil.Ok(t, s1.WaitSumMetrics(e2emon.Equals(0), "thanos_bucket_store_block_load_failures_total")) @@ -247,9 +263,15 @@ metafile_content_ttl: 0s`, memcached.InternalEndpoint("memcached")) "ext1": "value3", "replica": "1", }, + { + "a": "1", + "b": "4", + "ext1": "value3", + "replica": "2", + }, }, ) - testutil.Ok(t, s1.WaitSumMetrics(e2emon.Equals(4+4), "thanos_bucket_store_series_blocks_queried")) + testutil.Ok(t, s1.WaitSumMetrics(e2emon.Equals(8+3), "thanos_bucket_store_series_blocks_queried")) }) t.Run("upload block id5, similar to id1", func(t *testing.T) { id5, err := e2eutil.CreateBlockWithBlockDelay(ctx, dir, floatSeries, 10, timestamp.FromTime(now), timestamp.FromTime(now.Add(2*time.Hour)), 30*time.Minute, extLset4, 0, metadata.NoneFunc) @@ -257,11 +279,11 @@ metafile_content_ttl: 0s`, memcached.InternalEndpoint("memcached")) testutil.Ok(t, objstore.UploadDir(ctx, l, bkt, path.Join(dir, id5.String()), id5.String())) // Wait for store to sync blocks. - // thanos_blocks_meta_synced: 2x loadedMeta 1x labelExcludedMeta 1x TooFreshMeta 1x noMeta. - testutil.Ok(t, s1.WaitSumMetrics(e2emon.Equals(5), "thanos_blocks_meta_synced")) + // thanos_blocks_meta_synced: 4x loadedMeta 1x labelExcludedMeta 1x TooFreshMeta 1x noMeta. + testutil.Ok(t, s1.WaitSumMetrics(e2emon.Equals(7), "thanos_blocks_meta_synced")) testutil.Ok(t, s1.WaitSumMetrics(e2emon.Equals(0), "thanos_blocks_meta_sync_failures_total")) - testutil.Ok(t, s1.WaitSumMetrics(e2emon.Equals(2), "thanos_bucket_store_blocks_loaded")) + testutil.Ok(t, s1.WaitSumMetrics(e2emon.Equals(4), "thanos_bucket_store_blocks_loaded")) testutil.Ok(t, s1.WaitSumMetrics(e2emon.Equals(1), "thanos_bucket_store_block_drops_total")) testutil.Ok(t, s1.WaitSumMetrics(e2emon.Equals(0), "thanos_bucket_store_block_load_failures_total")) @@ -288,19 +310,25 @@ metafile_content_ttl: 0s`, memcached.InternalEndpoint("memcached")) "ext1": "value3", "replica": "1", }, + { + "a": "1", + "b": "4", + "ext1": "value3", + "replica": "2", + }, }, ) - testutil.Ok(t, s1.WaitSumMetrics(e2emon.Equals(11+2), "thanos_bucket_store_series_blocks_queried")) + testutil.Ok(t, s1.WaitSumMetrics(e2emon.Equals(11+4), "thanos_bucket_store_series_blocks_queried")) }) t.Run("delete whole id2 block #yolo", func(t *testing.T) { testutil.Ok(t, block.Delete(ctx, l, bkt, id2)) // Wait for store to sync blocks. // thanos_blocks_meta_synced: 1x loadedMeta 1x labelExcludedMeta 1x TooFreshMeta 1x noMeta. - testutil.Ok(t, s1.WaitSumMetrics(e2emon.Equals(5), "thanos_blocks_meta_synced")) + testutil.Ok(t, s1.WaitSumMetrics(e2emon.Equals(6), "thanos_blocks_meta_synced")) testutil.Ok(t, s1.WaitSumMetrics(e2emon.Equals(0), "thanos_blocks_meta_sync_failures_total")) - testutil.Ok(t, s1.WaitSumMetrics(e2emon.Equals(2), "thanos_bucket_store_blocks_loaded")) + testutil.Ok(t, s1.WaitSumMetrics(e2emon.Equals(3), "thanos_bucket_store_blocks_loaded")) testutil.Ok(t, s1.WaitSumMetrics(e2emon.Equals(1+1), "thanos_bucket_store_block_drops_total")) testutil.Ok(t, s1.WaitSumMetrics(e2emon.Equals(0), "thanos_bucket_store_block_load_failures_total")) @@ -321,9 +349,15 @@ metafile_content_ttl: 0s`, memcached.InternalEndpoint("memcached")) "ext1": "value3", "replica": "1", }, + { + "a": "1", + "b": "4", + "ext1": "value3", + "replica": "2", + }, }, ) - testutil.Ok(t, s1.WaitSumMetrics(e2emon.Equals(14+1), "thanos_bucket_store_series_blocks_queried")) + testutil.Ok(t, s1.WaitSumMetrics(e2emon.Equals(15+3), "thanos_bucket_store_series_blocks_queried")) }) t.Run("negative offset should work", func(t *testing.T) { @@ -344,9 +378,15 @@ metafile_content_ttl: 0s`, memcached.InternalEndpoint("memcached")) "ext1": "value3", "replica": "1", }, + { + "a": "1", + "b": "4", + "ext1": "value3", + "replica": "2", + }, }, ) - testutil.Ok(t, s1.WaitSumMetrics(e2emon.Equals(15+2), "thanos_bucket_store_series_blocks_queried")) + testutil.Ok(t, s1.WaitSumMetrics(e2emon.Equals(18+3), "thanos_bucket_store_series_blocks_queried")) }) // TODO(khyati) Let's add some case for compaction-meta.json once the PR will be merged: https://github.com/thanos-io/thanos/pull/2136.