scrape_timeout equal to scrape_interval is accepted by Prometheus 2.x config validation
0 reputation · 03 Apr 2023, 11:42 UTC
Prometheus documentation recommends that scrape_timeout stay shorter than scrape_interval for each scrape config. The configuration parser does not hard-reject values where scrape_timeout equals or exceeds scrape_interval, so overlapping scrapes against the same target can occur.
When a scrape exceeds its timeout, Prometheus cancels the HTTP request through Go context and discards the incomplete sample set, but the exporter may continue processing after disconnection. A single timeout does not immediately mark the target down; target health depends on consecutive failures across scrape_interval cycles.
Is this overlap behavior intentional for backward compatibility, or should operators treat scrape_timeout greater than or equal to scrape_interval as a misconfiguration? Does Prometheus track or limit concurrent scrapes per target when intervals overlap? Should configuration validation warn or reject overlapping scrape windows?