allow dot in metric name (#26)

This commit is contained in:
Василий Толстов 2021-07-07 15:36:08 +03:00 committed by GitHub
parent bfa3fbc1a7
commit 1aa57265d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -81,4 +81,4 @@ func validateIdent(s string) error {
return nil return nil
} }
var identRegexp = regexp.MustCompile("^[a-zA-Z_:][a-zA-Z0-9_:]*$") var identRegexp = regexp.MustCompile("^[a-zA-Z_:.][a-zA-Z0-9_:.]*$")

View File

@ -18,6 +18,7 @@ func TestValidateMetricSuccess(t *testing.T) {
f(`foo{bar="baz", x="y\"z"}`) f(`foo{bar="baz", x="y\"z"}`)
f(`foo{bar="b}az"}`) f(`foo{bar="b}az"}`)
f(`:foo:bar{bar="a",baz="b"}`) f(`:foo:bar{bar="a",baz="b"}`)
f(`some.foo{bar="baz"}`)
} }
func TestValidateMetricError(t *testing.T) { func TestValidateMetricError(t *testing.T) {