skaes / logjam_core

the engine which powers the logjam application
GNU General Public License v3.0
56 stars 7 forks source link

Should honor timezone information on requests and events #67

Open roccoblues opened 6 years ago

roccoblues commented 6 years ago

During a migration I had the (unfortunate) situation that some logjam agents where sending requests and events in UTC time and some in CET. (See also: https://github.com/skaes/logjam_agent/issues/32).

It looks like the data is stored with the timezone information in the logjam database but the view doesn't handle it correctly.

Ideally logjam would adjust all times to the timezone configured for the logjam app (Rails.application.config.time_zone) and also adjust the graphs to it.

skaes commented 6 years ago

Actually it is the logjam-importer which needs to be changed. It would need to convert incoming timestamps in all sorts of places to the desired timezone.

BTW: calling Rails.application.config.time_zone gives "UTC", even though running date on the console returns "Mon Oct 30 11:44:29 CET 2017"

roccoblues commented 6 years ago

That's because Rails.application.config.time_zone defaults to UTC.

What I mean is that you should store all data in UTC (or with timezone information) in the database an then convert it for the view layer to Rails.application.config.time_zone. That way the user could choose the correct display timezone for his location.

But I guess that will be hard to do because you store daily databases.

roccoblues commented 6 years ago

I know it's complicated and (at least for me) currently not required but as soon as you have servers with different timezone settings logjam will get confused. So don't let XING setup anything in the US. :-)