Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update vendored mimir-prometheus #4432

Merged
merged 1 commit into from
Mar 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
* [ENHANCEMENT] Compactor: added experimental configuration parameter `-compactor.first-level-compaction-wait-period`, to configure how long the compactor should wait before compacting 1st level blocks (uploaded by ingesters). This configuration option allows to reduce the chances compactor begins compacting blocks before all ingesters have uploaded their blocks to the storage. #4401
* [ENHANCEMENT] Store-gateway: use more efficient chunks fetching and caching. #4255
* [ENHANCEMENT] Query-frontend and ruler: add experimental, more performant protobuf internal query result response format enabled with `-ruler.query-frontend.query-result-response-format=protobuf`. #4331
* [ENHANCEMENT] Ruler: increased tolerance for missed iterations on alerts, reducing the chances of flapping firing alerts during ruler restarts. #4432
* [ENHANCEMENT] Querier and store-gateway: optimized `.*` and `.+` regular expression label matchers. #4432

### Mixin

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ require (
)

// Using a fork of Prometheus with Mimir-specific changes.
replace github.com/prometheus/prometheus => github.com/grafana/mimir-prometheus v0.0.0-20230302162052-1e7ad0ec11fe
replace github.com/prometheus/prometheus => github.com/grafana/mimir-prometheus v0.0.0-20230309083841-242e82b8e667

// Pin hashicorp depencencies since the Prometheus fork, go mod tries to update them.
replace github.com/hashicorp/go-immutable-radix => github.com/hashicorp/go-immutable-radix v1.2.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -505,8 +505,8 @@ github.com/grafana/gomemcache v0.0.0-20230221082510-6cde04bf2270 h1:cj3uiNKskh+/
github.com/grafana/gomemcache v0.0.0-20230221082510-6cde04bf2270/go.mod h1:PGk3RjYHpxMM8HFPhKKo+vve3DdlPUELZLSDEFehPuU=
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-20230302162052-1e7ad0ec11fe h1:WYj9zGt/ZVg2aBijj+QTSfJGieg3uV/H+1Isv4rNao8=
github.com/grafana/mimir-prometheus v0.0.0-20230302162052-1e7ad0ec11fe/go.mod h1:XHIzUaYXL352XOhSF/R0eZ+/k2x6u5de/d/X9VWwVnI=
github.com/grafana/mimir-prometheus v0.0.0-20230309083841-242e82b8e667 h1:fsY1JTaeHdpU2PZKrw6U5jazlaCoG8CE4As6Q0268LI=
github.com/grafana/mimir-prometheus v0.0.0-20230309083841-242e82b8e667/go.mod h1:XHIzUaYXL352XOhSF/R0eZ+/k2x6u5de/d/X9VWwVnI=
github.com/grafana/regexp v0.0.0-20221005093135-b4c2bcb0a4b6 h1:A3dhViTeFDSQcGOXuUi6ukCQSMyDtDISBp2z6OOo2YM=
github.com/grafana/regexp v0.0.0-20221005093135-b4c2bcb0a4b6/go.mod h1:M5qHK+eWfAv8VR/265dIuEpL3fNfeC21tXXp9itM24A=
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
Expand Down
2 changes: 1 addition & 1 deletion pkg/ingester/activeseries/matchers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ func TestAmlabelMatchersToProm_HappyCase(t *testing.T) {
require.NoError(t, err)

expected := labels.MustNewMatcher(labels.MatchRegexp, "foo", "bar.*")
assert.Equal(t, expected, amlabelMatcherToProm(amMatcher))
assert.Equal(t, expected.String(), amlabelMatcherToProm(amMatcher).String())
}

func TestAmlabelMatchersToProm_MatchTypeValues(t *testing.T) {
Expand Down
9 changes: 7 additions & 2 deletions pkg/ingester/client/compat_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,13 @@ func TestQueryRequest(t *testing.T) {
if !reflect.DeepEqual(haveTo, to) {
t.Fatalf("Bad to FromQueryRequest(ToQueryRequest) round trip")
}
if !reflect.DeepEqual(haveMatchers, matchers) {
t.Fatalf("Bad have FromQueryRequest(ToQueryRequest) round trip - %v != %v", haveMatchers, matchers)

// Assert same matchers. We do some optimizations in mimir-prometheus which make
// the label matchers not comparable with reflect.DeepEqual() so we're going to
// compare their string representation.
require.Len(t, haveMatchers, len(matchers))
for i := 0; i < len(matchers); i++ {
assert.Equal(t, matchers[i].String(), haveMatchers[i].String())
}
}

Expand Down
9 changes: 8 additions & 1 deletion pkg/storage/sharding/label_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,15 @@ func TestRemoveShardFromMatchers(t *testing.T) {
t.Run(testName, func(t *testing.T) {
actualShard, actualMatchers, actualError := RemoveShardFromMatchers(testData.input)
assert.Equal(t, testData.expectedShard, actualShard)
assert.Equal(t, testData.expectedMatchers, actualMatchers)
assert.Equal(t, testData.expectedError, actualError)

// Assert same matchers. We do some optimizations in mimir-prometheus which make
// the label matchers not comparable with reflect.DeepEqual() so we're going to
// compare their string representation.
require.Len(t, actualMatchers, len(testData.expectedMatchers))
for i := 0; i < len(testData.expectedMatchers); i++ {
assert.Equal(t, testData.expectedMatchers[i].String(), actualMatchers[i].String())
}
})
}
}
Expand Down
116 changes: 80 additions & 36 deletions vendor/github.com/prometheus/prometheus/model/labels/regexp.go

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

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

4 changes: 2 additions & 2 deletions vendor/modules.txt

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