mirror of
https://github.com/prometheus/prometheus.git
synced 2025-07-03 11:03:25 +00:00
Remove check against cfg so interval/ timeout are always set (#10023)
Signed-off-by: Nicholas Blott <blottn@tcd.ie>
This commit is contained in:
parent
13af2470bf
commit
c92673fb14
3 changed files with 26 additions and 25 deletions
|
@ -15,6 +15,7 @@ package main
|
|||
|
||||
import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/prometheus/common/model"
|
||||
|
||||
|
@ -37,6 +38,8 @@ func TestSDCheckResult(t *testing.T) {
|
|||
require.Nil(t, err)
|
||||
|
||||
scrapeConfig := &config.ScrapeConfig{
|
||||
ScrapeInterval: model.Duration(1 * time.Minute),
|
||||
ScrapeTimeout: model.Duration(10 * time.Second),
|
||||
RelabelConfigs: []*relabel.Config{{
|
||||
SourceLabels: model.LabelNames{"foo"},
|
||||
Action: relabel.Replace,
|
||||
|
@ -50,14 +53,14 @@ func TestSDCheckResult(t *testing.T) {
|
|||
{
|
||||
DiscoveredLabels: labels.Labels{
|
||||
labels.Label{Name: "__address__", Value: "localhost:8080"},
|
||||
labels.Label{Name: "__scrape_interval__", Value: "0s"},
|
||||
labels.Label{Name: "__scrape_timeout__", Value: "0s"},
|
||||
labels.Label{Name: "__scrape_interval__", Value: "1m"},
|
||||
labels.Label{Name: "__scrape_timeout__", Value: "10s"},
|
||||
labels.Label{Name: "foo", Value: "bar"},
|
||||
},
|
||||
Labels: labels.Labels{
|
||||
labels.Label{Name: "__address__", Value: "localhost:8080"},
|
||||
labels.Label{Name: "__scrape_interval__", Value: "0s"},
|
||||
labels.Label{Name: "__scrape_timeout__", Value: "0s"},
|
||||
labels.Label{Name: "__scrape_interval__", Value: "1m"},
|
||||
labels.Label{Name: "__scrape_timeout__", Value: "10s"},
|
||||
labels.Label{Name: "foo", Value: "bar"},
|
||||
labels.Label{Name: "instance", Value: "localhost:8080"},
|
||||
labels.Label{Name: "newfoo", Value: "bar"},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue