prometheus/config
Will Hegedus 33578fedb3 fix(config): respect GOGC environment variable if no "runtime" block exists
Fixes: https://github.com/prometheus/prometheus/issues/16334
Related to:
- https://github.com/prometheus/prometheus/pull/15238
- https://github.com/prometheus/prometheus/pull/16052

Currently, when the GOGC environment variable is set -- and no `runtime`
block is set in the Prometheus config file -- it is ignored and the
default value of 75% is always used.

However, if there is an empty runtime block (e.g. `runtime: {}`), _then_
the GOGC environment variable is checked.

This PR changes this behavior to consistently check and use the GOGC
environment variable when it is set (unless the `gogc` field is set in
the `runtime` block of the loaded config file, in which case it still
gives that precedence).

Co-authored-by: Adam Rambo <arambo@protonmail.com>
Signed-off-by: Will Hegedus <whegedus@akamai.com>
2025-05-12 07:37:20 -04:00
..
testdata Merge pull request #16452 from chardch/global-always-scrape-classic-hist 2025-05-06 09:29:30 +02:00
config_default_test.go config: Remove validation GetScrapeConfigs; require using config.Load. 2024-12-11 13:31:01 +00:00
config_test.go Merge pull request #16452 from chardch/global-always-scrape-classic-hist 2025-05-06 09:29:30 +02:00
config_windows_test.go config: Remove validation GetScrapeConfigs; require using config.Load. 2024-12-11 13:31:01 +00:00
config.go fix(config): respect GOGC environment variable if no "runtime" block exists 2025-05-12 07:37:20 -04: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
reload.go fix: fails to auto-reload on changes to rule and scrape config files 2025-04-02 08:41:15 -05:00