Skip to content

Commit e319ef5

Browse files
jtlisigouthamve
authored andcommitted
add flag to enable and set the mutex profile fraction (cortexproject#1969)
* add flag to enable and set the mutex profile fraction Signed-off-by: Jacob Lisi <jacob.t.lisi@gmail.com> * update flag name and update changelog Signed-off-by: Jacob Lisi <jacob.t.lisi@gmail.com>
1 parent 819cc0f commit e319ef5

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
* [CHANGE] Ingesters now write only normalised tokens to the ring, although they can still read denormalised tokens used by other ingesters. `-ingester.normalise-tokens` is now deprecated, and ignored. If you want to switch back to using denormalised tokens, you need to downgrade to Cortex 0.4.0. Previous versions don't handle claiming tokens from normalised ingesters correctly. #1809
1515
* [CHANGE] Overrides mechanism has been renamed to "runtime config", and is now separate from limits. Runtime config is simply a file that is reloaded by Cortex every couple of seconds. Limits and now also multi KV use this mechanism.<br />New arguments were introduced: `-runtime-config.file` (defaults to empty) and `-runtime-config.reload-period` (defaults to 10 seconds), which replace previously used `-limits.per-user-override-config` and `-limits.per-user-override-period` options. Old options are still used if `-runtime-config.file` is not specified. This change is also reflected in YAML configuration, where old `limits.per_tenant_override_config` and `limits.per_tenant_override_period` fields are replaced with `runtime_config.file` and `runtime_config.period` respectively. #1749
1616
* [FEATURE] The distributor can now drop labels from samples (similar to the removal of the replica label for HA ingestion) per user via the `distributor.drop-label` flag. #1726
17+
* [FEATURE] Added flag `debug.mutex-profile-fraction` to enable mutex profiling #1969
1718
* [FEATURE] Added `global` ingestion rate limiter strategy. Deprecated `-distributor.limiter-reload-period` flag. #1766
1819
* [FEATURE] Added support for Microsoft Azure blob storage to be used for storing chunk data. #1913
1920
* [FEATURE] Added readiness probe endpoint`/ready` to queriers. #1934

cmd/cortex/main.go

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,20 @@ func init() {
2727

2828
func main() {
2929
var (
30-
cfg cortex.Config
31-
configFile = ""
32-
eventSampleRate int
33-
ballastBytes int
30+
cfg cortex.Config
31+
configFile = ""
32+
eventSampleRate int
33+
ballastBytes int
34+
mutexProfileFraction int
3435
)
3536
flag.StringVar(&configFile, "config.file", "", "Configuration file to load.")
3637
flag.IntVar(&eventSampleRate, "event.sample-rate", 0, "How often to sample observability events (0 = never).")
3738
flag.IntVar(&ballastBytes, "mem-ballast-size-bytes", 0, "Size of memory ballast to allocate.")
39+
flag.IntVar(&mutexProfileFraction, "debug.mutex-profile-fraction", 0, "Fraction at which mutex profile vents will be reported, 0 to disable")
40+
41+
if mutexProfileFraction > 0 {
42+
runtime.SetMutexProfileFraction(mutexProfileFraction)
43+
}
3844

3945
flagext.RegisterFlags(&cfg)
4046
flag.Parse()

0 commit comments

Comments
 (0)