last_value function for alarm sub-expressions

Registered by Roland Hochmuth

- Add a new function, last_value, to alarm sub-expressions that use the value of the last metric that was sent when evaluating alarms.
- In the Threshold Engine, immediately transition to the ALARM'd or OK state, based on the value of the last metric that exceeds the threshold or is less than the threshold, respectively.
    - Note, if the metric is not continually sent, the alarm will continue to use the value of the last metric sent, even across alarm evaluation periods. In other words, the alarm will not automatically transition to the UNDETERMINED or OK state, even if metrics are no longer sent.
- Modifications:
    - Add state column to the sub_alarm table/schema.
        - Currently, the state of alarm subs-expressions are not saved, only the state of alarms are saved.
    - Threshold Engine updates state in the sub_alarm table when state transitions occur.
    - Threshold Engine initializes sub-alarms states on start-up.
    - Add support in the Threshold Engine for the last_value function.
    - Add support in the Python and Java APIs for the last_value function in the alarm sub-expression parsing.
    - Add support in the python-monascaclient for the last_value function.
- No new APIs/resources are required to be added.
- Validate performance.

Blueprint information

Status:
Complete
Approver:
None
Priority:
High
Drafter:
Roland Hochmuth
Direction:
Approved
Assignee:
Craig Bryant
Definition:
Approved
Series goal:
None
Implementation:
Implemented
Milestone target:
None
Started by
Roland Hochmuth
Completed by
Roland Hochmuth

Related branches

Sprints

Whiteboard

Gerrit topic: https://review.openstack.org/#q,topic:bp/last-value,n,z

Addressed by: https://review.openstack.org/346573
    Add Last function

Addressed by: https://review.openstack.org/347934
    Add state to sub_alarm table

Addressed by: https://review.openstack.org/349078
    Implement the Last Function

Addressed by: https://review.openstack.org/347965
    Add support for 'last' function

Addressed by: https://review.openstack.org/384323
    Add support for 'last' function

Addressed by: https://review.openstack.org/384433
    Add support for 'last' function

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.