From 5c67297dcef63bef4a52b506ebcc55d670f34867 Mon Sep 17 00:00:00 2001 From: Deluan Date: Mon, 10 Mar 2025 07:14:17 -0400 Subject: [PATCH] fix(server): panic when logging tag type. Fix #3790 Signed-off-by: Deluan --- model/tag_mappings.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/model/tag_mappings.go b/model/tag_mappings.go index 3215feb35..b0cf85fae 100644 --- a/model/tag_mappings.go +++ b/model/tag_mappings.go @@ -55,6 +55,7 @@ func (c TagConf) SplitTagValue(values []string) []string { type TagType string const ( + TagTypeString TagType = "string" TagTypeInteger TagType = "int" TagTypeFloat TagType = "float" TagTypeDate TagType = "date" @@ -113,8 +114,9 @@ func collectTags(tagMappings, normalized map[TagName]TagConf) { aliases = append(aliases, strings.ToLower(val)) } if v.Split != nil { - if v.Type != "" { - log.Error("Tag splitting only available for string types", "tag", k, "split", v.Split, "type", v.Type) + if v.Type != "" && v.Type != TagTypeString { + log.Error("Tag splitting only available for string types", "tag", k, "split", v.Split, + "type", string(v.Type)) v.Split = nil } else { v.SplitRx = compileSplitRegex(k, v.Split)