prometheus/scrape
Goutham Veeramachaneni ec3d02019e
Pass the correct context to staleness Appender (#10588)
OTel Collector prints the following error when a target disappears:

```
2022-04-13T14:20:24.932-0400	warn	scrape/scrape.go:1408	Stale append failed	{"kind": "receiver", "name": "prometheus", "scrape_pool": "beep-boop", "target": "http://localhost:9090/metrics", "error": "transaction aborted"}
```

This `transaction aborted` error is returned by the custom appender that is
used by the collector when the context of the appender is cancelled:
b7bf11174e/receiver/prometheusreceiver/internal/otlp_transaction.go (L81-L82)

We call `endOfRunStaleness` after `sl.stop()` which cancels `sl.ctx`.
The other `.Appender()` calls use `parentCtx` for the same reason.

This hasn't come up so far because Prometheus' Appender implementation just
ignores the context passed.

Signed-off-by: Goutham Veeramachaneni <gouthamve@gmail.com>
2022-04-14 10:03:07 -04: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 discovery: Expose custom HTTP client options to discoverers (#10462) 2022-03-24 18:16:59 -04:00
manager_test.go Move packages out of deprecated pkg directory 2021-11-09 08:03:10 +01:00
scrape.go Pass the correct context to staleness Appender (#10588) 2022-04-14 10:03:07 -04:00
scrape_test.go scrape: allow providing a custom Dialer for scraping (#10415) 2022-03-09 00:48:47 +01: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 Remove check against cfg so interval/ timeout are always set (#10023) (#10031) 2021-12-16 16:46:14 +01:00