The real power of this system is the ability to trigger events and have them perform a specific notification action. Monitor Events are simple actions that accept a message/description of the error and the Monitor Task. The event will trigger the creation of a log entry for the message and notifications as needed.
By creating an event, it will be possible for developers to create EventSubscribers to the Monitor Event and add additional reactions to the event as needed.
These events should be created using Symfony.
Documentation
https://symfony.com/doc/current/components/event_dispatcher.html#events
Implementation
Every monitor event should have its own default event subscribers. These event subscribers should control the generation of logs (to be displayed as part of the status page and in email/json). Event Subscribers for notifications will be handled in optional add-on modules/configuration.
- Events
- SystemMonitorOkEvent
- SystemMonitorWarningEvent
- SystemMonitorErrorEvent
- EventSubscribers
- SystemMonitorLogEventSubscriber
Checklist items
- Create SystemMonitorOkEvent event
- Create SystemMonitorWarningEvent event
- Create SystemMonitorErrorEvent event
- Create SystemMonitorLogEventSubscriber
- Create PHP Unit Tests for Monitor Events (as needed)
- Create PHP functional tests for Monitor events (as needed)
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | interdiff-3074955-5-7.txt | 4.51 KB | robpowell |
| #7 | system-monitor-3074955-7.patch | 4.33 KB | robpowell |
| #6 | interdiff-3074955-3-5.txt | 2.73 KB | robpowell |
| #6 | system_monitor-3074955-5.patch | 4.4 KB | robpowell |
| #3 | system_monitor-3074955-3.patch | 4.53 KB | robpowell |
Comments
Comment #2
merauluka commentedAdded checklist items.
Comment #3
robpowell@merauluka, let me know what you think of this patch.
Comment #4
robpowellComment #5
merauluka commentedHey @robpowell, I think that there is some work to be done around the naming of the events themselves (as you and I discussed in our meeting yesterday).
Please update those and the comments in your code and resubmit. Thanks!
Comment #6
robpowellMade changes based off our code review.
Comment #7
robpowellUpdated class to MonitorEvent
Comment #9
merauluka commentedCommited and merged. Thanks @robpowell!
Comment #10
merauluka commented