The original HTTP request has a precision (in this case in seconds), which seems to be ignored by Telegraf's [[inputs.http_listener]].
On Friday, January 13, 2017 at 11:26:44 PM UTC+1, Mark Rushakoff wrote: > > > It seems InfluxDB http requests automatically casts measurements in > millis to nanos > > InfluxDB does not automatically cast timestamps. How are you writing your > points? > > $ curl -XPOST 'http://localhost:8086/write?db=test' --data-binary 'foo > bar="NOT using precision=ms" 1484346119541' > > > $ curl -XPOST 'http://localhost:8086/write?db=test&precision=ms' > --data-binary 'foo bar="using precision=ms" 1484346149943' > > > $ curl 'http://localhost:8086/query?db=test' --data-urlencode "q=SELECT * > FROM foo" | jq . > > { > > "results": [ > > { > > "statement_id": 0, > > "series": [ > > { > > "name": "foo", > > "columns": [ > > "time", > > "bar" > > ], > > "values": [ > > [ > > "1970-01-01T00:24:44.346119541Z", > > "NOT using precision=ms" > > ], > > [ > > "2017-01-13T22:22:29.943Z", > > "using precision=ms" > > ] > > ] > > } > > ] > > } > > ] > > } > > On Fri, Jan 13, 2017 at 12:16 PM, Niels van Klaveren < > [email protected] <javascript:>> wrote: > >> OK, I narrowed it down to the source of the metrics. It seems InfluxDB >> http requests automatically casts measurements in millis to nanos, but when >> passed through a Telegraf proxy this doesn't happen. >> >> Good to know it's not a bug, but just something that goes against the >> principle >> of least astonishment. >> >> Seems I've got some forking to do and pull requests to wait on before we >> can continue though. >> >> On Friday, January 13, 2017 at 5:04:27 PM UTC+1, Ross McDonald wrote: >>> >>> Could you provide your Telegraf configuration? Also what version of >>> Telegraf are you using? >>> >>> On Fri, Jan 13, 2017 at 9:20 AM, Niels van Klaveren < >>> [email protected]> wrote: >>> >>>> When metrics are sent to Telegraf's http-input plugin and from there >>>> sent to InfluxDB, the nanosecond timestamps are truncated by removing the >>>> last 9 0's. This means all timestamps in InfluxDB end up in the far past >>>> instead of the correct time. >>>> >>>> The same values sent straight to InfluxDB are correct. >>>> >>>> I could not find any Telegraf configuration that could be used for >>>> this, and throws doubts on the feasibility of InfluxDB for our use case, >>>> where direct UDP output is not an option due to the source being out of >>>> our >>>> control, and HTTP isn't performant enough due to the high amount of >>>> fsync's. >>>> >>>> Is there anything I overlooked in fixing this ? >>>> >>>> -- >>>> Remember to include the version number! >>>> --- >>>> You received this message because you are subscribed to the Google >>>> Groups "InfluxData" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to [email protected]. >>>> To post to this group, send email to [email protected]. >>>> Visit this group at https://groups.google.com/group/influxdb. >>>> To view this discussion on the web visit >>>> https://groups.google.com/d/msgid/influxdb/8ba704d9-64ae-46d7-be2f-7cca9fc5a35d%40googlegroups.com >>>> >>>> <https://groups.google.com/d/msgid/influxdb/8ba704d9-64ae-46d7-be2f-7cca9fc5a35d%40googlegroups.com?utm_medium=email&utm_source=footer> >>>> . >>>> For more options, visit https://groups.google.com/d/optout. >>>> >>> >>> -- >> Remember to include the version number! >> --- >> You received this message because you are subscribed to the Google Groups >> "InfluxData" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> To post to this group, send email to [email protected] >> <javascript:>. >> Visit this group at https://groups.google.com/group/influxdb. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/influxdb/bbe21f83-4e3c-4175-9e5f-000d0f71d85a%40googlegroups.com >> >> <https://groups.google.com/d/msgid/influxdb/bbe21f83-4e3c-4175-9e5f-000d0f71d85a%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> >> For more options, visit https://groups.google.com/d/optout. >> > > -- Remember to include the version number! --- You received this message because you are subscribed to the Google Groups "InfluxData" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/influxdb. To view this discussion on the web visit https://groups.google.com/d/msgid/influxdb/3b8f57c0-c439-404c-9e28-334cbd70c6c3%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
