Skip to content

Commit

Permalink
Vendor update mimir-prometheus at aa96f2e80ba9 (#10168)
Browse files Browse the repository at this point in the history
* Vendor update mimir-prometheus at aa96f2e80ba9

Which is upstream Prometheus at b9dd95f499aa2912d9cfbcfddfbdd6bc0a5207a5

* Do not use new limit in storage.NewMergeSeriesSet

* MQE: Fix our test cases

Mostly just annotation infos.

* MQE: re-sync upstream tests

* Update otlp

* Update changelog

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>

---------

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
Co-authored-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
  • Loading branch information
jhesketh and krajorama authored Dec 9, 2024
1 parent 66b315c commit 76ab843
Show file tree
Hide file tree
Showing 54 changed files with 1,338 additions and 1,162 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
* [ENHANCEMENT] Ingester: do not reuse labels, samples and histograms slices in the write request if there are more entries than 10x the pre-allocated size. This should help to reduce the in-use memory in case of few requests with a very large number of labels, samples or histograms. #10040
* [ENHANCEMENT] Query-Frontend: prune `<subquery> and on() (vector(x)==y)` style queries and stop pruning `<subquery> < -Inf`. Triggered by https://github.com/prometheus/prometheus/pull/15245. #10026
* [ENHANCEMENT] Query-Frontend: perform request format validation before processing the request. #10093
* [ENHANCEMENT] Distributor: OTLP receiver now converts also metric metadata. See also https://github.com/prometheus/prometheus/pull/15416. #10168
* [BUGFIX] Fix issue where functions such as `rate()` over native histograms could return incorrect values if a float stale marker was present in the selected range. #9508
* [BUGFIX] Fix issue where negation of native histograms (eg. `-some_native_histogram_series`) did nothing. #9508
* [BUGFIX] Fix issue where `metric might not be a counter, name does not end in _total/_sum/_count/_bucket` annotation would be emitted even if `rate` or `increase` did not have enough samples to compute a result. #9508
Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ require (
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
gopkg.in/mail.v2 v2.3.1 // indirect
gopkg.in/telebot.v3 v3.2.1 // indirect
k8s.io/apimachinery v0.31.1 // indirect
k8s.io/client-go v0.31.1 // indirect
k8s.io/apimachinery v0.31.2 // indirect
k8s.io/client-go v0.31.2 // indirect
k8s.io/klog/v2 v2.130.1 // indirect
)

Expand Down Expand Up @@ -285,7 +285,7 @@ require (
)

// Using a fork of Prometheus with Mimir-specific changes.
replace github.com/prometheus/prometheus => github.com/grafana/mimir-prometheus v0.0.0-20241205085346-9acc41d486c3
replace github.com/prometheus/prometheus => github.com/grafana/mimir-prometheus v0.0.0-20241209002314-aa96f2e80ba9

// Replace memberlist with our fork which includes some fixes that haven't been
// merged upstream yet:
Expand Down
16 changes: 8 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1279,8 +1279,8 @@ github.com/grafana/gomemcache v0.0.0-20241016125027-0a5bcc5aef40 h1:1TeKhyS+pvzO
github.com/grafana/gomemcache v0.0.0-20241016125027-0a5bcc5aef40/go.mod h1:IGRj8oOoxwJbHBYl1+OhS9UjQR0dv6SQOep7HqmtyFU=
github.com/grafana/memberlist v0.3.1-0.20220714140823-09ffed8adbbe h1:yIXAAbLswn7VNWBIvM71O2QsgfgW9fRXZNR0DXe6pDU=
github.com/grafana/memberlist v0.3.1-0.20220714140823-09ffed8adbbe/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE=
github.com/grafana/mimir-prometheus v0.0.0-20241205085346-9acc41d486c3 h1:zfF3LBLsR/NsaIzSHU+inDjjXV39fmxuZWWQQH1DQTQ=
github.com/grafana/mimir-prometheus v0.0.0-20241205085346-9acc41d486c3/go.mod h1:WKcF75sR/zMmNA/Ow3IxuBKC/gKOzGr63UkiAiaHr7I=
github.com/grafana/mimir-prometheus v0.0.0-20241209002314-aa96f2e80ba9 h1:I4jdDM9/WraFtSj7+MG3xXQepcDN3rfwWYARvGaMGRY=
github.com/grafana/mimir-prometheus v0.0.0-20241209002314-aa96f2e80ba9/go.mod h1:gB6t9u6kr6bv2nBVvVLqxWNeQWzQEGcW0iLgZY+2eyg=
github.com/grafana/opentracing-contrib-go-stdlib v0.0.0-20230509071955-f410e79da956 h1:em1oddjXL8c1tL0iFdtVtPloq2hRPen2MJQKoAWpxu0=
github.com/grafana/opentracing-contrib-go-stdlib v0.0.0-20230509071955-f410e79da956/go.mod h1:qtI1ogk+2JhVPIXVc6q+NHziSmy2W5GbdQZFUHADCBU=
github.com/grafana/prometheus-alertmanager v0.25.1-0.20240930132144-b5e64e81e8d3 h1:6D2gGAwyQBElSrp3E+9lSr7k8gLuP3Aiy20rweLWeBw=
Expand Down Expand Up @@ -2584,12 +2584,12 @@ honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt
honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las=
k8s.io/api v0.31.1 h1:Xe1hX/fPW3PXYYv8BlozYqw63ytA92snr96zMW9gWTU=
k8s.io/api v0.31.1/go.mod h1:sbN1g6eY6XVLeqNsZGLnI5FwVseTrZX7Fv3O26rhAaI=
k8s.io/apimachinery v0.31.1 h1:mhcUBbj7KUjaVhyXILglcVjuS4nYXiwC+KKFBgIVy7U=
k8s.io/apimachinery v0.31.1/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo=
k8s.io/client-go v0.31.1 h1:f0ugtWSbWpxHR7sjVpQwuvw9a3ZKLXX0u0itkFXufb0=
k8s.io/client-go v0.31.1/go.mod h1:sKI8871MJN2OyeqRlmA4W4KM9KBdBUpDLu/43eGemCg=
k8s.io/api v0.31.2 h1:3wLBbL5Uom/8Zy98GRPXpJ254nEFpl+hwndmk9RwmL0=
k8s.io/api v0.31.2/go.mod h1:bWmGvrGPssSK1ljmLzd3pwCQ9MgoTsRCuK35u6SygUk=
k8s.io/apimachinery v0.31.2 h1:i4vUt2hPK56W6mlT7Ry+AO8eEsyxMD1U44NR22CLTYw=
k8s.io/apimachinery v0.31.2/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo=
k8s.io/client-go v0.31.2 h1:Y2F4dxU5d3AQj+ybwSMqQnpZH9F30//1ObxOKlTI9yc=
k8s.io/client-go v0.31.2/go.mod h1:NPa74jSVR/+eez2dFsEIHNa+3o09vtNaWwWwb1qSxSs=
k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=
k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag=
Expand Down
17 changes: 17 additions & 0 deletions pkg/distributor/otlp/metrics_to_prw_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 0 additions & 35 deletions pkg/distributor/otlp/otlp_to_openmetrics_metadata_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/ingester/ingester.go
Original file line number Diff line number Diff line change
Expand Up @@ -1847,7 +1847,7 @@ func (i *Ingester) MetricsForLabelMatchers(ctx context.Context, req *client.Metr
Metric: make([]*mimirpb.Metric, 0),
}

mergedSet := storage.NewMergeSeriesSet(sets, storage.ChainedSeriesMerge)
mergedSet := storage.NewMergeSeriesSet(sets, 0, storage.ChainedSeriesMerge)
for mergedSet.Next() {
// Interrupt if the context has been canceled.
if ctx.Err() != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/querier/blocks_store_queryable.go
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ func (q *blocksStoreQuerier) selectSorted(ctx context.Context, sp *storage.Selec
}

return series.NewSeriesSetWithWarnings(
storage.NewMergeSeriesSet(resSeriesSets, storage.ChainedSeriesMerge),
storage.NewMergeSeriesSet(resSeriesSets, 0, storage.ChainedSeriesMerge),
resWarnings)
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/querier/distributor_queryable.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ func (q *distributorQuerier) streamingSelect(ctx context.Context, minT, maxT int
return sets[0]
}
// Sets need to be sorted. Both series.NewConcreteSeriesSetFromUnsortedSeries and newTimeSeriesSeriesSet take care of that.
return storage.NewMergeSeriesSet(sets, storage.ChainedSeriesMerge)
return storage.NewMergeSeriesSet(sets, 0, storage.ChainedSeriesMerge)
}

func (q *distributorQuerier) LabelValues(ctx context.Context, name string, _ *storage.LabelHints, matchers ...*labels.Matcher) ([]string, annotations.Annotations, error) {
Expand Down
4 changes: 2 additions & 2 deletions pkg/querier/querier.go
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ func (mq multiQuerier) mergeSeriesSets(sets []storage.SeriesSet) storage.SeriesS
}

if len(chunks) == 0 {
return storage.NewMergeSeriesSet(otherSets, storage.ChainedSeriesMerge)
return storage.NewMergeSeriesSet(otherSets, 0, storage.ChainedSeriesMerge)
}

// partitionChunks returns set with sorted series, so it can be used by NewMergeSeriesSet
Expand All @@ -561,7 +561,7 @@ func (mq multiQuerier) mergeSeriesSets(sets []storage.SeriesSet) storage.SeriesS
}

