Skip to content

Commit 61684df

Browse files
authored
Merge pull request #912 from go-graphite/njpm/support-plus-rune-in-metric-names
Add handling for '+' char in metric names in queries
2 parents 72cc73d + f544928 commit 61684df

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

pkg/parser/parser.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@ func IsNameChar(r byte) bool {
693693
r == '<' || r == '>' ||
694694
r == '&' || r == '#' ||
695695
r == '/' || r == '%' ||
696-
r == '@'
696+
r == '@' || r == '+'
697697
}
698698

699699
func IsDigit(r byte) bool {

pkg/parser/parser_test.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,13 @@ func TestParseExpr(t *testing.T) {
299299
etype: EtName,
300300
},
301301
},
302+
{
303+
`foo.b[0-9]+.qux`,
304+
&expr{
305+
target: "foo.b[0-9]+.qux",
306+
etype: EtName,
307+
},
308+
},
302309
{
303310
`virt.v1.*.text-match:<foo.bar.qux>`,
304311
&expr{

0 commit comments

Comments
 (0)