The metric available_buffer_space_ratios from buffer plugin is always at 100 % because of misusage of the round function.
It is computed through the following code https://github.com/fluent/fluentd/pull/2450/files#diff-7d794f77abc9222413b9120533cff327R745
with an integer round (no ndigits given defaults to 0).
Hence, the ratio of used buffer ((@stage_size + @queue_size * 1.0) / @total_limit_size).round is always equals to 0 and available one is always 1.
The round should take a decent ndigits argument such as 2 for an integer percent ratio or 3 for 1 digit after decimal point.
The metric
available_buffer_space_ratiosfrom buffer plugin is always at 100 % because of misusage of theroundfunction.It is computed through the following code https://github.com/fluent/fluentd/pull/2450/files#diff-7d794f77abc9222413b9120533cff327R745
with an integer
round(nondigitsgiven defaults to 0).Hence, the ratio of used buffer
((@stage_size + @queue_size * 1.0) / @total_limit_size).roundis always equals to 0 and available one is always 1.The
roundshould take a decentndigitsargument such as2for an integer percent ratio or3for 1 digit after decimal point.