Event Triggers
When processing notification events, it is often useful to aggregate data from notifications that are emitted over a wide range of time. These may arrive at multiple different collectors (if there are multiple collector workers) or even in random order, due to the vaugeries of rabbitmq, or different components within an openstack project (like nova) working at varying rates. Triggers allow for such aggregation.
Triggers have a Definition with a pattern, a trigger criteria, a ttl, a triggered notification pipeline, and an optional expiration notification pipeline.
The pattern is a specification for event types and notification data values that match the trigger. When the first notification that matches a trigger's definition pattern is detected, a Trigger is created. The trigger keeps a list of notifications that have matched it's pattern. When the criteria is met, the trigger fires, sending all of the collected notifications to the associated pipeline as a batch for processing. If the ttl expires without the trigger firing, the collected notifications are sent to the expiration pipeline if there is one. When fired or expired, the trigger is deleted.
Example:
You want to meter average build time statistics.
A trigger for build_time:
Blueprint information
- Status:
- Complete
- Approver:
- None
- Priority:
- Undefined
- Drafter:
- Monsyne Dragon
- Direction:
- Needs approval
- Assignee:
- None
- Definition:
- Obsolete
- Series goal:
- None
- Implementation:
-
Unknown
- Milestone target:
-
next
- Started by
- Completed by
- gordon chung
Related branches
Related bugs
Sprints
Whiteboard
Looks great Dragon. Here's a use-case to consider (from StackTach):
1. trigger on new Request ID
2. "all event" * wildcard on related events (they could come from anywhere)
3. determine the start if the service is from an api node (likely extracted from the event name)
4. programmatically determine how long to wait for the last operation and mark the time difference or on something specific like compute.
More on #4. the "wait" time would be, let's say 5 minutes for a tiny instance but could be 5hrs for a large windows image. We may not know what the last event we'll see is, so we have to wait it out.
closing this as it's super idle. that said, making the notification agents stateful is probably a bad idea as it adds quite a bit of complexity and will probably impact scalability in addition to durability. this seems better handled by storage drivers where it's more durable and can provide similar response time i believe. for example, gnocchi can capture build time easily rather than spawning a thread to watch for specific events. please reopen as wishlist bug if still interested -- gordc (2018.02)
Work Items
Dependency tree

* Blueprints in grey have been implemented.