mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-09 23:24:05 -08:00
retrieval: make scrape timeout header consistent with others
This commit is contained in:
parent
26bedc9e00
commit
5e4f5fb5ad
|
@ -307,7 +307,7 @@ func (s *targetScraper) scrape(ctx context.Context, ts time.Time) (model.Samples
|
|||
}
|
||||
req.Header.Add("Accept", acceptHeader)
|
||||
req.Header.Set("User-Agent", userAgentHeader)
|
||||
req.Header.Set("Scrape-Timeout-Seconds", fmt.Sprintf("%f", s.timeout.Seconds()))
|
||||
req.Header.Set("X-Prometheus-Scrape-Timeout-Seconds", fmt.Sprintf("%f", s.timeout.Seconds()))
|
||||
|
||||
resp, err := ctxhttp.Do(ctx, s.client, req)
|
||||
if err != nil {
|
||||
|
|
|
@ -588,7 +588,7 @@ func TestTargetScraperScrapeOK(t *testing.T) {
|
|||
|
||||
server := httptest.NewServer(
|
||||
http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
timeout := r.Header.Get("Scrape-Timeout-Seconds")
|
||||
timeout := r.Header.Get("X-Prometheus-Scrape-Timeout-Seconds")
|
||||
if timeout != expectedTimeout {
|
||||
t.Errorf("Scrape timeout did not match expected timeout")
|
||||
t.Errorf("Expected: %v", expectedTimeout)
|
||||
|
|
Loading…
Reference in a new issue