Skip to content

Commit

Permalink
Merge pull request prometheus#12994 from prometheus/beorn7/release
Browse files Browse the repository at this point in the history
Merge release-2.48 back into main
  • Loading branch information
beorn7 authored Oct 17, 2023
2 parents f33bffa + ca450a6 commit 16af867
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion promql/functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func extrapolatedRate(vals []parser.Value, args parser.Expressions, enh *EvalNod
return enh.Out, annos.Add(annotations.NewMixedFloatsHistogramsWarning(metricName, args[0].PositionRange()))
}

if isCounter &&
if isCounter && metricName != "" && len(samples.Floats) > 0 &&
!strings.HasSuffix(metricName, "_total") &&
!strings.HasSuffix(metricName, "_sum") &&
!strings.HasSuffix(metricName, "_count") &&
Expand Down
4 changes: 2 additions & 2 deletions util/annotations/annotations.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ func NewMixedClassicNativeHistogramsWarning(metricName string, pos posrange.Posi
}
}

// NewPossibleNonCounterInfo is used when a counter metric does not have the suffixes
// _total, _sum, _count, or _bucket.
// NewPossibleNonCounterInfo is used when a named counter metric with only float samples does not
// have the suffixes _total, _sum, _count, or _bucket.
func NewPossibleNonCounterInfo(metricName string, pos posrange.PositionRange) annoErr {
return annoErr{
PositionRange: pos,
Expand Down

0 comments on commit 16af867

Please sign in to comment.