From 5e4f5fb5ada1306385f9a7b57345057ce93e59bd Mon Sep 17 00:00:00 2001 From: Matt Layher Date: Wed, 5 Apr 2017 14:56:22 -0400 Subject: [PATCH] retrieval: make scrape timeout header consistent with others --- retrieval/scrape.go | 2 +- retrieval/scrape_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/retrieval/scrape.go b/retrieval/scrape.go index f67957cd8..f537c8496 100644 --- a/retrieval/scrape.go +++ b/retrieval/scrape.go @@ -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 { diff --git a/retrieval/scrape_test.go b/retrieval/scrape_test.go index aaae23b77..6236d6b69 100644 --- a/retrieval/scrape_test.go +++ b/retrieval/scrape_test.go @@ -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)