From 6828a6bddaf631541289cd4fcf122c5c0687bc21 Mon Sep 17 00:00:00 2001 From: avilevy Date: Sat, 7 Mar 2026 02:29:23 +0000 Subject: [PATCH] Clarify use cases in InitialScrapeOffset comment Signed-off-by: avilevy --- scrape/manager.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/scrape/manager.go b/scrape/manager.go index 41d1c24fd5..c6ed865683 100644 --- a/scrape/manager.go +++ b/scrape/manager.go @@ -143,9 +143,13 @@ type Options struct { // tuning the initial startup delay without overriding the underlying target // jitter, preserving proper load balancing across the scraper pools. // - // NOTE: This option is not used by the standard Prometheus server. It was - // created for use in agent mode or in OTel's prometheusreceiver when - // used in serverless job scenarios. + // Setting this offset (e.g., to 10s) is particularly useful in Prometheus + // agent mode and OTel's prometheusreceiver when used in serverless job + // scenarios. It helps avoid readiness races where targets might not be fully + // initialized immediately upon startup. It also prevents capturing + // intermediate state (such as applications crashing shortly after booting), + // and ensures backend rate limits don't drop valuable shutdown scrapes + // because of an early startup scrape. InitialScrapeOffset time.Duration }