Skip to content

Commit

Permalink
nit: refactor code following PR feedback
Browse files Browse the repository at this point in the history
Signed-off-by: Rayhan Hossain <[email protected]>
  • Loading branch information
hossain-rayhan committed May 5, 2021
1 parent f557e60 commit a4d48a5
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions processor/metricstransformprocessor/metrics_transform_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,8 @@ func (f internalFilterStrict) labelMatched(metric *metricspb.Metric) bool {
}

keyFound = true
for _, timeseries := range metric.Timeseries {
if timeseries.LabelValues[idx].Value != value {
return false
}
break
if len(metric.Timeseries) > 0 && metric.Timeseries[0].LabelValues[idx].Value != value {
return false
}
}

Expand Down Expand Up @@ -159,11 +156,8 @@ func (f internalFilterRegexp) labelMatched(metric *metricspb.Metric) bool {
}

keyFound = true
for _, timeseries := range metric.Timeseries {
if !value.MatchString(timeseries.LabelValues[idx].Value) {
return false
}
break
if len(metric.Timeseries) > 0 && !value.MatchString(metric.Timeseries[0].LabelValues[idx].Value) {
return false
}
}

Expand Down

0 comments on commit a4d48a5

Please sign in to comment.