You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 30, 2019. It is now read-only.
Repository navigation
This repository was archived by the owner on May 30, 2019. It is now read-only.
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:
Enable input_graphite to InfluxDB by changing this part in /opt/influxdb/shared/config.toml
Configure the graphite api
[input_plugins.graphite]
enabled = true
port = 2003
database = "graphite_db"
2. Direct Graphite-PowerShell metrics to InfluxDB
3. tail -f /opt/influxdb/shared/log.txt
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,
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.
Activity
bonobo78 commentedon Dec 22, 2014
reproduced with same scenario.
edit:
temporary solve this issue by dividing the value of the timestamp by 100000 before sending it.
enricnes commentedon Feb 10, 2015
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,
MattHodge commentedon Feb 12, 2015
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.
marconfus commentedon Feb 13, 2015
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.
dillten commentedon Feb 16, 2015
Based on this, seems like the most invariant fix to this would be:
[uint64]$UnixTime = [double]::Parse((Get-Date -Date $utcDate -UFormat %s))toni-moreno commentedon Feb 19, 2015
Hi. We have the same issue on sending data to graphite.
There is any official fix for that ?
Lot of thanks!
tbolon commentedon Feb 23, 2015
I can confirm that it caused errors too in our case (french regional settings on our server).
Graphite was reporting errors:
We have used the code suggested by @dillten
rgunst commentedon Feb 23, 2015
Same problem here. For me the suggestion from @dillten worked.
MattHodge commentedon Feb 24, 2015
Thanks @dillten, I will implement this and release a new version.
Fix for issue #34 - "Unix time too long when sending to influxDB". Th…
MattHodge commentedon Feb 25, 2015
Fixed in Graphite-PowerShell v1.2.1.
Thanks for reporting the issue! Thanks @dillten for the fix.
MattHodge commentedon Feb 25, 2015
v1.2.1 had a bug, please grab Graphite-PowerShell v1.2.2 instead.