Skip to content

Commit

Permalink
Add handling for '+' char in metric names in queries (#93)
Browse files Browse the repository at this point in the history
Add handling for + char in metric names
  • Loading branch information
carrieedwards authored and npazosmendez committed Sep 21, 2022
1 parent c10d5d9 commit 5cd8456
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/parser/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ func IsNameChar(r byte) bool {
r == '<' || r == '>' ||
r == '&' || r == '#' ||
r == '/' || r == '%' ||
r == '@'
r == '@' || r == '+'
}

func isDigit(r byte) bool {
Expand Down
7 changes: 7 additions & 0 deletions pkg/parser/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,13 @@ func TestParseExpr(t *testing.T) {
etype: EtName,
},
},
{
`foo.b[0-9]+.qux`,
&expr{
target: "foo.b[0-9]+.qux",
etype: EtName,
},
},
{
`virt.v1.*.text-match:<foo.bar.qux>`,
&expr{
Expand Down

0 comments on commit 5cd8456

Please sign in to comment.