mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-26 06:04:05 -08:00
Merge pull request #2582 from mdlayher/scrape-header-rename
retrieval: make scrape timeout header consistent with others
This commit is contained in:
commit
5f764d9940
|
@ -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