mirror of
https://github.com/SigNoz/signoz.git
synced 2025-12-21 17:36:37 +00:00
fix(prom-aggr): added fix for prom aggregation
This commit is contained in:
parent
7f19df18c3
commit
68291eee90
@ -2,6 +2,7 @@ package clickhouseprometheus
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/prometheus/prometheus/prompb"
|
"github.com/prometheus/prometheus/prompb"
|
||||||
)
|
)
|
||||||
@ -17,7 +18,12 @@ func unmarshalLabels(s string) ([]prompb.Label, string, error) {
|
|||||||
for n, v := range m {
|
for n, v := range m {
|
||||||
if n == "__name__" {
|
if n == "__name__" {
|
||||||
metricName = v
|
metricName = v
|
||||||
|
} else {
|
||||||
|
if strings.Contains(n, ".") {
|
||||||
|
n = `"` + n + `"`
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
res = append(res, prompb.Label{
|
res = append(res, prompb.Label{
|
||||||
Name: n,
|
Name: n,
|
||||||
Value: v,
|
Value: v,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user