Skip to content

Commit

Permalink
pump custom metrics default vaue
Browse files Browse the repository at this point in the history
  • Loading branch information
ambarish-singh-miq committed Sep 29, 2023
1 parent 7af2a45 commit 85844ad
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions pumps/prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,19 @@ func (pm *PrometheusMetric) GetLabelsValues(decoded analytics.AnalyticsRecord) [
for _, label := range pm.Labels {
if val, ok := mapping[label]; ok {
values = append(values, fmt.Sprint(val))
}else{
// log.Info(label)
val = "UNKNOWN"
for _, tag := range decoded.Tags{
prefixString := label + "-"
if strings.HasPrefix(tag,prefixString){
val = tag[len(prefixString):]
break
}
}
if label != "type" {
values = append(values, fmt.Sprint(val))
}
}
}
return values
Expand Down

0 comments on commit 85844ad

Please sign in to comment.