You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Histogram buckets such as .005 or 1e-3 are parsed as 0 or 1 #273
The buckets parameter of a histogram <metric> converts any value that does not match digits.digits with String#to_i:
e[/\A\d+.\d+\Z/] ? e.to_f : e.to_i
As a result:
buckets .005, .01, .025 (the notation used by the default buckets of the Go and Python clients) becomes [0, 0, 0]. Every observation lands in the +Inf bucket, without any error.
buckets 1e-3, 1e-2, 0.1 becomes [1, 1, 0.1], and Fluentd fails to start with Unsorted buckets, typo?.
A value that is not a number, such as abc, becomes 0 instead of being reported as a configuration error.
To reproduce
<metric>
name request_seconds
type histogram
desc Request duration.
key duration
buckets .005, .01, .025
</metric>
Send records with duration 0.007 and read /metrics. All le buckets other than +Inf stay at 0, and the bucket labels are le="0".
Expected behavior
.005 parses as 0.005 and 1e-3 as 0.001. A value that is not a number raises a ConfigError.
Activity