prometheus/cmd/prometheus
bwplotka f44bba31b3 config: Remove validation GetScrapeConfigs; require using config.Load.
We should never modify (or even shallow copy) Config after config.Load;
added comments and modified GetScrapeConfigs to do so. For GetScrapeConfigs
the validation (even repeated) was likely doing writes (because global fields was 0). We GetScrapeConfigs concurrently
in tests and ApplyConfig causing test races. In prod there were
races but likelyt only to replace 0 with 0, so not too severe.

I removed validation since I don't see anyone using our config.Config without Load.
I had to refactor one test that was doing it, all others use yaml config.

Fixes #15538
Previous attempt: https://github.com/prometheus/prometheus/pull/15634

Signed-off-by: bwplotka <bwplotka@gmail.com>
2024-12-11 13:31:01 +00:00
..
testdata End-to-end Query Log test (#6600) 2020-01-19 21:56:13 +00:00
main.go config: Remove validation GetScrapeConfigs; require using config.Load. 2024-12-11 13:31:01 +00:00
main_test.go test(cmd/prometheus): speed up test execution by t.Parallel() when possible 2024-10-18 17:52:59 +02:00
main_unix_test.go test(cmd/prometheus): speed up test execution by t.Parallel() when possible 2024-10-18 17:52:59 +02:00
query_log_test.go test(cmd/prometheus): speed up test execution by t.Parallel() when possible 2024-10-18 17:52:59 +02:00
reload_test.go Fix auto reload when a config file with a syntax error is reverted 2024-11-05 12:43:34 +01:00
scrape_failure_log_test.go Scrape: Add scrape_failure_log_file to log Scrape Failures 2024-09-05 11:01:40 +02:00