Skip to content

Commit c1f634a

Browse files
committed
Addressed review comments
Signed-off-by: Marco Pracucci <[email protected]>
1 parent 97d586b commit c1f634a

File tree

4 files changed

+14
-11
lines changed

4 files changed

+14
-11
lines changed

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,14 @@
9595
* `cortex_bucket_store_chunk_pool_returned_bytes_total`
9696
* [ENHANCEMENT] Alertmanager: load alertmanager configurations from object storage concurrently, and only load necessary configurations, speeding configuration synchronization process and executing fewer "GET object" operations to the storage when sharding is enabled. #3898
9797
* [ENHANCEMENT] Blocks storage: Ingester can now stream entire chunks instead of individual samples to the querier. At the moment this feature must be explicitly enabled either by using `-ingester.stream-chunks-when-using-blocks` flag or `ingester_stream_chunks_when_using_blocks` (boolean) field in runtime config file, but these configuration options are temporary and will be removed when feature is stable. #3889
98+
<<<<<<< HEAD
9899
* [ENHANCEMENT] Alertmanager: New endpoint `/multitenant_alertmanager/delete_tenant_config` to delete configuration for tenant identified by `X-Scope-OrgID` header. This is an internal endpoint, available even if Alertmanager API is not enabled by using `-experimental.alertmanager.enable-api`. #3900
100+
=======
101+
* [ENHANCEMENT] Ruler: optimized `<prefix>/api/v1/rules` and `<prefix>/api/v1/alerts` when ruler sharding is enabled. #3916
102+
* [ENHANCEMENT] Ruler: added the following metrics when ruler sharding is enabled: #3916
103+
* `cortex_ruler_clients`
104+
* `cortex_ruler_client_request_duration_seconds`
105+
>>>>>>> c8951cfce... Addressed review comments
99106
* [BUGFIX] Cortex: Fixed issue where fatal errors and various log messages where not logged. #3778
100107
* [BUGFIX] HA Tracker: don't track as error in the `cortex_kv_request_duration_seconds` metric a CAS operation intentionally aborted. #3745
101108
* [BUGFIX] Querier / ruler: do not log "error removing stale clients" if the ring is empty. #3761

integration/e2ecortex/client.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ type ServerStatus struct {
215215
} `json:"data"`
216216
}
217217

218-
// GetRuleGroups fetches the rulers from the Prometheus endpoint /api/v1/rules.
218+
// GetPrometheusRules fetches the rules from the Prometheus endpoint /api/v1/rules.
219219
func (c *Client) GetPrometheusRules() ([]*ruler.RuleGroup, error) {
220220
// Create HTTP request
221221
req, err := http.NewRequest("GET", fmt.Sprintf("http://%s/api/prom/api/v1/rules", c.rulerAddress), nil)

integration/ruler_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ func TestRulerSharding(t *testing.T) {
375375
require.NoError(t, ruler1.WaitSumMetrics(e2e.Less(numRulesGroups), "cortex_prometheus_rule_group_rules"))
376376
require.NoError(t, ruler2.WaitSumMetrics(e2e.Less(numRulesGroups), "cortex_prometheus_rule_group_rules"))
377377

378-
// Fetch the rulers and ensure they match the configured ones.
378+
// Fetch the rules and ensure they match the configured ones.
379379
actualGroups, err := c.GetPrometheusRules()
380380
require.NoError(t, err)
381381

pkg/ruler/client_pool.go

+5-9
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,18 @@ func newRulerClientPool(clientCfg grpcclient.Config, logger log.Logger, reg prom
2323
}
2424

2525
clientsCount := promauto.With(reg).NewGauge(prometheus.GaugeOpts{
26-
Namespace: "cortex",
27-
Name: "ruler_clients",
28-
Help: "The current number of ruler clients in the pool.",
29-
ConstLabels: prometheus.Labels{"client": "ruler"},
26+
Name: "cortex_ruler_clients",
27+
Help: "The current number of ruler clients in the pool.",
3028
})
3129

3230
return client.NewPool("ruler", poolCfg, nil, newRulerClientFactory(clientCfg, reg), clientsCount, logger)
3331
}
3432

3533
func newRulerClientFactory(clientCfg grpcclient.Config, reg prometheus.Registerer) client.PoolFactory {
3634
requestDuration := promauto.With(reg).NewHistogramVec(prometheus.HistogramOpts{
37-
Namespace: "cortex",
38-
Name: "ruler_client_request_duration_seconds",
39-
Help: "Time spent executing requests to the ruler.",
40-
Buckets: prometheus.ExponentialBuckets(0.008, 4, 7),
41-
ConstLabels: prometheus.Labels{"client": "ruler"},
35+
Name: "cortex_ruler_client_request_duration_seconds",
36+
Help: "Time spent executing requests to the ruler.",
37+
Buckets: prometheus.ExponentialBuckets(0.008, 4, 7),
4238
}, []string{"operation", "status_code"})
4339

4440
return func(addr string) (client.PoolClient, error) {

0 commit comments

Comments
 (0)