otherSets = append(otherSets, chunksSet)
return storage.NewMergeSeriesSet(otherSets, storage.ChainedSeriesMerge)
return storage.NewMergeSeriesSet(otherSets, 0, storage.ChainedSeriesMerge)
}

type sliceSeriesSet struct {
Expand Down
2 changes: 1 addition & 1 deletion pkg/querier/tenantfederation/merge_queryable.go
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ func (m *mergeQuerier) Select(ctx context.Context, sortSeries bool, hints *stora
return storage.ErrSeriesSet(err)
}

return storage.NewMergeSeriesSet(seriesSets, storage.ChainedSeriesMerge)
return storage.NewMergeSeriesSet(seriesSets, 0, storage.ChainedSeriesMerge)
}

type addLabelsSeriesSet struct {
Expand Down
44 changes: 22 additions & 22 deletions pkg/streamingpromql/testdata/ours/binary_operators.test
Original file line number Diff line number Diff line change
Expand Up @@ -276,16 +276,16 @@ load 1m
another_mixed{job="test"} 10 {{schema:0 sum:12 count:6 buckets:[2 4 6]}} {{schema:0 sum:12 count:6 buckets:[2 4 6]}} 4 5 {{schema:0 sum:12 count:6 buckets:[2 4 6]}}
# @0 @5m @10m @15m @20m @25m

eval range from 0 to 5m step 1m mixed_metric + another_mixed
eval_info range from 0 to 5m step 1m mixed_metric + another_mixed
{job="test"} 20 11 12 7 _ {{schema:0 sum:24 count:12 buckets:[4 8 12]}}

eval range from 0 to 5m step 1m mixed_metric - another_mixed
eval_info range from 0 to 5m step 1m mixed_metric - another_mixed
{job="test"} 0 -9 -8 -1 _ {{schema:0 sum:0 count:0}}

eval range from 0 to 5m step 1m mixed_metric * another_mixed
eval_info range from 0 to 5m step 1m mixed_metric * another_mixed
{job="test"} 100 10 20 12 {{schema:0 sum:30 count:15 buckets:[5 10 15]}} _

eval range from 0 to 5m step 1m mixed_metric / another_mixed
eval_info range from 0 to 5m step 1m mixed_metric / another_mixed
{job="test"} 1 0.1 0.2 0.75 {{schema:0 sum:1.2 count:0.6 buckets:[0.2 0.4 0.6]}} _

clear
Expand Down Expand Up @@ -317,18 +317,18 @@ eval range from 0m to 24m step 6m my_metric / 2

# Scalar on left side
# Note that positive scalar / histogram == nothing.
eval range from 0m to 24m step 6m 2 / my_metric
eval_info range from 0m to 24m step 6m 2 / my_metric
{histograms="both"} 0.4 0.2 _
{job="foo"} 2 1 0.6666666666666667 0.5 0.4
{job="bar"} 0.2 0.1 0.06666666666666667 _ 0.04

# Test other arithmetic operations.
eval range from 0m to 24m step 6m my_metric + 2
eval_info range from 0m to 24m step 6m my_metric + 2
{histograms="both"} 7 12 _
{job="foo"} 3 4 5 6 7
{job="bar"} 12 22 32 _ 52

eval range from 0m to 24m step 6m my_metric - 2
eval_info range from 0m to 24m step 6m my_metric - 2
{histograms="both"} 3 8
{job="foo"} -1 0 1 2 3
{job="bar"} 8 18 28 _ 48
Expand Down Expand Up @@ -552,7 +552,7 @@ eval_info range from 0 to 24m step 6m left_histograms == 0
eval_info range from 0 to 24m step 6m left_histograms != 3
# No results.

eval range from 0 to 24m step 6m left_histograms != 0
eval_info range from 0 to 24m step 6m left_histograms != 0
# No results.

eval_info range from 0 to 24m step 6m left_histograms > 3
Expand All @@ -561,7 +561,7 @@ eval_info range from 0 to 24m step 6m left_histograms > 3
eval_info range from 0 to 24m step 6m left_histograms > 0
# No results.

eval range from 0 to 24m step 6m left_histograms >= 3
eval_info range from 0 to 24m step 6m left_histograms >= 3
# No results.

eval_info range from 0 to 24m step 6m left_histograms >= 0
Expand All @@ -576,7 +576,7 @@ eval_info range from 0 to 24m step 6m left_histograms < 0
eval_info range from 0 to 24m step 6m left_histograms <= 3
# No results.

eval range from 0 to 24m step 6m left_histograms <= 0
eval_info range from 0 to 24m step 6m left_histograms <= 0
# No results.

eval_info range from 0 to 24m step 6m left_histograms == bool 3
Expand Down Expand Up @@ -649,40 +649,40 @@ eval range from 0 to 60m step 6m NaN == left_floats
eval range from 0 to 60m step 6m NaN == bool left_floats
{} 0 0 _ _ 0 _ 0 0 0 0 0

eval range from 0 to 24m step 6m 3 == left_histograms
eval_info range from 0 to 24m step 6m 3 == left_histograms
# No results.

eval range from 0 to 24m step 6m 0 == left_histograms
eval_info range from 0 to 24m step 6m 0 == left_histograms
# No results.

eval range from 0 to 24m step 6m 3 != left_histograms
eval_info range from 0 to 24m step 6m 3 != left_histograms
# No results.

eval range from 0 to 24m step 6m 0 != left_histograms
eval_info range from 0 to 24m step 6m 0 != left_histograms
# No results.

eval range from 0 to 24m step 6m 3 < left_histograms
eval_info range from 0 to 24m step 6m 3 < left_histograms
# No results.

eval range from 0 to 24m step 6m 0 < left_histograms
eval_info range from 0 to 24m step 6m 0 < left_histograms
# No results.

eval range from 0 to 24m step 6m 3 < left_histograms
eval_info range from 0 to 24m step 6m 3 < left_histograms
# No results.

eval range from 0 to 24m step 6m 0 < left_histograms
eval_info range from 0 to 24m step 6m 0 < left_histograms
# No results.

eval range from 0 to 24m step 6m 3 > left_histograms
eval_info range from 0 to 24m step 6m 3 > left_histograms
# No results.

eval range from 0 to 24m step 6m 0 > left_histograms
eval_info range from 0 to 24m step 6m 0 > left_histograms
# No results.

eval range from 0 to 24m step 6m 3 >= left_histograms
eval_info range from 0 to 24m step 6m 3 >= left_histograms
# No results.

eval range from 0 to 24m step 6m 0 >= left_histograms
eval_info range from 0 to 24m step 6m 0 >= left_histograms
# No results.

# Scalar / scalar combinations
Expand Down
Loading

0 comments on commit 76ab843

Please sign in to comment.