|
|
|
@ -678,6 +678,7 @@ func newBasicScrapeLoop(t testing.TB, ctx context.Context, scraper scraper, app
|
|
|
|
|
false,
|
|
|
|
|
false,
|
|
|
|
|
false,
|
|
|
|
|
false,
|
|
|
|
|
nil,
|
|
|
|
|
false,
|
|
|
|
|
newTestScrapeMetrics(t),
|
|
|
|
@ -819,6 +820,7 @@ func TestScrapeLoopRun(t *testing.T) {
|
|
|
|
|
false,
|
|
|
|
|
false,
|
|
|
|
|
false,
|
|
|
|
|
false,
|
|
|
|
|
nil,
|
|
|
|
|
false,
|
|
|
|
|
scrapeMetrics,
|
|
|
|
@ -962,6 +964,7 @@ func TestScrapeLoopMetadata(t *testing.T) {
|
|
|
|
|
false,
|
|
|
|
|
false,
|
|
|
|
|
false,
|
|
|
|
|
false,
|
|
|
|
|
nil,
|
|
|
|
|
false,
|
|
|
|
|
scrapeMetrics,
|
|
|
|
@ -1571,6 +1574,7 @@ func TestScrapeLoop_HistogramBucketLimit(t *testing.T) {
|
|
|
|
|
app := &bucketLimitAppender{Appender: resApp, limit: 2}
|
|
|
|
|
|
|
|
|
|
sl := newBasicScrapeLoop(t, context.Background(), nil, func(ctx context.Context) storage.Appender { return app }, 0)
|
|
|
|
|
sl.enableNativeHistogramIngestion = true
|
|
|
|
|
sl.sampleMutator = func(l labels.Labels) labels.Labels {
|
|
|
|
|
if l.Has("deleteme") {
|
|
|
|
|
return labels.EmptyLabels()
|
|
|
|
@ -1799,6 +1803,7 @@ func TestScrapeLoopAppendExemplar(t *testing.T) {
|
|
|
|
|
tests := []struct {
|
|
|
|
|
title string
|
|
|
|
|
scrapeClassicHistograms bool
|
|
|
|
|
enableNativeHistogramsIngestion bool
|
|
|
|
|
scrapeText string
|
|
|
|
|
contentType string
|
|
|
|
|
discoveryLabels []string
|
|
|
|
@ -1862,6 +1867,8 @@ metric_total{n="2"} 2 # {t="2"} 2.0 20000
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: "Native histogram with three exemplars",
|
|
|
|
|
|
|
|
|
|
enableNativeHistogramsIngestion: true,
|
|
|
|
|
scrapeText: `name: "test_histogram"
|
|
|
|
|
help: "Test histogram with many buckets removed to keep it manageable in size."
|
|
|
|
|
type: HISTOGRAM
|
|
|
|
@ -1976,6 +1983,8 @@ metric: <
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: "Native histogram with three exemplars scraped as classic histogram",
|
|
|
|
|
|
|
|
|
|
enableNativeHistogramsIngestion: true,
|
|
|
|
|
scrapeText: `name: "test_histogram"
|
|
|
|
|
help: "Test histogram with many buckets removed to keep it manageable in size."
|
|
|
|
|
type: HISTOGRAM
|
|
|
|
@ -2115,6 +2124,7 @@ metric: <
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sl := newBasicScrapeLoop(t, context.Background(), nil, func(ctx context.Context) storage.Appender { return app }, 0)
|
|
|
|
|
sl.enableNativeHistogramIngestion = test.enableNativeHistogramsIngestion
|
|
|
|
|
sl.sampleMutator = func(l labels.Labels) labels.Labels {
|
|
|
|
|
return mutateSampleLabels(l, discoveryLabels, false, nil)
|
|
|
|
|
}
|
|
|
|
@ -3710,7 +3720,7 @@ scrape_configs:
|
|
|
|
|
s.DB.EnableNativeHistograms()
|
|
|
|
|
reg := prometheus.NewRegistry()
|
|
|
|
|
|
|
|
|
|
mng, err := NewManager(nil, nil, s, reg)
|
|
|
|
|
mng, err := NewManager(&Options{EnableNativeHistogramsIngestion: true}, nil, s, reg)
|
|
|
|
|
require.NoError(t, err)
|
|
|
|
|
cfg, err := config.Load(configStr, false, log.NewNopLogger())
|
|
|
|
|
require.NoError(t, err)
|
|
|
|
|