{"id":2720,"date":"2023-08-19T17:32:31","date_gmt":"2023-08-19T17:32:31","guid":{"rendered":"https:\/\/hauweele.net\/~gawen\/blog\/?p=2720"},"modified":"2023-08-19T17:32:31","modified_gmt":"2023-08-19T17:32:31","slug":"influxdb-and-collectd-time-mismatch","status":"publish","type":"post","link":"https:\/\/hauweele.net\/~gawen\/blog\/?p=2720","title":{"rendered":"InfluxDB and collectd time mismatch"},"content":{"rendered":"<p>Recently I&#8217;ve been playing a bit with Grafana and InfluxDB data sources populated by collectd for the most part. However when trying to explore the data in InfluxDB, all times were in 1970-01-01. The epoch is often used as a kind of <i>null<\/i> value in InfluxDB. However in this case, the time value were increasing. The problem was that there was a mismatch between the timestamp sent by collectd and the way InfluxDB was trying to parse them.<\/p>\n<p>Collectd used the <code>write_influxdb_udp<\/code> write plugin which apparently sends timestamp in <i>milliseconds<\/i>, but the <code>[[udp]]<\/code> listener of InfluxDB was probably expecting them to be in <i>nanoseconds<\/i>. Hence, there factor 1000000 between the two timestamp formats. You can control which format InfluxDB expects on its <code>[[udp]]<\/code> listener using the following parameter:<\/p>\n<pre>\r\n# InfluxDB precision for timestamps on received points (\"\" or \"n\", \"u\", \"ms\", \"s\", \"m\", \"h\")\r\nprecision = \"ms\"\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Recently I&#8217;ve been playing a bit with Grafana and InfluxDB data sources populated by collectd for the most part. However when trying to explore the data in InfluxDB, all times were in 1970-01-01. The epoch is often used as a &hellip; <a href=\"https:\/\/hauweele.net\/~gawen\/blog\/?p=2720\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[1146,1143,1142,1145,1144],"class_list":["post-2720","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-1146","tag-collectd","tag-influxdb","tag-timestamp","tag-udp"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/hauweele.net\/~gawen\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2720","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hauweele.net\/~gawen\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hauweele.net\/~gawen\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hauweele.net\/~gawen\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hauweele.net\/~gawen\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2720"}],"version-history":[{"count":0,"href":"https:\/\/hauweele.net\/~gawen\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2720\/revisions"}],"wp:attachment":[{"href":"https:\/\/hauweele.net\/~gawen\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2720"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hauweele.net\/~gawen\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2720"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hauweele.net\/~gawen\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2720"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}