timestamp format of the sample datas

Bug #1483564 reported by Aaron DH
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ceilometer
Fix Released
Low
gordon chung

Bug Description

hi, all

cmd 'ceilometer sample-list ' can list the sample datas include the timestamp field

i found that sometimes the format of timestamp like: 2015-08-11T07:41:43
sometimes it changes like: 2015-08-11T07:22:55.113881

but i have no idea which condition can it occur.

stack@ubuntu:~$ ceilometer sample-list -l 1
+--------------------------------------+--------------------------------------+------------+-------+------------+------+---------------------+
| ID | Resource ID | Name | Type | Volume | Unit | Timestamp |
+--------------------------------------+--------------------------------------+------------+-------+------------+------+---------------------+
| 6916f9e0-3ffc-11e5-bedb-fa163efc492b | 773c7633-389c-478d-b390-56a2a3c11d6a | image.size | gauge | 13167616.0 | B | 2015-08-11T07:41:43 |
+--------------------------------------+--------------------------------------+------------+-------+------------+------+---------------------+

stack@ubuntu:~$ ceilometer sample-list -l 10
+--------------------------------------+--------------------------------------+--------------------------+------------+--------+-----------+----------------------------+
| ID | Resource ID | Name | Type | Volume | Unit | Timestamp |
+--------------------------------------+--------------------------------------+--------------------------+------------+--------+-----------+----------------------------+
| 940e031e-3ffc-11e5-a1d9-fa163e1c21d5 | 17a99f1b-b05a-4ea9-8c80-3cdefe228cd1 | disk.write.requests | cumulative | 172.0 | request | 2015-08-11T07:42:55.292236 |

gordon chung (chungg)
Changed in ceilometer:
status: New → Triaged
importance: Undecided → Low
Changed in ceilometer:
assignee: nobody → venkatamahesh (venkatamaheshkotha)
Revision history for this message
Igor Degtiarov (idegtiarov) wrote :

actually it as not a bug, timestamps are converted to a normalize_time before samples stores, please take a look https://github.com/openstack/ceilometer/blob/master/ceilometer/dispatcher/database.py#L91

Final view depends on how precise was initial timestamp and we check it in a tests:
https://github.com/openstack/ceilometer/blob/master/ceilometer/tests/unit/dispatcher/test_db.py#L91
https://github.com/openstack/ceilometer/blob/master/ceilometer/tests/unit/dispatcher/test_db.py#L110

Changed in ceilometer:
assignee: venkatamahesh (venkatamaheshkotha) → nobody
Revision history for this message
Aaron DH (aaron.d) wrote :

thank you idegtiarov,

i havn't do anything , but two different formats of timestamp appears in a same environment.
And it makes me wonder.

Revision history for this message
Julien Danjou (jdanjou) wrote :

The bug is that something (Ceilometer?) generates timestamp with no timezone information.

Revision history for this message
Julien Danjou (jdanjou) wrote :

I meant with no timezone information.

Revision history for this message
gordon chung (chungg) wrote :
Changed in ceilometer:
status: Triaged → In Progress
assignee: nobody → gordon chung (chungg)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to ceilometer (master)

Reviewed: https://review.openstack.org/481686
Committed: https://git.openstack.org/cgit/openstack/ceilometer/commit/?id=dedc6436e52be7f5e71b0b1adc060befc2bf0fe3
Submitter: Jenkins
Branch: master

commit dedc6436e52be7f5e71b0b1adc060befc2bf0fe3
Author: gord chung <email address hidden>
Date: Fri Jul 7 11:38:39 2017 -0400

    explicitly note sanitize_timestamp return condition

    we shouldn't use sanitize_timestamp as it strips the timezone info.
    it's really only useful on query filtering since we store in utc.

    Change-Id: I6419bea62d139574dfa9e949bba4cdf8931803e7
    Related-Bug: #1483564

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ceilometer (master)

Reviewed: https://review.openstack.org/481687
Committed: https://git.openstack.org/cgit/openstack/ceilometer/commit/?id=232f8e90473568c2b7c5f3267d1f179721d007ac
Submitter: Jenkins
Branch: master

commit 232f8e90473568c2b7c5f3267d1f179721d007ac
Author: gord chung <email address hidden>
Date: Fri Jul 7 12:04:40 2017 -0400

    ensure timezone is included in timestamps

    default to UTC timezone if not provided.
    - safe to change ironic tests as the test notifications were
    malformed[1]

    [1] https://github.com/openstack/ironic/blob/99ba58172c33baefa7af6bca55b7b3aba1fe695c/ironic/conductor/manager.py#L2159

    Closes-Bug: #1483564
    Change-Id: I7c120fbc98698787c96533dbae6d5a683d6d4661

Changed in ceilometer:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/ceilometer 9.0.0

This issue was fixed in the openstack/ceilometer 9.0.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.