Event filtering is non-obvious and broken

Bug #1444100 reported by Steven Hardy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Triaged
Medium
Neetu Jain
python-heatclient
Invalid
Undecided
Unassigned

Bug Description

To use the event filtering, you really need internal knowledge of the DB schema, because the filters don't align with the displayed columns, particularly for resource_status

E.g:

  $ heat event-list overcloud -f "resource_status=CREATE_COMPLETE"
  +----+------------------------+-----------------+------------+
  | id | resource_status_reason | resource_status | event_time |
  +----+------------------------+-----------------+------------+
  +----+------------------------+-----------------+------------+

You have to specify it like this:

  heat event-list overcloud -f "resource_action=CREATE;resource_status=COMPLETE"

Which makes sense if you know the DB schema, but from a users perspective it's pretty mysterious..

Tags: tripleo
Revision history for this message
Steve Baker (steve-stevebaker) wrote :

I've added heat, since I think this is a REST API issue rather than a client one.

There are 2 issues here:
- resource_status=CREATE_COMPLETE should work as expected
- the API also needs to return separate attributes for status and action, and these should also be filterable

Changed in heat:
status: New → Triaged
importance: Undecided → Medium
Changed in python-heatclient:
status: New → Invalid
Changed in heat:
assignee: nobody → Satyanarayana Patibandla (satya-patibandla)
Revision history for this message
Steven Hardy (shardy) wrote :
Download full text (4.8 KiB)

Also, it seems that filtering on ID and timestamp doesn't work - really for timestamp filtering to be useful it needs to support not only exact matching, but also ranges, e.g at a minimum events before/after timestampX.

[shardy@localhost python-heatclient]$ heat event-list overcloud -f "resource_action=UPDATE;resource_status=COMPLETE;resource_name=ObjectStorage;uuid=1a65c203-ab4d-4c34-a2c9-d85ae4ac8d08"
+---------------+--------------------------------------+------------------------+-----------------+----------------------+
| resource_name | id | resource_status_reason | resource_status | event_time |
+---------------+--------------------------------------+------------------------+-----------------+----------------------+
| ObjectStorage | 1a65c203-ab4d-4c34-a2c9-d85ae4ac8d08 | state changed | UPDATE_COMPLETE | 2015-04-15T13:24:32Z |
| ObjectStorage | 5c3e0f07-8c01-4d7b-9a48-9e2da93a2c3c | state changed | UPDATE_COMPLETE | 2015-04-15T13:41:36Z |
| ObjectStorage | cb52b058-1d3a-4878-b9c3-95649591564b | state changed | UPDATE_COMPLETE | 2015-04-16T17:35:30Z |
| ObjectStorage | 964067ad-f15d-49fe-bcc3-f28d3eb8d162 | state changed | UPDATE_COMPLETE | 2015-04-17T10:24:08Z |
+---------------+--------------------------------------+------------------------+-----------------+----------------------+
[shardy@localhost python-heatclient]$ heat event-list overcloud -f "resource_action=UPDATE;resource_status=COMPLETE;resource_name=ObjectStorage;id=1a65c203-ab4d-4c34-a2c9-d85ae4ac8d08"
+---------------+--------------------------------------+------------------------+-----------------+----------------------+
| resource_name | id | resource_status_reason | resource_status | event_time |
+---------------+--------------------------------------+------------------------+-----------------+----------------------+
| ObjectStorage | 1a65c203-ab4d-4c34-a2c9-d85ae4ac8d08 | state changed | UPDATE_COMPLETE | 2015-04-15T13:24:32Z |
| ObjectStorage | 5c3e0f07-8c01-4d7b-9a48-9e2da93a2c3c | state changed | UPDATE_COMPLETE | 2015-04-15T13:41:36Z |
| ObjectStorage | cb52b058-1d3a-4878-b9c3-95649591564b | state changed | UPDATE_COMPLETE | 2015-04-16T17:35:30Z |
| ObjectStorage | 964067ad-f15d-49fe-bcc3-f28d3eb8d162 | state changed | UPDATE_COMPLETE | 2015-04-17T10:24:08Z |
+---------------+--------------------------------------+------------------------+-----------------+----------------------+
[shardy@localhost tripleo]$ heat event-list overcloud -f "resource_action=UPDATE;resource_status=COMPLETE;resource_name=ObjectStorage;event_time=2015-04-15T13:24:32Z"
+---------------+--------------------------------------+------------------------+-----------------+----------------------+
| resource_name | id | resource_status_reason | resource_status | event_time |
+---------------+--------------------------------------+------------------------+-----------------+----------------------+
| ObjectStorage | 1a65c203-ab4d-4c34-a2c9-d85ae4ac8d08 | state changed | UPDATE_COMPLETE | 201...

Read more...

Steven Hardy (shardy)
summary: - Event filtering is non-obvious
+ Event filtering is non-obvious and broken
Revision history for this message
Steven Hardy (shardy) wrote :

Satyanarayana Patibandla: If you're working on this, perhaps we can collaborate? I need the fix for timestamp filtering ASAP, so I may provide a partial fix resolving that, then you can follow up with the remaining fixes related to misaligned names?

Feel free to ping me on IRC to discuss (shardy in #heat on Freenode), I'm based in a UTC+1 timezone, thanks!

Steven Hardy (shardy)
tags: added: tripleo
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (master)

Fix proposed to branch: master
Review: https://review.openstack.org/176990

Changed in heat:
assignee: Satyanarayana Patibandla (satya-patibandla) → Steven Hardy (shardy)
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on heat (master)

Change abandoned by Steven Hardy (<email address hidden>) on branch: master
Review: https://review.openstack.org/176990
Reason: figured out another way to do hook-poll filtering using markers

Changed in heat:
status: In Progress → Triaged
assignee: Steven Hardy (shardy) → nobody
Neetu Jain (nutshi)
Changed in heat:
assignee: nobody → Neetu Jain (nutshi)
Rico Lin (rico-lin)
Changed in heat:
milestone: none → no-priority-tag-bugs
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.