elastic/elasticsearch-metrics-reporter-java

Configurable time zone

Closed this issue · 5 comments

Unless I have missed something, it is not possible to specify which timezone to use for the timestamp of the metrics data. In our case, the timestamp is off by 2 hours, due to incorrect timezone being used by default. So an option to specify timezone would be very helpful.

hey,

you are right, we need to make sure everything is UTC as ES expects it to be and allow for changes.

would you be willing to create a PR for this?

UTC in ES is fine. But for some reason, the UTC time stored is incorrect in our case. It's two hours wrong, which I suspect is because of TimeZone conversion issues somewhere between the "Clock" and storing it in ES.

hm, the Clock.getTime() is calling System.currentTimeMillis() which should be UTC... as there is no timezone conversion happening (the timestamp is used), we should take a closer look at your config

It's a while since I looked at this, but I suspect that the real issue was that the server clock was wrong, so you can probably just close it.

thank you so much for answering despite all the time having passed! Closing this, but feel free to reopen if you need to.