Skip to content

Commit

Permalink
generate equal empty string label matcher (#144)
Browse files Browse the repository at this point in the history
  • Loading branch information
yeya24 authored Feb 3, 2025
1 parent 22983b2 commit cbb5738
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion walk.go
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,11 @@ func (s *PromQLSmith) walkLabelMatchers() []*labels.Matcher {
matchType := labels.MatchType(res)
switch matchType {
case labels.MatchEqual:
matcher = labels.MustNewMatcher(labels.MatchEqual, lbls[orders[i]].Name, lbls[orders[i]].Value)
val := lbls[orders[i]].Value
if s.rnd.Float64() > 0.9 {
val = ""
}
matcher = labels.MustNewMatcher(labels.MatchEqual, lbls[orders[i]].Name, val)
case labels.MatchNotEqual:
val := lbls[orders[i]].Value
if s.rnd.Float64() > 0.9 {
Expand Down

0 comments on commit cbb5738

Please sign in to comment.