newrelic / infra-integrations-sdk

New Relic Infrastructure Integrations SDK
Apache License 2.0
46 stars 24 forks source link

Deal with inf upper buond values #267

Open paologallinaharbur opened 3 years ago

paologallinaharbur commented 3 years ago

Currently if the upper bound of a bucket is inf the bucket is discarded. I believe we should take care of such range in a better way to avoid losing values. Currently with a metric like:

# HELP powerdns_recursor_response_time_seconds Histogram of PowerDNS recursor response times in seconds.
# TYPE powerdns_recursor_response_time_seconds histogram
powerdns_recursor_response_time_seconds_bucket{le="0.001"} 0
powerdns_recursor_response_time_seconds_bucket{le="0.01"} 0
powerdns_recursor_response_time_seconds_bucket{le="0.1"} 0
powerdns_recursor_response_time_seconds_bucket{le="1"} 0
powerdns_recursor_response_time_seconds_bucket{le="+Inf"} 0

we would lose everything in the range 1<x<inf

https://github.com/newrelic/infra-integrations-sdk/blob/786cf26d3cdd3b8701c686be3f6a7ea25bc784b2/data/metric/metrics.go#L245