Skip to content

Commit

Permalink
refac: remove p.Metric usage
Browse files Browse the repository at this point in the history
Signed-off-by: Manik Rana <[email protected]>
  • Loading branch information
Maniktherana committed Oct 11, 2024
1 parent 50ef0dc commit 4fa5b0c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions model/textparse/openmetricsparse.go
Original file line number Diff line number Diff line change
Expand Up @@ -652,10 +652,9 @@ func (p *OpenMetricsParser) parseLVals(offsets []int, isExemplar bool) ([]int, e

// isCreatedSeries returns true if the current series is a _created series.
func (p *OpenMetricsParser) isCreatedSeries() bool {
var newLbs labels.Labels
p.Metric(&newLbs)
name := newLbs.Get(model.MetricNameLabel)
if typeRequiresCT(p.mtype) && strings.HasSuffix(name, "_created") {
s := string(p.series)
metricName := unreplace(s[p.offsets[0]-p.start : p.offsets[1]-p.start])
if typeRequiresCT(p.mtype) && strings.HasSuffix(metricName, "_created") {
return true
}
return false
Expand Down

0 comments on commit 4fa5b0c

Please sign in to comment.