prometheus/config
Arve Knudsen 71c4e69a08 fix(config): check all fields in GlobalConfig.isZero()
The isZero() method was missing checks for 9 fields that exist in the
GlobalConfig struct. This caused the method to incorrectly return true
when only these fields had non-zero values, resulting in user
configurations being silently overwritten with defaults during YAML
unmarshaling.

Added checks for: BodySizeLimit, SampleLimit, TargetLimit, LabelLimit,
LabelNameLengthLimit, LabelValueLengthLimit, KeepDroppedTargets,
MetricNameValidationScheme, and MetricNameEscapingScheme.

Consolidated TestEmptyGlobalBlock and new isZero tests under
TestGlobalConfig.

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2025-12-24 13:21:09 +01:00
..
testdata tsdb: Deprecate retention flags; add tsdb.retention runtime configuration (#17026) 2025-10-27 14:51:33 +00:00
config.go fix(config): check all fields in GlobalConfig.isZero() 2025-12-24 13:21:09 +01:00
config_default_test.go bugfix: Default OTLP config not respected when otlp: block is unset (#16693) 2025-06-04 22:52:39 +02:00
config_test.go fix(config): check all fields in GlobalConfig.isZero() 2025-12-24 13:21:09 +01:00
config_windows_test.go config: Remove validation GetScrapeConfigs; require using config.Load. 2024-12-11 13:31:01 +00:00
reload.go Replace gopkg.in/yaml.v2 with go.yaml.in/yaml/v2 (#17151) 2025-09-06 13:04:24 +02:00
reload_test.go fix: fails to auto-reload on changes to rule and scrape config files 2025-04-02 08:41:15 -05:00