File tree Expand file tree Collapse file tree 1 file changed +2
-7
lines changed Expand file tree Collapse file tree 1 file changed +2
-7
lines changed Original file line number Diff line number Diff line change @@ -252,15 +252,10 @@ func (service *Service) metric2Row(metric model.Metric, msg *model.InputMessage)
252
252
dim := service .dims [i ]
253
253
val := model .GetValueByType (metric , dim )
254
254
row = append (row , val )
255
- if dim .Type .Type == model .String && dim .Name != service .nameKey && dim .Name != "le" && (service .lblBlkList == nil || ! service .lblBlkList .MatchString (dim .Name )) {
255
+ if val != nil && dim .Type .Type == model .String && dim .Name != service .nameKey && dim .Name != "le" && (service .lblBlkList == nil || ! service .lblBlkList .MatchString (dim .Name )) {
256
256
// "labels" JSON excludes "le", so that "labels" can be used as group key for histogram queries.
257
257
// todo: what does "le" mean?
258
- var labelVal string
259
- if val == nil {
260
- labelVal = "null"
261
- } else {
262
- labelVal = val .(string )
263
- }
258
+ labelVal := val .(string )
264
259
labels = append (labels , fmt .Sprintf (`%s: %s` , strconv .Quote (dim .Name ), strconv .Quote (labelVal )))
265
260
}
266
261
}
You can’t perform that action at this time.
0 commit comments