Skip to content

Commit

Permalink
chore: follow-up to #11151
Browse files Browse the repository at this point in the history
  • Loading branch information
ashwanthgoli committed Nov 14, 2023
1 parent 265018b commit 030db9a
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 20 deletions.
4 changes: 0 additions & 4 deletions docs/sources/setup/upgrade/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,6 @@ Some Loki metrics started with the prefix `cortex_`. In this release they will b
- `cortex_query_scheduler_queue_duration_seconds_sum`
- `cortex_query_scheduler_queue_length`
- `cortex_query_scheduler_running`
- `cortex_quota_cgroup_cpu_max`
- `cortex_quota_cgroup_cpu_period`
- `cortex_quota_cpu_count`
- `cortex_quota_gomaxprocs`
- `cortex_ring_member_heartbeats_total`
- `cortex_ring_member_tokens_owned`
- `cortex_ring_member_tokens_to_own`
Expand Down
20 changes: 11 additions & 9 deletions pkg/ruler/base/client_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,27 +48,29 @@ func newRulerClientPool(clientCfg grpcclient.Config, logger log.Logger, reg prom
})

return &rulerClientsPool{
client.NewPool("ruler", poolCfg, nil, newRulerClientFactory(clientCfg, reg), clientsCount, logger),
client.NewPool("ruler", poolCfg, nil, newRulerClientFactory(clientCfg, reg, metricsNamespace), clientsCount, logger),
}
}

func newRulerClientFactory(clientCfg grpcclient.Config, reg prometheus.Registerer) client.PoolFactory {
func newRulerClientFactory(clientCfg grpcclient.Config, reg prometheus.Registerer, metricsNamespace string) client.PoolFactory {
requestDuration := promauto.With(reg).NewHistogramVec(prometheus.HistogramOpts{
Name: "cortex_ruler_client_request_duration_seconds",
Help: "Time spent executing requests to the ruler.",
Buckets: prometheus.ExponentialBuckets(0.008, 4, 7),
Namespace: metricsNamespace,
Name: "ruler_client_request_duration_seconds",
Help: "Time spent executing requests to the ruler.",
Buckets: prometheus.ExponentialBuckets(0.008, 4, 7),
}, []string{"operation", "status_code"})

return client.PoolAddrFunc(func(addr string) (client.PoolClient, error) {
return dialRulerClient(clientCfg, addr, requestDuration)
})
}

func newRulerPoolClient(clientCfg grpcclient.Config, reg prometheus.Registerer) func(addr string) (client.PoolClient, error) {
func newRulerPoolClient(clientCfg grpcclient.Config, reg prometheus.Registerer, metricsNamespace string) func(addr string) (client.PoolClient, error) {
requestDuration := promauto.With(reg).NewHistogramVec(prometheus.HistogramOpts{
Name: "cortex_ruler_client_request_duration_seconds",
Help: "Time spent executing requests to the ruler.",
Buckets: prometheus.ExponentialBuckets(0.008, 4, 7),
Namespace: metricsNamespace,
Name: "ruler_client_request_duration_seconds",
Help: "Time spent executing requests to the ruler.",
Buckets: prometheus.ExponentialBuckets(0.008, 4, 7),
}, []string{"operation", "status_code"})

return func(addr string) (client.PoolClient, error) {
Expand Down
1 change: 0 additions & 1 deletion production/docker/config/loki.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ schema_config:

limits_config:
max_cache_freshness_per_query: '10m'
enforce_metric_name: false
reject_old_samples: true
reject_old_samples_max_age: 30m
ingestion_rate_mb: 10
Expand Down
1 change: 0 additions & 1 deletion production/helm/loki/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,6 @@ loki:
grpc_listen_port: 9095
# -- Limits config
limits_config:
enforce_metric_name: false
reject_old_samples: true
reject_old_samples_max_age: 168h
max_cache_freshness_per_query: 10m
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ loki {
},
},
limits_config: {
enforce_metric_name: false,
reject_old_samples_max_age: '168h', //1 week
max_global_streams_per_user: 60000,
ingestion_rate_mb: 75,
Expand Down
1 change: 0 additions & 1 deletion production/ksonnet/loki/config.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,6 @@
query_ingesters_within: '2h', // twice the max-chunk age (1h default) for safety buffer
},
limits_config: {
enforce_metric_name: false,
// align middleware parallelism with shard factor to optimize one-legged sharded queries.
max_query_parallelism: if $._config.queryFrontend.sharded_queries_enabled then
// For a sharding factor of 16 (default), this is 256, or enough for 16 sharded queries.
Expand Down
1 change: 0 additions & 1 deletion production/nomad/loki-distributed/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,5 @@ ruler:
dir: {{ env "NOMAD_ALLOC_DIR" }}/data/ruler

limits_config:
enforce_metric_name: false
reject_old_samples: true
reject_old_samples_max_age: 168h
1 change: 0 additions & 1 deletion production/nomad/loki-simple/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ storage_config:
s3forcepathstyle: true

limits_config:
enforce_metric_name: false
reject_old_samples: true
reject_old_samples_max_age: 168h

Expand Down
1 change: 0 additions & 1 deletion production/nomad/loki/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ storage_config:
s3forcepathstyle: true

limits_config:
enforce_metric_name: false
reject_old_samples: true
reject_old_samples_max_age: 168h

Expand Down

0 comments on commit 030db9a

Please sign in to comment.