Open jonathan-albrecht-ibm opened 1 year ago
Hi there - this still exists in 8.6.2 release - any updates on this issue?
Hi! We just realized that we haven't looked into this issue in a while. We're sorry!
We're labeling this issue as Stale
to make it hit our filters and make sure we get back to it as soon as possible. In the meantime, it'd be extremely helpful if you could take a look at it as well and confirm its relevance. A simple comment with a nice emoji will be enough :+1
.
Thank you for your contribution!
👍 yes, still relevant
because the histograms are missing buckets that have the expected value 0.
For openmetrics and prometheus histograms, some values like
Bucket.CumulativeCount
are stored as int64 after being parsed as float64 from the openmetrics text parser or prometheusexpfmt
parser. Later, these values are filtered out if they areNaN
orInf
with code like:but casting
math.NaN()
andmath.Inf(0)
toint64
are platform dependent in go. I don't think these casts really make sense sinceNaN
andInf
are floating point special values and integers don't have the same concepts. On amd64:but on arm64 and s390x:
so the
int64
check to filter outNaN
andInf
is true wheneverbucket.GetCumulativeCount() == 0
on non-amd64 platforms. Even on amd64 it will filter outbucket.GetCumulativeCount() == 9223372036854775808
but that's not a common value.For openmetrics, since the structs in
metricbeat/helper/openmetrics/openmetrics.go
are really just data transfer objects, if all the fields were kept asfloat64
(since the text parser parses numbers tofloat64
) then the checks forNaN
andInf
could be done correctly later on.For prometheus, the
expfmt
parser casts these values toint64
internally soNaN
and-Inf
values are converted to zero on non-amd64 platforms. I think the only fix would be to not do the check forNaN
onint64
values. Maybe this could be done for non-amd64 platforms if you want to keep the current amd64 behaviour.I hope the above is helpful. Please let me know if I can provide any more info.