panic icon indicating copy to clipboard operation
panic copied to clipboard

Remove metric state storing from the Alert Store

Open dillu24 opened this issue 4 years ago • 0 comments

Technical Story

When receiving an alert from the Alerter the AlertStore performs the following:

  • It stores the alert in Mongo
  • Stores the state of the alerted metric inside Redis. This is then used by the API/UI to display the problems in the Overview Dashboard.

Following the SRP (single responsibility principle) the AlertStore should perform one job only, that being of storing the alert in Mongo. Therefore, we need to create another component which continuously checks the values of each metric and compares them to the alertable thresholds/conditions.

In order to do this change we need to perform the following tasks:

  • Remove metric state storing logic from the AlertStore
  • Remove internal alerts mechanism as it would no longer be needed
  • Develop the MetricsStateStore by integrating each monitorable in a granular way using the Strategy pattern

Description

The aim of this ticket is to remove the metric state storing logic from the AlertStore

Requirements

To achieve the aims of this ticket you need to perform the following:

  • [ ] Remove the metric state storing logic from the AlertStore
  • [ ] Remove any variables/constants/helper functions that are no longer being used.
  • [ ] Modify the AlertStore unit tests accordingly

Acceptance criteria

When: An alert is raised Then: The alert is stored in MongoDB

When: An alert is raised Then: No metric state is stored in Redis

When: Checking the two acceptance criteria above Then: There are no errors in the AlertStore logs

dillu24 avatar Dec 29 '21 15:12 dillu24