[openstack-dev] [ceilometer] database timestamps timezones

Doug Hellmann doug.hellmann at dreamhost.com
Mon Nov 5 11:34:36 UTC 2012


On Fri, Nov 2, 2012 at 11:57 AM, Eoghan Glynn <eglynn at redhat.com> wrote:

>
>
> > > Looking over https://bugs.launchpad.net/ceilometer/+bug/1048647,
> > > we'd
> > > like some feedback on timezone aware datetimes for the timestamp
> > > fields (in Meters and Resources tables).  From what I understand,
> > > some
> > > backends do not support timezone in timestamp type fields , such as
> > > MongoDB and Postgres.  I think the way Nova handles it is that it
> > > expects all timestamps in the database is expected to be UTC.
> >
> > Postgres actually has separate types for timestamp without time zone
> > and
> > timestamp with time zone.
> >
> > But I think it makes a lot more sense to just use UTC timestamps
> > everywhere, rather than using timezone-aware timestamps which will
> > involve more database-specific code.  If you care about the user's
> > timezone, you can put it in a separate column.
>
> Totally agree about standardizing on UTC ... having lived with
> systems using TZ-specific timestamps, its a never-ending saga of
> confusion & pain.
>

It looks like there's a strong consensus on using UTC without a TZ in the
datetime object. We should go ahead and make any changes needed to do that,
then document our expectations in our public documentation for the API and
in the storage driver API specification (maybe in the storage driver base
class method for storing new metering data?).

Doug
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20121105/1c550985/attachment.html>


More information about the OpenStack-dev mailing list