prometheus/scrape
Bryan Boreham e86b9812f4 [BUGFIX] Scraping: bump cache iteration after error
Backport of #16174 to LTS release-2.53 branch.

We use the cache iteration number to detect when the same metric has
occurred twice in a scrape. We need to bump this number at the end of
every scrape, not just successful scrapes.

The `iter` number is also used:
* After a successful scrape, to delete older metrics and metadata.
* To detect when metadata changed in this scrape.

None of those additional cases is broken by incrementing the number
on error.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2025-03-17 18:09:01 +00:00
..
testdata Re-generate test cert to fix test_windows test failures 2022-03-17 19:37:18 +01:00
clientprotobuf.go Update according to code review 2023-05-05 02:33:00 +08:00
helpers_test.go [TESTS] Scrape: make caching work in benchmark 2025-03-17 18:08:03 +00:00
manager_test.go golangci-lint: enable whitespace linter (#13905) 2024-04-11 09:27:54 +01:00
manager.go bugfix: Decouple native histogram ingestions and protobuf parsing 2024-04-24 17:02:52 -03:00
metrics.go support unregistering scrape manager metrics 2024-04-05 16:00:52 +00:00
scrape_test.go [BUGFIX] Scraping: bump cache iteration after error 2025-03-17 18:09:01 +00:00
scrape.go [BUGFIX] Scraping: bump cache iteration after error 2025-03-17 18:09:01 +00:00
target_test.go Enable perfsprint linter and fix up code 2024-05-15 17:51:05 +03:00
target.go scraping: pass a Builder to get Target labels 2024-02-26 11:45:25 +00:00