prometheus/scrape
Goutham Veeramachaneni 2381d7be57
Send target and metadata cache in context (again) (#10636)
* Send target and metadata cache in context (again)

The previous attempt was rolled back in #10590 due to memory issues.

`sl.parentCtx` and `sl.ctx` both had a copy of the cache and target info
in the previous attempt and it was hard to pin-point where the context
was being retained causing the memory increase.

I've experimented a bunch in #10627 to figure out that this approach doesn't
cause memory increase. Beyond that, just using this info in _any_ other context
is causing a memory increase.

The change fixed a bunch of long-standing in the OTel Collector that the
community was waiting on and release is blocked on a few downstream distrubutions
of OTel Collector waiting on a fix. I propose to merge this change in while
I investigate what is happening.

Signed-off-by: Goutham Veeramachaneni <gouthamve@gmail.com>

* Gate the change behind a manager option

Signed-off-by: Goutham Veeramachaneni <gouthamve@gmail.com>
2022-05-03 11:45:52 -07:00
..
testdata Re-generate test cert to fix test_windows test failures 2022-03-17 19:37:18 +01:00
helpers_test.go Move packages out of deprecated pkg directory 2021-11-09 08:03:10 +01:00
manager.go Send target and metadata cache in context (again) (#10636) 2022-05-03 11:45:52 -07:00
manager_test.go Move packages out of deprecated pkg directory 2021-11-09 08:03:10 +01:00
scrape.go Send target and metadata cache in context (again) (#10636) 2022-05-03 11:45:52 -07:00
scrape_test.go Send target and metadata cache in context (again) (#10636) 2022-05-03 11:45:52 -07:00
target.go Remove check against cfg so interval/ timeout are always set (#10023) (#10031) 2021-12-16 16:46:14 +01:00
target_test.go refactor: move from io/ioutil to io and os packages (#10528) 2022-04-27 11:24:36 +02:00