Skip to content

Commit 58a18e2

Browse files
authored
Added -debug.block-profile-rate (#4217)
Signed-off-by: Marco Pracucci <[email protected]>
1 parent fb14b14 commit 58a18e2

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* [CHANGE] Change default value of `-server.grpc.keepalive.min-time-between-pings` to `10s` and `-server.grpc.keepalive.ping-without-stream-allowed` to `true`. #4168
1010
* [FEATURE] Querier: Added new `-querier.max-fetched-series-per-query` flag. When Cortex is running with blocks storage, the max series per query limit is enforced in the querier and applies to unique series received from ingesters and store-gateway (long-term storage). #4179
1111
* [FEATURE] Alertmanager: Added rate-limits to notifiers. Rate limits used by all integrations can be configured using `-alertmanager.notification-rate-limit`, while per-integration rate limits can be specified via `-alertmanager.notification-rate-limit-per-integration` parameter. Both shared and per-integration limits can be overwritten using overrides mechanism. These limits are applied on individual (per-tenant) alertmanagers. Rate-limited notifications are failed notifications. It is possible to monitor rate-limited notifications via new `cortex_alertmanager_notification_rate_limited_total` metric. #4135 #4163
12+
* [FEATURE] Added flag `-debug.block-profile-rate` to enable goroutine blocking events profiling. #4217
1213
* [ENHANCEMENT] Alertmanager: introduced new metrics to monitor operation when using `-alertmanager.sharding-enabled`: #4149
1314
* `cortex_alertmanager_state_fetch_replica_state_total`
1415
* `cortex_alertmanager_state_fetch_replica_state_failed_total`

cmd/cortex/main.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ func main() {
6262
eventSampleRate int
6363
ballastBytes int
6464
mutexProfileFraction int
65+
blockProfileRate int
6566
printVersion bool
6667
printModules bool
6768
)
@@ -88,7 +89,8 @@ func main() {
8889

8990
flag.IntVar(&eventSampleRate, "event.sample-rate", 0, "How often to sample observability events (0 = never).")
9091
flag.IntVar(&ballastBytes, "mem-ballast-size-bytes", 0, "Size of memory ballast to allocate.")
91-
flag.IntVar(&mutexProfileFraction, "debug.mutex-profile-fraction", 0, "Fraction at which mutex profile vents will be reported, 0 to disable")
92+
flag.IntVar(&mutexProfileFraction, "debug.mutex-profile-fraction", 0, "Fraction of mutex contention events that are reported in the mutex profile. On average 1/rate events are reported. 0 to disable.")
93+
flag.IntVar(&blockProfileRate, "debug.block-profile-rate", 0, "Fraction of goroutine blocking events that are reported in the blocking profile. 1 to include every blocking event in the profile, 0 to disable.")
9294
flag.BoolVar(&printVersion, "version", false, "Print Cortex version and exit.")
9395
flag.BoolVar(&printModules, "modules", false, "List available values that can be used as target.")
9496

@@ -136,6 +138,9 @@ func main() {
136138
if mutexProfileFraction > 0 {
137139
runtime.SetMutexProfileFraction(mutexProfileFraction)
138140
}
141+
if blockProfileRate > 0 {
142+
runtime.SetBlockProfileRate(blockProfileRate)
143+
}
139144

140145
util_log.InitLogger(&cfg.Server)
141146

0 commit comments

Comments
 (0)