Victoriametrics: ttf() output becomes NaN if input increases

Created on 9 Sep 2020  路  8Comments  路  Source: VictoriaMetrics/VictoriaMetrics

Describe the bug
The output of ttf(vm_free_disk_space_bytes{job="victoria-metrics"}) is usually NaN.

I tried it as a range query and instant query.

The function is not documented in detail, so I don't know how many data points are considered, etc. to judge the output.

Screenshots
Screen Shot 2020-09-09 at 12 40 34 PM
Screen Shot 2020-09-09 at 12 43 20 PM

Version
v1.40.0

bug

All 8 comments

Here is an attempt with [2d] vector. The series abruptly stops.

I can speculate that perhaps ttf() doesn't handle increasing free space, which may happen due to compression etc.

Screen Shot 2020-09-09 at 12 47 55 PM

if ttf() doesn't produce a usable value at the end of the range, it cannot be used with instant query for alerting, etc.

evidence that NaN output may be related to NaN or increase of input

query here is ttf(vm_free_disk_space_bytes{job="victoria-metrics"}[1h])

Screen Shot 2020-09-09 at 1 49 56 PM

conclusion: it's caused by increases in source series

Screen Shot 2020-09-09 at 2 02 54 PM

aside: for the original use case of estimating VM storage full, I found it's much better to derive it from ingestion rate rather than free storage rate

# seconds_until_full_estimate = free_bytes / (datapoint_rate[1d] * bytes_per_datapoint)
vm_free_disk_space_bytes / (sum(rate(vm_rows_inserted_total[1d])) *
    (sum(vm_data_size_bytes{type !="indexdb"}) / sum(vm_rows{type != "indexdb"})))

for the original use case of estimating VM storage full, I found it's much better to derive it from ingestion rate rather than free storage rate

This looks much better than generic ttf(vm_free_disk_space_bytes)! Thanks for doing this!

As for missing results for ttf(), could you build VictoriaMetrics from commit 2114179e1935e1e1ab3376638419b69a62ac37e7 and verify whether it fixes the issue with missing ttf() results? See build instructions. It is also recommended passing big time range inside square brackets to ttf in order to get smooth graphs. For example, ttf(m[1h]).

FYI, the commit mentioned above has been included in v1.41.0.

ttf() function appears to be fixed

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ozn0417 picture ozn0417  路  3Comments

isality picture isality  路  3Comments

jelmd picture jelmd  路  3Comments

pmitra43 picture pmitra43  路  3Comments

genericgithubuser picture genericgithubuser  路  4Comments