diff --git a/tags.go b/tags.go index 972ead2..f1e50ba 100644 --- a/tags.go +++ b/tags.go @@ -14,7 +14,7 @@ const ( ) // illegalTagValueChars are loosely set to ensure we don't have statsd parse errors. -var illegalTagValueChars = regexp.MustCompile(`[:|]`) +var illegalTagValueChars = regexp.MustCompile(`[:|.]`) type tagPair struct { dimension string diff --git a/tags_test.go b/tags_test.go index fc742a5..43379b6 100644 --- a/tags_test.go +++ b/tags_test.go @@ -27,3 +27,11 @@ func TestSerializeIllegalTags(t *testing.T) { t.Errorf("Serialized output (%s) didn't match expected output", serialized) } } + +func TestSerializeTagValuePeriod(t *testing.T) { + tags := map[string]string{"foo": "blah.blah", "q": "p"} + serialized := serializeTags(tags) + if serialized != ".__foo=blah_blah.__q=p" { + t.Errorf("Serialized output (%s) didn't match expected output", serialized) + } +}