fix(prom-aggr): added fix for prom aggregation

This commit is contained in:
aniket 2025-06-16 17:25:19 +05:30
parent 7f19df18c3
commit 68291eee90

View File

@ -2,6 +2,7 @@ package clickhouseprometheus
import (
"encoding/json"
"strings"
"github.com/prometheus/prometheus/prompb"
)
@ -17,7 +18,12 @@ func unmarshalLabels(s string) ([]prompb.Label, string, error) {
for n, v := range m {
if n == "__name__" {
metricName = v
} else {
if strings.Contains(n, ".") {
n = `"` + n + `"`
}
}
res = append(res, prompb.Label{
Name: n,
Value: v,