Skip to content

Commit

Permalink
Update to latest mimir-prometheus (grafana#10400)
Browse files Browse the repository at this point in the history
* Update to latest mimir-prometheus
Also implement new rule concurrency interface from prometheus/prometheus#15681

* MQE: Pull new functions test and fix _over_time functions
Same fix as prometheus/prometheus#15711 and similar to what was done during the last sync: grafana#10383

* Linting

* MQE: Use `.Any()` as suggested in PR

* Add CHANGELOG

* Remove sequentialRules, not needed
A nil slice will run rules sequentially

* Address PR comments

* Add test to check that group isn't mutated
  • Loading branch information
julienduchesne authored Jan 10, 2025
1 parent 6c186ae commit 91e5fb1
Show file tree
Hide file tree
Showing 31 changed files with 1,104 additions and 303 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* [ENHANCEMENT] Ingester: More efficient CPU/memory utilization-based read request limiting. #10325
* [ENHANCEMENT] Dashboards: Add Query-Scheduler <-> Querier Inflight Requests row to Query Reads and Remote Ruler reads dashboards. #10290
* [ENHANCEMENT] OTLP: In addition to the flag `-distributor.otel-created-timestamp-zero-ingestion-enabled` there is now `-distributor.otel-start-time-quiet-zero` to convert OTel start timestamps to Prometheus QuietZeroNaNs. This flag is to make the change rollout safe between Ingesters and Distributors. #10238
* [ENHANCEMENT] Ruler: When rule concurrency is enabled for a rule group, its rules will now be reordered and run in batches based on their dependencies. This increases the number of rules that can potentially run concurrently. Note that the global and tenant-specific limits still apply #10400
* [BUGFIX] Distributor: Use a boolean to track changes while merging the ReplicaDesc components, rather than comparing the objects directly. #10185
* [BUGFIX] Querier: fix timeout responding to query-frontend when response size is very close to `-querier.frontend-client.grpc-max-send-msg-size`. #10154
* [BUGFIX] Query-frontend and querier: show warning/info annotations in some cases where they were missing (if a lazy querier was used). #10277
Expand All @@ -25,6 +26,8 @@
* [BUGFIX] Mimirtool: `remote-read` commands will now return data. #10286
* [BUGFIX] PromQL: Fix deriv, predict_linear and double_exponential_smoothing with histograms https://github.com/prometheus/prometheus/pull/15686 #10383
* [BUGFIX] MQE: Fix deriv with histograms #10383
* [BUGFIX] PromQL: Fix <aggr_over_time> functions with histograms https://github.com/prometheus/prometheus/pull/15711 #10400
* [BUGFIX] MQE: Fix <aggr_over_time> functions with histograms #10400

### Mixin

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ require (
sigs.k8s.io/yaml v1.4.0 // indirect
)

replace github.com/prometheus/prometheus => github.com/grafana/mimir-prometheus v0.0.0-20250109135143-114aaaadc203
replace github.com/prometheus/prometheus => github.com/grafana/mimir-prometheus v0.0.0-20250110020350-a1e2bcf4a615

// Replace memberlist with our fork which includes some fixes that haven't been
// merged upstream yet:
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1283,8 +1283,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-20250109135143-114aaaadc203 h1:gCU3GO2mZUzsLAa/JRRDJpKbYhkXy7caWnzfNqbgDig=
github.com/grafana/mimir-prometheus v0.0.0-20250109135143-114aaaadc203/go.mod h1:KfyZCeyGxf5gvl6VZbrQsd400nJjGw+ygMEtDVZKIT4=
github.com/grafana/mimir-prometheus v0.0.0-20250110020350-a1e2bcf4a615 h1:lr3wUcXU0mScCDn/4NXc0CYglZJfy5l35sOJFar9qE0=
github.com/grafana/mimir-prometheus v0.0.0-20250110020350-a1e2bcf4a615/go.mod h1:KfyZCeyGxf5gvl6VZbrQsd400nJjGw+ygMEtDVZKIT4=
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
22 changes: 22 additions & 0 deletions pkg/ruler/fixtures/rules_chain.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
groups:
- name: chain
rules:
# Evaluated concurrently, no dependencies
- record: job:http_requests:rate1m
expr: sum by (job)(rate(http_requests_total[1m]))
- record: job:http_requests:rate5m
expr: sum by (job)(rate(http_requests_total[1m]))

# Evaluated sequentially, dependents and dependencies
- record: job1:http_requests:rate1m
expr: job:http_requests:rate1m{job="job1"}
- record: job1_cluster1:http_requests:rate1m
expr: job1:http_requests:rate1m{cluster="cluster1"}

# Evaluated concurrently, no dependents
- record: job1_cluster2:http_requests:rate1m
expr: job1:http_requests:rate1m{cluster="cluster2"}
- record: job1_cluster1_namespace1:http_requests:rate1m
expr: job1_cluster1:http_requests:rate1m{namespace="namespace1"}
- record: job1_cluster1_namespace2:http_requests:rate1m
expr: job1_cluster1:http_requests:rate1m{namespace="namespace2"}
18 changes: 18 additions & 0 deletions pkg/ruler/fixtures/rules_indeterminates.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
groups:
- name: indeterminate
rules:
# This shouldn't run in parallel because of the open matcher
- record: job:http_requests:rate1m
expr: sum by (job)(rate(http_requests_total[1m]))
- record: job:http_requests:rate5m
expr: sum by (job)(rate(http_requests_total[5m]))
- record: job:http_requests:rate15m
expr: sum by (job)(rate(http_requests_total[15m]))
- record: job:http_requests:rate30m
expr: sum by (job)(rate(http_requests_total[30m]))
- record: job:http_requests:rate1h
expr: sum by (job)(rate(http_requests_total[1h]))
- record: job:http_requests:rate2h
expr: sum by (job)(rate(http_requests_total[2h]))
- record: matcher
expr: '{job="job1"}'
15 changes: 15 additions & 0 deletions pkg/ruler/fixtures/rules_multiple_independent.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
groups:
- name: independents
rules:
- record: job:http_requests:rate1m
expr: sum by (job)(rate(http_requests_total[1m]))
- record: job:http_requests:rate5m
expr: sum by (job)(rate(http_requests_total[5m]))
- record: job:http_requests:rate15m
expr: sum by (job)(rate(http_requests_total[15m]))
- record: job:http_requests:rate30m
expr: sum by (job)(rate(http_requests_total[30m]))
- record: job:http_requests:rate1h
expr: sum by (job)(rate(http_requests_total[1h]))
- record: job:http_requests:rate2h
expr: sum by (job)(rate(http_requests_total[2h]))
Loading

0 comments on commit 91e5fb1

Please sign in to comment.