Closed Rici11 closed 9 years ago
reproduced with same scenario.
parsing "14192584153982": value out of range
edit: temporary solve this issue by dividing the value of the timestamp by 100000 before sending it.
For some reason, in Send-BulkGraphiteMetrics.ps1, you need to add ".ToString()" to this statement: [uint64]$UnixTime = (Get-Date -Date $utcDate -UFormat %s) after $utcDate. It would be: [uint64]$UnixTime = (Get-Date -Date $utcDate.ToString() -UFormat %s)
We also commented this section: [Parameter(Mandatory = $true, ParameterSetName = 'Epoch / Unix Time')] [ValidateRange(1, 99999999999999)] [string]$UnixTime,
Can you all please try the following and let me know if you have success:
from:
[uint64]$UnixTime = (Get-Date -Date $utcDate -UFormat %s)
to:
[int]$UnixTime = [math]::Round((Get-Date -Date $utcDate -UFormat %s))
If you have success please let me know and I will release this with some InfluxDB documentation.
The problem is that on some locales Get-Date returns a string with a "," instead of a "." as decimal point (in german for example). Make a string replace "," to "." and it works.
Based on this, seems like the most invariant fix to this would be:
[uint64]$UnixTime = [double]::Parse((Get-Date -Date $utcDate -UFormat %s))
Hi. We have the same issue on sending data to graphite.
There is any official fix for that ?
Lot of thanks!
I can confirm that it caused errors too in our case (french regional settings on our server).
Graphite was reporting errors:
23/02/2015 14:40:28 :: Error writing to /opt/graphite/storage/whisper/local/internal/xxx/sqlserver/locks/database/averagewaittime/ms.wsp
23/02/2015 14:40:28 :: Unhandled Error
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/twisted/python/threadpool.py", line 207, in _worker
result = context.call(ctx, function, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/twisted/python/context.py", line 118, in callWithContext
return self.currentContext().callWithContext(ctx, func, *args, **kw)
File "/usr/local/lib/python2.7/dist-packages/twisted/python/context.py", line 81, in callWithContext
return func(*args,**kw)
File "/opt/graphite/lib/carbon/writer.py", line 158, in writeForever
writeCachedDataPoints()
--- <exception caught here> ---
File "/opt/graphite/lib/carbon/writer.py", line 137, in writeCachedDataPoints
whisper.update_many(dbFilePath, datapoints)
File "/usr/local/lib/python2.7/dist-packages/whisper.py", line 577, in update_many
return file_update_many(fh, points)
File "/usr/local/lib/python2.7/dist-packages/whisper.py", line 611, in file_update_many
__archive_update_many(fh,header,currentArchive,currentPoints)
File "/usr/local/lib/python2.7/dist-packages/whisper.py", line 635, in __archive_update_many
currentString += struct.pack(pointFormat,interval,value)
struct.error: 'L' format requires 0 <= number <= 4294967295
We have used the code suggested by @dillten
Same problem here. For me the suggestion from @dillten worked.
Thanks @dillten, I will implement this and release a new version.
Fixed in Graphite-PowerShell v1.2.1.
Thanks for reporting the issue! Thanks @dillten for the fix.
v1.2.1 had a bug, please grab Graphite-PowerShell v1.2.2 instead.
I've noticed that the date that gets sent is 15 characters long, for example: 141882399527883
When sending to InfluxDB this results in an error such as this: GraphiteServer:%!(EXTRA *strconv.NumError=strconv.ParseUint: parsing "141882399527883": value out of range).
A correct unix time would normally be 10 characters long, such as 1418823995 which in turn would result in: $ date --date='@1418823995' Wed Dec 17 13:46:35 UTC 2014
I'm guessing that you're adding microseconds or something to the output, in that case the number should be decimal such as:
$ date --date='@1418823995.27883' Wed Dec 17 13:46:35 UTC 2014
Do we really need microseconds in the output date? Any ideas on how to change the date to make it epoch time accurate to the second or decimal and thus allow compatibility with the InfluxDB storage engine?
Thanks!
Steps to reproduce:
Configure the graphite api
[input_plugins.graphite] enabled = true port = 2003 database = "graphite_db"