Skip to content

Commit

Permalink
handle values contain +
Browse files Browse the repository at this point in the history
Signed-off-by: yeya24 <[email protected]>
  • Loading branch information
yeya24 committed Jan 29, 2025
1 parent eaf3e57 commit aa3edb0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions walk.go
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,11 @@ func (s *PromQLSmith) walkLabelMatchers() []*labels.Matcher {
})

valF := func(v string) string {
// If a label value contains + such as +Inf it will cause parse error for regex.
// Always hardcode to .+ for simplicity.
if strings.Contains(v, "+") {
return ".+"
}
val := s.rnd.Float64()
switch {
case val > 0.95:
Expand Down

0 comments on commit aa3edb0

Please sign in to comment.