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

NaN values being saved in Whisper datafiles #17

Closed
xneo64 opened this issue Nov 2, 2015 · 3 comments
Closed

NaN values being saved in Whisper datafiles #17

xneo64 opened this issue Nov 2, 2015 · 3 comments

Comments

@xneo64
Copy link

xneo64 commented Nov 2, 2015

hi @lomik , With reference to https://bugs.launchpad.net/graphite/+bug/867882

Somehow I'm finding my whisper files to contain nan, and while this is valid from a python JSON spec, it's breaking the Grafana javascript code which parses the JSON from graphite. And causes an error and does not plot graphs.

Apparently carbon-cache was patched to eliminate such cases of writing nan to the whisper files. Can you look into this?

@xneo64
Copy link
Author

xneo64 commented Nov 3, 2015

to further illustrate, here's an example of the cpu data gathered from collectd. This data is replicated and pushed to two hosts, one runs go-carbon, and the other carbon-cache:

with go-carbon gives the below two occurrences:
whisper-dump.py /home/graphite/storage/dc1/apphost00/cpu/0/cpu/interrupt.wsp | grep nan
0: 1446541000, nan
0: 1446540960, nan

while with carbon-cache no nan is found in .wsp files. Looking up these timestamps in carbon-cache's wsp files, they're not to be found. It seems that the default behaviour here is to drop any write to whisper containing 'nan'

@xneo64
Copy link
Author

xneo64 commented Nov 10, 2015

hello again @lomik i was able to achieve this by adding the below condition in whisper.go before the write happens:

if !math.IsNaN(r.Value) {
    points[i] = &whisper.TimeSeriesPoint{Time: int(r.Timestamp), Value: r.Value}
}

naturally, in the beginning I also had to define importing of math

@ahayworth
Copy link
Contributor

We are experiencing the same bug in production. Pull #27 fixes it (with tests, too!).

❤️

@lomik lomik closed this as completed in #27 Dec 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants