VictoriaMetrics icon indicating copy to clipboard operation
VictoriaMetrics copied to clipboard

Precision error when specifying time in RFC3339 format vs. UNIX milliseconds

Open dandv opened this issue 2 years ago • 1 comments

Describe the bug

Certain times seem to trigger a 1ms error if specified in RFC3339 format instead of UNIX milliseconds. This can have consequences such as missing a point if the end parameter is specified in RFC3339 and a point at that timestamp does in fact exist.

To Reproduce

node -e 'console.log(new Date(time=1582301269433).toISOString())'  # 2020-02-21T16:07:49.433Z

# create a point
curl http://localhost:8428/api/v1/import/prometheus -d 'series1{label="foo"} 10 1582301269433'

export VMQURL=http://localhost:8428/api/v1/query

# misses the point
curl -s $VMQURL -d 'query=count_over_time(series1[1ms])' -d 'time=2020-02-21T16:07:49.433Z'

# 1ms later, does return the point
curl -s $VMQURL -d 'query=count_over_time(series1[1ms])' -d 'time=2020-02-21T16:07:49.434Z'

Version

victoria-metrics-20240130-205929-tags-v1.97.0-0-gfcc8b14f8

Logs

No response

Screenshots

No response

Used command-line flags

-retentionPeriod=100y -search.latencyOffset=1s

Additional information

No response

dandv avatar Feb 12 '24 22:02 dandv

#5814

Amper avatar Feb 16 '24 08:02 Amper

FYI, the fix for this issue has been included in v1.93.13 LTS release.

valyala avatar Mar 01 '24 00:03 valyala

FYI, the fix for this issue has been included in v1.97.3 LTS release.

valyala avatar Mar 01 '24 01:03 valyala

The fix for this issue has been included in v1.99.0 release. Closing the issue as fixed.

valyala avatar Mar 01 '24 03:03 valyala