Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Graphite formatted metric with -1 timestamp #610

Closed
jenmud opened this issue Jul 8, 2020 · 2 comments
Closed

Graphite formatted metric with -1 timestamp #610

jenmud opened this issue Jul 8, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@jenmud
Copy link

jenmud commented Jul 8, 2020

Describe the bug
When inserting a graphite metric using the Graphite message format metric_path value timestamp and the timestamp is -1, the row is skipped and with the following error message in the logs

2020-07-08T08:35:04.507Z        error   VictoriaMetrics/lib/storage/storage.go:1155     warn occurred during rows addition: cannot insert row with too small timestamp -1000 outside the retention; minimum allowed timestamp is 1591518903000

This behavior does not conform to the graphite spec outlined here where is states that if the timestamp is -1 it will use the time of arrival.

To Reproduce
Send a graphite metric with a -1 timestamp

echo "foo.bar.baz;tag1=value1;tag2=value2 123 -1" | nc -N localhost 2003

Expected behavior
Metric should be inserted into the data with the timestamp when the message arrived and processed by the database.

Screenshots
If applicable, add screenshots to help explain your problem.

Version

$ ./victoria-metrics-prod --version
victoria-metrics-20200701-115333-tags-v1.37.4-0-g8da3f773a
@valyala valyala added the bug Something isn't working label Jul 8, 2020
valyala added a commit that referenced this issue Jul 8, 2020
valyala added a commit that referenced this issue Jul 8, 2020
@valyala
Copy link
Collaborator

valyala commented Jul 8, 2020

@jenmud , thanks for the bug report. It should be fixed in the commit eb45185 . This commit will be included in the next release. In the mean time you may build VictoriaMetrics from this commit according to these instructions.

There are the following workarounds for the bug:

  • VictoriaMetrics accepts 0 timestamp in Graphite protocol and translates it to the current timestamp.
  • VictoriaMetrics accepts Graphite lines without timestamp, i.e. foo 123 is translated to a foo metric with 123 value and with the current timestamp.

@valyala
Copy link
Collaborator

valyala commented Jul 8, 2020

@jenmud , VictoriaMetrics should properly handle -1 timestamp in Graphite plaintext protocol starting from v1.38.0. Closing the issue as fixed.

@valyala valyala closed this as completed Jul 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants