mikejihbe / metrics

A metrics library for Node.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Incorrect Graphite timestamp

nickcodefresh opened this issue · comments

The Graphite reporter is reporting metrics in the format

flex.flex-executionconfiguration-service.qa3-node8.timer.response.api.resourceconfig.p95 3053.6085169000003 1520372931.562

But the "1520372931.562" value is invalid. I believe it needs to be a whole number. I think it's related to the code

var timestamp = (new Date).getTime() / 1000;

in graphite-reporter.js. I think it should be Math.round(new Date().getTime()/1000.0) getTime()

These values are accepted fine by go-carbon (I haven't tried with the original graphite carbon-cache) however break carbon-c-relay (segfault) and get classified as invalid by carbon-relay-ng.

Thanks for bringing this to my attention, and apologies for the delay in response. I've pretty much only ever used the carbon relay that comes with graphite so had never encountered it. Will fix this as I don't think users will care about subsecond reporting.