Skip to content

Commit 044d881

Browse files
committed
Fix "time" to produce collect Unix time
Currently `time` collector produces a record like this: [{"name":"node_time_seconds","value":1.643789173, "desc":"System time in seconds since epoch (1970).", "ts":1643789173610783251}] This is very bogus, because it essentially says that the current system time is `1970-01-01 00:00:01.643789173`. Fix it. Signed-off-by: Fujimoto Seiji <[email protected]>
1 parent 8c0e72e commit 044d881

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/fluent/plugin/node_exporter/time_collector.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def run
3535

3636
def time_update
3737
current_time = Fluent::EventTime.now
38-
value = current_time.to_i / 1e9
38+
value = current_time.to_i
3939
@gauge.set(value)
4040
end
4141

0 commit comments

Comments
 (0)