mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-09 23:24:05 -08:00
Log gomaxprocs messages (#10506)
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
This commit is contained in:
parent
c0fd228bad
commit
390956d317
|
@ -570,8 +570,11 @@ func main() {
|
||||||
)
|
)
|
||||||
|
|
||||||
if cfg.enableAutoGOMAXPROCS {
|
if cfg.enableAutoGOMAXPROCS {
|
||||||
if _, err := maxprocs.Set(); err != nil {
|
l := func(format string, a ...interface{}) {
|
||||||
level.Warn(logger).Log("msg", "Failed to set GOMAXPROCS automatically", "err", err)
|
level.Info(logger).Log("component", "automaxprocs", "msg", fmt.Sprintf(strings.TrimPrefix(format, "maxprocs: "), a...))
|
||||||
|
}
|
||||||
|
if _, err := maxprocs.Set(maxprocs.Logger(l)); err != nil {
|
||||||
|
level.Warn(logger).Log("component", "automaxprocs", "msg", "Failed to set GOMAXPROCS automatically", "err", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -93,7 +93,4 @@ computed at all.
|
||||||
|
|
||||||
`--enable-feature=auto-gomaxprocs`
|
`--enable-feature=auto-gomaxprocs`
|
||||||
|
|
||||||
When enabled, GOMAXPROCS variable will be automatically set to match the container CPU limit.
|
When enabled, GOMAXPROCS variable is automatically set to match Linux container CPU quota.
|
||||||
|
|
||||||
This means that Go runtime will operate as if it had only amount of CPU specified in the container
|
|
||||||
CPU limit and not all CPUs on server where it's running.
|
|
||||||
|
|
Loading…
Reference in a new issue