From 1aa57265d484e3bb04c1cc998c793c0749130211 Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Wed, 7 Jul 2021 15:36:08 +0300 Subject: [PATCH] allow dot in metric name (#26) --- validator.go | 2 +- validator_test.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/validator.go b/validator.go index 27e88ca..9960189 100644 --- a/validator.go +++ b/validator.go @@ -81,4 +81,4 @@ func validateIdent(s string) error { return nil } -var identRegexp = regexp.MustCompile("^[a-zA-Z_:][a-zA-Z0-9_:]*$") +var identRegexp = regexp.MustCompile("^[a-zA-Z_:.][a-zA-Z0-9_:.]*$") diff --git a/validator_test.go b/validator_test.go index d90b62d..8a5d734 100644 --- a/validator_test.go +++ b/validator_test.go @@ -18,6 +18,7 @@ func TestValidateMetricSuccess(t *testing.T) { f(`foo{bar="baz", x="y\"z"}`) f(`foo{bar="b}az"}`) f(`:foo:bar{bar="a",baz="b"}`) + f(`some.foo{bar="baz"}`) } func TestValidateMetricError(t *testing.T) {