Skip to content

Commit 2f7ecc9

Browse files
committed
add component labels for store-gateway and store-queryable
Signed-off-by: SungJin1212 <tjdwls1201@gmail.com>
1 parent 5b1f24d commit 2f7ecc9

3 files changed

Lines changed: 13 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
* [ENHANCEMENT] Distributor: Added `cortex_distributor_received_histogram_buckets` metric to track number of buckets in received native histogram samples before validation, per user. #7569
3939
* [ENHANCEMENT] Distributor: Add `WrappedHistogram` with configurable size limit (`-validation.max-native-histogram-size-bytes`) to cap native histogram protobuf size before unmarshalling. #7570
4040
* [ENHANCEMENT] Ingester: Add lazy regex evaluation on head postings cache miss. Defers expensive regex matchers on high-cardinality labels to per-series filtering when a selective equality matcher already narrows the result set. Configured via `-blocks-storage.expanded_postings_cache.head.lazy-matcher-max-cardinality` (disabled by default). #7553
41-
* [ENHANCEMENT] Store Gateway: Resolve the parquet shard count from the bucket index instead of reading the converter mark for each block, reducing object storage calls when the bucket index is enabled. #7648
41+
* [ENHANCEMENT] Store Gateway: Resolve the parquet shard count from the bucket index instead of reading the converter mark for each block, reducing object storage calls when the bucket index is enabled. A `component` label is added to the bucket index loader metrics to distinguish store-queryable and store-gateway. #7648
4242
* [ENHANCEMENT] Query Frontend: Improve the slow query log with `source`, `user_agent`, `engine_type`, `block_store_type`, and query stats fields to aid slow query diagnosis. #7601
4343
* [ENHANCEMENT] Ring: Add ring metric to count number of duplicate tokens. #7626
4444
* [ENHANCEMENT] Metrics: Add native histogram support to all remaining production histograms, enabling dual-format (classic + native) exposition across all Cortex components. #7636

integration/parquet_querier_test.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -619,9 +619,20 @@ func TestParquetMultiShardQuery(t *testing.T) {
619619
if tc.viaStoreGateway {
620620
require.NoError(t, cortex.WaitSumMetricsWithOptions(e2e.Greater(0), []string{"cortex_querier_storegateway_instances_hit_per_query"}, e2e.WithMetricCount, e2e.SkipMissingMetrics))
621621
require.NoError(t, cortex.WaitSumMetricsWithOptions(e2e.Greater(0), []string{"cortex_querier_blocks_consistency_checks_total"}, e2e.SkipMissingMetrics))
622+
// The store-gateway parquet bucket store resolves the shard count via the
623+
// bucket index loader, which is tagged with component="store-gateway".
624+
if tc.extraStoreGateways == 0 {
625+
// Only assert on the single binary when there are no extra replicas, since
626+
// with replication the query may be served by another store-gateway.
627+
require.NoError(t, cortex.WaitSumMetricsWithOptions(e2e.Greater(0), []string{"cortex_bucket_index_loads_total"}, e2e.WithLabelMatchers(
628+
labels.MustNewMatcher(labels.MatchEqual, "component", "store-gateway"))))
629+
}
622630
} else {
623631
require.NoError(t, cortex.WaitSumMetricsWithOptions(e2e.Greater(0), []string{"cortex_parquet_queryable_blocks_queried_total"}, e2e.WithLabelMatchers(
624632
labels.MustNewMatcher(labels.MatchEqual, "type", "parquet"))))
633+
// The querier's bucket index loader is tagged with component="store-queryable".
634+
require.NoError(t, cortex.WaitSumMetricsWithOptions(e2e.Greater(0), []string{"cortex_bucket_index_loads_total"}, e2e.WithLabelMatchers(
635+
labels.MustNewMatcher(labels.MatchEqual, "component", "store-queryable"))))
625636
}
626637
})
627638
}

pkg/querier/blocks_store_queryable.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ func NewBlocksStoreQueryableFromConfig(querierCfg Config, gatewayCfg storegatewa
210210
MaxStalePeriod: storageCfg.BucketStore.BucketIndex.MaxStalePeriod,
211211
IgnoreDeletionMarksDelay: storageCfg.BucketStore.IgnoreDeletionMarksDelay,
212212
IgnoreBlocksWithin: storageCfg.BucketStore.IgnoreBlocksWithin,
213-
}, bucketClient, limits, logger, reg)
213+
}, bucketClient, limits, logger, extprom.WrapRegistererWith(prometheus.Labels{"component": "store-queryable"}, reg))
214214
} else {
215215
usersScanner, err := users.NewScanner(storageCfg.UsersScanner, bucketClient, logger, extprom.WrapRegistererWith(prometheus.Labels{"component": "querier"}, reg))
216216
if err != nil {

0 commit comments

Comments
 (0)