asab icon indicating copy to clipboard operation
asab copied to clipboard

Trigger an alert when metric reaches predefined treshold

Open ateska opened this issue 3 years ago • 0 comments

The user should be able to configure an alert on any metrics (counter?) so that if the metric reaches that threshold, alert is triggered.

Example of the alert definition from config:

[metric:alert:my-alert]
metric_name=web_requests_duration_min
metric_tags=
    method=GET
    status=200
    path=*
threshold=>0.5
title="Alert title"

The alert should be installed to the metrics at https://github.com/TeskaLabs/asab/blob/d6007d41108eadd1e25d82f69cd3ad50c5e7fee6/asab/metrics/service.py#L109

Questions:

  • [ ] Will this work for dynamic tags?
  • [ ] Alert is specific to a metrics type, so it is an internal logic of the each metric class how to implement threshold detection
  • [ ] Alerts should be also "untriggered" (aka clear).

ateska avatar Aug 26 '22 15:08 ateska