Send event notifications
Use event handlers to send an event notification to an outside system when a component or view health state changes.
This page describes StackState version 4.3.
The StackState 4.3 version range is End of Life (EOL) and no longer supported. We encourage customers still running the 4.3 version range to upgrade to a more recent release.
When something goes wrong within your IT environment, StackState can send event notifications to alert you or your team mates. A message can be sent in the form of an email, Slack message, mobile ping or an HTTP POST request to any URL. Event notifications can contain detailed content on the trigger event and possible root cause. This guide will help you set this up.
StackState event notification in Slack with possible root cause information
Event notifications are triggered in response to health state change events or problem events generated in a view.
The health state of an element is derived from metrics and events data in the telemetry streams assigned to it, whereas the health state of a view is calculated based on the combined health state of elements within it. Propagated state changes can also be used to trigger event notifications, however, this can result in a lot of noise. The process to trigger a health state changed event notification is as follows:
- 3.When the reported health state of an element changes, a chain of state change events are generated:
HealthStateChangedEventfor the element itself.
PropagatedStateChangedEventfor all other elements that have been impacted by the element's state change.
- 4.Event handlers associated with each view listen to the generated state change events and trigger the configured event notifications and actions.
Event handlers can be added to a StackState view to send event notifications and trigger actions in response to health state change events or problem events generated within the view.
You can add an event handler to a view from the StackState UI.
Add an event handler
- 1.Select Events Settings on the left.
- 2.Click ADD NEW EVENT HANDLER.
- 3.Select the trigger event and event handler to run:
- Run event handler - the event handler function that will run whenever the selected event is generated.
- For health state changed events, StackState ships with event handler functions that can send an event notification via email, Slack or SMS, or POST to an HTTP webhook.
- 4.Enter the required details, these will vary according to the event handler function you have selected.
- 5.Click SAVE.
Metrics and events data flow through StackState topology elements in telemetry streams. These telemetry streams are used by health checks to determine the health state of the element. For every change in health state, at least one state change event is generated. Event handlers can be added to a view to listen to state change events generated within the view and trigger an event notification or action when a configured threshold is passed.
The event types generated when an element state changes are described in the table below.
StackState groups the unhealthy components in a view into problems with a common root cause. For every change to a problem, at least one problem event is generated. Event handlers can listen to generated problem events and trigger an event notification or actions. StackState v4.3 does not include StackPacks that support notifications for problem events out of the box, however, the functionality to do this is available. You can create your own custom event handler function that will listen and react to the events generated by problems.
Changes to a problem result in the following event types being generated:
Event handlers listen to events generated within a view. When the configured event type is generated, the event handler function is run to send an event notification or trigger an action in a system outside of StackState. For example, an event handler function could send an email or make a POST to a webhook URL. A number of default event handler functions are included out of the box with StackState, or you can create your own custom event handler functions.
StackState ships with the following event handler functions that track health state change events in a view:
Some of the event handler functions above will be installed as part of a StackPack. A full list of the event handler functions available in your StackState instance can be found in the StackState UI, go to Settings > Functions > Event Handler Functions