validate and tidy label key
This commit is contained in:
parent
3af20d1813
commit
95007aaf3c
|
@ -217,6 +217,10 @@ func convert(item *types.Sample) *prompb.TimeSeries {
|
|||
|
||||
// add other labels
|
||||
for k, v := range item.Labels {
|
||||
k = strings.Replace(k, "/", "_", -1)
|
||||
k = strings.Replace(k, ".", "_", -1)
|
||||
k = strings.Replace(k, "-", "_", -1)
|
||||
k = strings.Replace(k, " ", "_", -1)
|
||||
pt.Labels = append(pt.Labels, &prompb.Label{
|
||||
Name: k,
|
||||
Value: v,
|
||||
|
|
Loading…
Reference in New Issue