mediarithmics modules can trigger alerts to grab the attention of users/integrators on specific points to improve or fix.
Alerts are displayed in the UI, but can also be accessed by API if you want to automate actions or grab them in your own reports.
Here are the different alert types that exist today
Alerts have several properties associated with them:
id: The unique identifier of the alert.
datamart_id: The identifier of the datamart associated with the alert.
organisation_id: The identifier of the organisation associated with the alert.
community_id: The identifier of the community associated with the alert.
type: The type of the alert (e.g., SEGMENT_COMPUTATION_ERROR, SEGMENT_VOLUME_DROP).
created_ts: The timestamp indicating when the alert was created.
archived: A flag indicating whether the alert is closed/archived (
true) or open (
archived_ts: The timestamp indicating when the alert was closed/archived.
archived_by: The identifier of the user that closed/archived the alert.
expiration: The expiration timestamp for the alert.
count: The number of times the alert has been triggered.
count_last_ts: The timestamp of the most recent trigger of the alert.
The alerting system supports polymorphism to accommodate specific fields for different alert types.
Alert target depends on the alert type. It could be a segment, but also an import, a feed, or any other type of object.
Alerts will always have a property object representing the target. You don't have to do multiple queries to have important info.
Those alerts have a
drop_ratefield representing the total drop (in percentage) of the segment volume since the alert was first triggered
To provide a familiar terminology to users, alerts can be opened or closed. However, in the system, the open/closed state is represented by the
archivedfield. Opening an alert sets the
false, while closing an alert sets it to
true. The closed state implies that the alert is no longer active or visible to users.
To avoid having multiple instances of the same alert, the system employs a prevention mechanism. Each alert has
count_last_tsproperties. When triggering a new alert, we check if there is already an active alert for the same target. If such an alert exists, the system increments the
countproperty and updates the
count_last_tsto reflect the latest trigger. This prevents the proliferation of identical alerts and ensures that only one alert remains active with an incremented counter.
For example, if a segment has a query error and the issue persists without resolution, the system will increment the
countproperty of the existing alert rather than creating multiple duplicate alerts.
count_last_tsproperty stores the timestamp of the most recent trigger, while the
created_tsproperty stores the timestamp of the initial trigger.
To manage the storage of alerts and ensure their relevance, the system implements an expiration mechanism. Alerts have an expiration duration associated with them. It is set to the
created_ts+ 1 month. You can't modify this behavior.
A cleaning job runs regularly to identify and delete all expired alerts from the database. This prevents the accumulation of unnecessary historical data.
The API allows users and integrators to interact with alerts through the following functionalities:API
Retrieve a list of alerts based on specific criteria
You have to fill in either the
Archived alerts are not returned by default. You need to ask them through the
ID of the organisation in which to find alerts
ID of the datamart in which to find alerts
ID of the community in which to find alerts
trueto return archived alerts.
List of alerts
You don't have access to the organisation, datamart or community
Change the status of an alert from open to closed or vice versa
ID of the alert to edit
trueto close an alert,
falseto open it.
OK. Returns the new alert object.
400: Bad Request
Missing parameter: archive
You can't open/close this alert
ID of the alert to delete
No other operations or modifications are permitted through the API.
Users and integrators are restricted from editing any field other than the
archivedflag for an alert.