mirror of
https://github.com/SigNoz/signoz.git
synced 2025-12-17 15:36:48 +00:00
fix(added-backticks): added backticks for hyphen (#8644)
* fix(added-backticks): added backticks for hyphen also * Update pkg/query-service/utils/format.go Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> --------- Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
This commit is contained in:
parent
c17241272f
commit
360285ef33
@ -245,8 +245,8 @@ func ClickHouseFormattedMetricNames(v interface{}) string {
|
||||
}
|
||||
|
||||
func AddBackTickToFormatTag(str string) string {
|
||||
if strings.Contains(str, ".") {
|
||||
return "`" + str + "`"
|
||||
if strings.Contains(str, ".") || strings.Contains(str, "-") {
|
||||
if strings.HasPrefix(str, "`") && strings.HasSuffix(str, "`") { return str } else { return "`" + str + "`" }
|
||||
} else {
|
||||
return str
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user