Skip to content

Commit

Permalink
default value of "UNKNOWN" all custom tags
Browse files Browse the repository at this point in the history
  • Loading branch information
ambarish-singh-miq committed Sep 26, 2023
1 parent 7af2a45 commit 70f2e46
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 70f2e46

Please sign in to comment.