From e3d587a7ea4cf5254f292f962fe36e9efa8bfccc Mon Sep 17 00:00:00 2001 From: Douglas Camata <159076+douglascamata@users.noreply.github.com> Date: Tue, 25 Oct 2022 16:42:47 +0200 Subject: [PATCH 1/6] Add a few objectives for Store's data touched/fetched The intent is to provide some metrics that will help inform users when setting values for the flags `store.grpc.series-sample-limit` and `store.grpc.touched-series-limit`. Signed-off-by: Douglas Camata <159076+douglascamata@users.noreply.github.com> --- pkg/store/bucket.go | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/pkg/store/bucket.go b/pkg/store/bucket.go index 01dc32e498..8d36acd3dc 100644 --- a/pkg/store/bucket.go +++ b/pkg/store/bucket.go @@ -168,21 +168,25 @@ func newBucketStoreMetrics(reg prometheus.Registerer) *bucketStoreMetrics { }) m.seriesDataTouched = promauto.With(reg).NewSummaryVec(prometheus.SummaryOpts{ - Name: "thanos_bucket_store_series_data_touched", - Help: "How many items of a data type in a block were touched for a single series request.", + Name: "thanos_bucket_store_series_data_touched", + Help: "How many items of a data type in a block were touched for a single series request.", + Objectives: map[float64]float64{0.50: 0.1, 0.95: 0.1, 0.99: 0.001}, }, []string{"data_type"}) m.seriesDataFetched = promauto.With(reg).NewSummaryVec(prometheus.SummaryOpts{ - Name: "thanos_bucket_store_series_data_fetched", - Help: "How many items of a data type in a block were fetched for a single series request.", + Name: "thanos_bucket_store_series_data_fetched", + Help: "How many items of a data type in a block were fetched for a single series request.", + Objectives: map[float64]float64{0.50: 0.1, 0.95: 0.1, 0.99: 0.001}, }, []string{"data_type"}) m.seriesDataSizeTouched = promauto.With(reg).NewSummaryVec(prometheus.SummaryOpts{ - Name: "thanos_bucket_store_series_data_size_touched_bytes", - Help: "Size of all items of a data type in a block were touched for a single series request.", + Name: "thanos_bucket_store_series_data_size_touched_bytes", + Help: "Size of all items of a data type in a block were touched for a single series request.", + Objectives: map[float64]float64{0.50: 0.1, 0.95: 0.1, 0.99: 0.001}, }, []string{"data_type"}) m.seriesDataSizeFetched = promauto.With(reg).NewSummaryVec(prometheus.SummaryOpts{ - Name: "thanos_bucket_store_series_data_size_fetched_bytes", - Help: "Size of all items of a data type in a block were fetched for a single series request.", + Name: "thanos_bucket_store_series_data_size_fetched_bytes", + Help: "Size of all items of a data type in a block were fetched for a single series request.", + Objectives: map[float64]float64{0.50: 0.1, 0.95: 0.1, 0.99: 0.001}, }, []string{"data_type"}) m.seriesBlocksQueried = promauto.With(reg).NewSummary(prometheus.SummaryOpts{ @@ -200,8 +204,9 @@ func newBucketStoreMetrics(reg prometheus.Registerer) *bucketStoreMetrics { Buckets: []float64{0.001, 0.01, 0.1, 0.3, 0.6, 1, 3, 6, 9, 20, 30, 60, 90, 120}, }) m.resultSeriesCount = promauto.With(reg).NewSummary(prometheus.SummaryOpts{ - Name: "thanos_bucket_store_series_result_series", - Help: "Number of series observed in the final result of a query.", + Name: "thanos_bucket_store_series_result_series", + Help: "Number of series observed in the final result of a query.", + Objectives: map[float64]float64{0.50: 0.1, 0.95: 0.1, 0.99: 0.001}, }) m.chunkSizeBytes = promauto.With(reg).NewHistogram(prometheus.HistogramOpts{ From a4cea430eb865b7d72aa93310f373ae40a9f1d41 Mon Sep 17 00:00:00 2001 From: Douglas Camata <159076+douglascamata@users.noreply.github.com> Date: Tue, 25 Oct 2022 17:25:13 +0200 Subject: [PATCH 2/6] Update CHANGELOG Signed-off-by: Douglas Camata <159076+douglascamata@users.noreply.github.com> --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bd2f15ae02..18920e4d78 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,8 @@ We use *breaking :warning:* to mark changes that are not backward compatible (re ### Changed +- [#5819](https://github.com/thanos-io/thanos/pull/5819) Store: Add a few objectives for Store's data touched/fetched amount and sizes. They are: 50, 95, and 99 quantiles. + ## [v0.29.0](https://github.com/thanos-io/thanos/tree/release-0.29) - Release in progress ### Fixed From ba6cc1406ecd5b23922099fd5b45136c6fb6164f Mon Sep 17 00:00:00 2001 From: Douglas Camata <159076+douglascamata@users.noreply.github.com> Date: Wed, 26 Oct 2022 16:39:59 +0200 Subject: [PATCH 3/6] Update some metric's help text Co-authored-by: Moad Zardab Signed-off-by: Douglas Camata <159076+douglascamata@users.noreply.github.com> --- pkg/store/bucket.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/store/bucket.go b/pkg/store/bucket.go index 8d36acd3dc..8760ce8b76 100644 --- a/pkg/store/bucket.go +++ b/pkg/store/bucket.go @@ -169,23 +169,23 @@ func newBucketStoreMetrics(reg prometheus.Registerer) *bucketStoreMetrics { m.seriesDataTouched = promauto.With(reg).NewSummaryVec(prometheus.SummaryOpts{ Name: "thanos_bucket_store_series_data_touched", - Help: "How many items of a data type in a block were touched for a single series request.", + Help: "Number of series touched to fulfil a single Store API series request.", Objectives: map[float64]float64{0.50: 0.1, 0.95: 0.1, 0.99: 0.001}, }, []string{"data_type"}) m.seriesDataFetched = promauto.With(reg).NewSummaryVec(prometheus.SummaryOpts{ Name: "thanos_bucket_store_series_data_fetched", - Help: "How many items of a data type in a block were fetched for a single series request.", + Help: "Number of series retrieved to fulfil a single Store API series request.", Objectives: map[float64]float64{0.50: 0.1, 0.95: 0.1, 0.99: 0.001}, }, []string{"data_type"}) m.seriesDataSizeTouched = promauto.With(reg).NewSummaryVec(prometheus.SummaryOpts{ Name: "thanos_bucket_store_series_data_size_touched_bytes", - Help: "Size of all items of a data type in a block were touched for a single series request.", + Help: "Total size of series touched to fulfil a single Store API series request in Bytes.", Objectives: map[float64]float64{0.50: 0.1, 0.95: 0.1, 0.99: 0.001}, }, []string{"data_type"}) m.seriesDataSizeFetched = promauto.With(reg).NewSummaryVec(prometheus.SummaryOpts{ Name: "thanos_bucket_store_series_data_size_fetched_bytes", - Help: "Size of all items of a data type in a block were fetched for a single series request.", + Help: "Total size of series fetched to fulfil a single Store API series request in Bytes.", Objectives: map[float64]float64{0.50: 0.1, 0.95: 0.1, 0.99: 0.001}, }, []string{"data_type"}) From 6ee91bfaa80b8644148ba127e25d3fc7be256490 Mon Sep 17 00:00:00 2001 From: Douglas Camata <159076+douglascamata@users.noreply.github.com> Date: Wed, 26 Oct 2022 16:41:36 +0200 Subject: [PATCH 4/6] Remove quantiles from redundant metric Signed-off-by: Douglas Camata <159076+douglascamata@users.noreply.github.com> --- pkg/store/bucket.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkg/store/bucket.go b/pkg/store/bucket.go index 8760ce8b76..8b3cb6af80 100644 --- a/pkg/store/bucket.go +++ b/pkg/store/bucket.go @@ -204,9 +204,8 @@ func newBucketStoreMetrics(reg prometheus.Registerer) *bucketStoreMetrics { Buckets: []float64{0.001, 0.01, 0.1, 0.3, 0.6, 1, 3, 6, 9, 20, 30, 60, 90, 120}, }) m.resultSeriesCount = promauto.With(reg).NewSummary(prometheus.SummaryOpts{ - Name: "thanos_bucket_store_series_result_series", - Help: "Number of series observed in the final result of a query.", - Objectives: map[float64]float64{0.50: 0.1, 0.95: 0.1, 0.99: 0.001}, + Name: "thanos_bucket_store_series_result_series", + Help: "Number of series observed in the final result of a query.", }) m.chunkSizeBytes = promauto.With(reg).NewHistogram(prometheus.HistogramOpts{ From f05d8718a886a7702013af3a58a22f60b37f4cc0 Mon Sep 17 00:00:00 2001 From: Douglas Camata <159076+douglascamata@users.noreply.github.com> Date: Thu, 27 Oct 2022 11:14:06 +0200 Subject: [PATCH 5/6] Fix spelling Signed-off-by: Douglas Camata <159076+douglascamata@users.noreply.github.com> --- pkg/store/bucket.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/store/bucket.go b/pkg/store/bucket.go index 8b3cb6af80..c0799ddd0d 100644 --- a/pkg/store/bucket.go +++ b/pkg/store/bucket.go @@ -169,23 +169,23 @@ func newBucketStoreMetrics(reg prometheus.Registerer) *bucketStoreMetrics { m.seriesDataTouched = promauto.With(reg).NewSummaryVec(prometheus.SummaryOpts{ Name: "thanos_bucket_store_series_data_touched", - Help: "Number of series touched to fulfil a single Store API series request.", + Help: "Number of series touched to fulfill a single Store API series request.", Objectives: map[float64]float64{0.50: 0.1, 0.95: 0.1, 0.99: 0.001}, }, []string{"data_type"}) m.seriesDataFetched = promauto.With(reg).NewSummaryVec(prometheus.SummaryOpts{ Name: "thanos_bucket_store_series_data_fetched", - Help: "Number of series retrieved to fulfil a single Store API series request.", + Help: "Number of series retrieved to fulfill a single Store API series request.", Objectives: map[float64]float64{0.50: 0.1, 0.95: 0.1, 0.99: 0.001}, }, []string{"data_type"}) m.seriesDataSizeTouched = promauto.With(reg).NewSummaryVec(prometheus.SummaryOpts{ Name: "thanos_bucket_store_series_data_size_touched_bytes", - Help: "Total size of series touched to fulfil a single Store API series request in Bytes.", + Help: "Total size of series touched to fulfill a single Store API series request in Bytes.", Objectives: map[float64]float64{0.50: 0.1, 0.95: 0.1, 0.99: 0.001}, }, []string{"data_type"}) m.seriesDataSizeFetched = promauto.With(reg).NewSummaryVec(prometheus.SummaryOpts{ Name: "thanos_bucket_store_series_data_size_fetched_bytes", - Help: "Total size of series fetched to fulfil a single Store API series request in Bytes.", + Help: "Total size of series fetched to fulfill a single Store API series request in Bytes.", Objectives: map[float64]float64{0.50: 0.1, 0.95: 0.1, 0.99: 0.001}, }, []string{"data_type"}) From 616ff396135fcf7c2c0895c4c5328ad8426a8fe7 Mon Sep 17 00:00:00 2001 From: Douglas Camata <159076+douglascamata@users.noreply.github.com> Date: Fri, 28 Oct 2022 11:53:34 +0200 Subject: [PATCH 6/6] Fix some metric help texts Signed-off-by: Douglas Camata <159076+douglascamata@users.noreply.github.com> --- pkg/store/bucket.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/store/bucket.go b/pkg/store/bucket.go index eb8ceecda9..973642d06d 100644 --- a/pkg/store/bucket.go +++ b/pkg/store/bucket.go @@ -169,23 +169,23 @@ func newBucketStoreMetrics(reg prometheus.Registerer) *bucketStoreMetrics { m.seriesDataTouched = promauto.With(reg).NewSummaryVec(prometheus.SummaryOpts{ Name: "thanos_bucket_store_series_data_touched", - Help: "Number of series touched to fulfill a single Store API series request.", + Help: "Number of items of a data type touched to fulfill a single Store API series request.", Objectives: map[float64]float64{0.50: 0.1, 0.95: 0.1, 0.99: 0.001}, }, []string{"data_type"}) m.seriesDataFetched = promauto.With(reg).NewSummaryVec(prometheus.SummaryOpts{ Name: "thanos_bucket_store_series_data_fetched", - Help: "Number of series retrieved to fulfill a single Store API series request.", + Help: "Number of items of a data type retrieved to fulfill a single Store API series request.", Objectives: map[float64]float64{0.50: 0.1, 0.95: 0.1, 0.99: 0.001}, }, []string{"data_type"}) m.seriesDataSizeTouched = promauto.With(reg).NewSummaryVec(prometheus.SummaryOpts{ Name: "thanos_bucket_store_series_data_size_touched_bytes", - Help: "Total size of series touched to fulfill a single Store API series request in Bytes.", + Help: "Total size of items of a data type touched to fulfill a single Store API series request in Bytes.", Objectives: map[float64]float64{0.50: 0.1, 0.95: 0.1, 0.99: 0.001}, }, []string{"data_type"}) m.seriesDataSizeFetched = promauto.With(reg).NewSummaryVec(prometheus.SummaryOpts{ Name: "thanos_bucket_store_series_data_size_fetched_bytes", - Help: "Total size of series fetched to fulfill a single Store API series request in Bytes.", + Help: "Total size of items of a data type fetched to fulfill a single Store API series request in Bytes.", Objectives: map[float64]float64{0.50: 0.1, 0.95: 0.1, 0.99: 0.001}, }, []string{"data_type"})