Timestamp based Event filter returns same result for gt and ge condititions

Bug #1558594 reported by Marek Aufart
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ceilometer
Triaged
Medium
Zi Lian Ji

Bug Description

I get a list of all events in first command, then I would like get list with events newer than last fetched events. So I used filter, but it looks that > (greater than) behaves same as >= (greater or equal).

Example:

# ceilometer event-list --no-traits
+--------------------------------------+-------------------------------------+----------------------------+
| Message ID | Event Type | Generated |
+--------------------------------------+-------------------------------------+----------------------------+
| 4eebedfb-465b-4b15-a835-206267f19cae | scheduler.select_destinations.start | 2016-03-10T15:35:44.425000 |
| 02b44ae2-b6ca-42b2-bf21-68a5f900c82b | compute.instance.shutdown.end | 2016-03-16T12:57:24.232000 |
| bd3cec25-2f62-4975-b66e-d52159cfd6b9 | compute.instance.delete.end | 2016-03-16T12:57:24.687000 |
| 458c975f-19f9-4162-8d54-5d639df276c3 | scheduler.select_destinations.end | 2016-03-17T09:58:02.796000 |
| 60fac82d-aefe-40b2-bb58-ad6df50917be | compute.instance.create.start | 2016-03-17T09:58:03.138000 |
| 9ff5d77a-7a44-4972-93c4-0724d1ab0ffc | port.create.start | 2016-03-17T09:58:03.825000 |
| bd07a9ba-6c1d-4fbd-bdc3-47540504c9e5 | port.create.end | 2016-03-17T09:58:04.089000 |
| ffb7084f-6230-40af-8599-d9d6ad99a511 | compute.instance.create.end | 2016-03-17T09:58:29.336000 |
| 7b76e553-b804-4b67-9191-b9595b513e6e | floatingip.update.start | 2016-03-17T09:59:44.606000 |
| 8b4bcdb3-5519-459c-9545-aba0d5760a62 | floatingip.update.end | 2016-03-17T09:59:45.150000 |
+--------------------------------------+-------------------------------------+----------------------------+

# ceilometer event-list --no-traits --query "start_timestamp>datetime::2016-03-17T09:59:44.606000"
+--------------------------------------+-------------------------+----------------------------+
| Message ID | Event Type | Generated |
+--------------------------------------+-------------------------+----------------------------+
| 7b76e553-b804-4b67-9191-b9595b513e6e | floatingip.update.start | 2016-03-17T09:59:44.606000 |
| 8b4bcdb3-5519-459c-9545-aba0d5760a62 | floatingip.update.end | 2016-03-17T09:59:45.150000 |
+--------------------------------------+-------------------------+----------------------------+

# ceilometer event-list --no-traits --query "start_timestamp>string::2016-03-17T09:59:44.606000"
+--------------------------------------+-------------------------+----------------------------+
| Message ID | Event Type | Generated |
+--------------------------------------+-------------------------+----------------------------+
| 7b76e553-b804-4b67-9191-b9595b513e6e | floatingip.update.start | 2016-03-17T09:59:44.606000 |
| 8b4bcdb3-5519-459c-9545-aba0d5760a62 | floatingip.update.end | 2016-03-17T09:59:45.150000 |
+--------------------------------------+-------------------------+----------------------------+

# ceilometer event-list --no-traits --query "start_timestamp>=string::2016-03-17T09:59:44.606000"
+--------------------------------------+-------------------------+----------------------------+
| Message ID | Event Type | Generated |
+--------------------------------------+-------------------------+----------------------------+
| 7b76e553-b804-4b67-9191-b9595b513e6e | floatingip.update.start | 2016-03-17T09:59:44.606000 |
| 8b4bcdb3-5519-459c-9545-aba0d5760a62 | floatingip.update.end | 2016-03-17T09:59:45.150000 |
+--------------------------------------+-------------------------+----------------------------+

Description:
I would expect that first two commands return only event 8b4bcdb3-5519-459c-9545-aba0d5760a62,
but it returns two events what is the same as ">=", so it looks that greater than behaves same as
greater or equal (if start_timestamp means generated field)

This behaviour is the same for both CLI and HTTP API.

Tags: event filter
Revision history for this message
Marek Aufart (maufart) wrote :
summary: Timestamp based Event filter returns same result for gt and ge
- condifitions
+ condititions
Zi Lian Ji (jizilian)
Changed in ceilometer:
assignee: nobody → Zi Lian Ji (jizilian)
gordon chung (chungg)
Changed in ceilometer:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Zi Lian Ji (jizilian) wrote :

Hello Marek Aufart

According to the source code of Mitaka release, the field 'start_timestamp' doesn't support the operation '>'. And the exception should be thrown.

https://github.com/openstack/ceilometer/blob/master/ceilometer/api/controllers/v2/events.py#L176

https://github.com/openstack/ceilometer/blob/master/ceilometer/api/controllers/v2/events.py#L190

Which version of Ceilometer do you use? I will back port this fix to that release.

Thanks

Revision history for this message
Marek Aufart (maufart) wrote :

Hi Zi Lian Ji,

thanks for information. Does it mean, that just the sign of operation (>) is not supported (and should be replaced with "gt") OR whole timestamp-based filtering is to be disabled?

I use:
# rpm -qa | grep -i ceilometer
openstack-ceilometer-central-2015.1.2-1.el7ost.noarch
openstack-ceilometer-api-2015.1.2-1.el7ost.noarch
openstack-ceilometer-common-2015.1.2-1.el7ost.noarch
python-ceilometer-2015.1.2-1.el7ost.noarch
openstack-ceilometer-collector-2015.1.2-1.el7ost.noarch
python-ceilometerclient-1.0.14-1.el7ost.noarch
openstack-ceilometer-notification-2015.1.2-1.el7ost.noarch
openstack-ceilometer-alarm-2015.1.2-1.el7ost.noarch
openstack-ceilometer-compute-2015.1.2-1.el7ost.noarch

Thanks

Marek

Revision history for this message
Zi Lian Ji (jizilian) wrote :

Hi Marek Aufart

The 'start_timestamp' and 'end_timestamp' only support the operation 'eq/='. I will back port the fix about the error message to the release you are using.

I think you should use the kilo release code?

Thanks

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ceilometer (stable/liberty)

Fix proposed to branch: stable/liberty
Review: https://review.openstack.org/296907

Revision history for this message
Zi Lian Ji (jizilian) wrote :
Revision history for this message
Marek Aufart (maufart) wrote :

Hi Zi Lian Ji,

yeah, it should be part of openstack 7 (so, kilo).

Is there other way how to query events only newer than given date/time?

Thanks

Marek

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on ceilometer (stable/liberty)

Change abandoned by gordon chung (<email address hidden>) on branch: stable/liberty
Review: https://review.openstack.org/296907

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.