mirror of
https://github.com/prometheus/prometheus.git
synced 2026-05-04 20:06:12 +02:00
chore(config): add guidelines for adding a new RuntimeConfig field based on learnings from GoGC addition
Signed-off-by: machine424 <ayoubmrini424@gmail.com>
This commit is contained in:
parent
e809ccb90a
commit
690c9da817
@ -656,6 +656,21 @@ const DefaultGoGCPercentage = 75
|
||||
type RuntimeConfig struct {
|
||||
// The Go garbage collection target percentage.
|
||||
GoGC int `yaml:"gogc,omitempty"`
|
||||
|
||||
// Below are guidelines for adding a new field:
|
||||
//
|
||||
// For config that shouldn't change after startup, you might want to use
|
||||
// flags https://prometheus.io/docs/prometheus/latest/command-line/prometheus/.
|
||||
//
|
||||
// Consider when the new field is first applied: at the very beginning of instance
|
||||
// startup, after the TSDB is loaded etc. See https://github.com/prometheus/prometheus/pull/16491
|
||||
// for an example.
|
||||
//
|
||||
// Provide a test covering various scenarios: empty config file, empty or incomplete runtime
|
||||
// config block, precedence over other inputs (e.g., env vars, if applicable) etc.
|
||||
// See TestRuntimeGOGCConfig (or https://github.com/prometheus/prometheus/pull/15238).
|
||||
// The test should also verify behavior on reloads, since this config should be
|
||||
// adjustable at runtime.
|
||||
}
|
||||
|
||||
// isZero returns true iff the global config is the zero value.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user