snsary.utils.tracing.monitors
Module Contents
- class snsary.utils.tracing.monitors.Monitor
Analyses
Samplesof the execution of some code.- abstract analyse(sample)
- classmethod factory(**kwargs)
- class snsary.utils.tracing.monitors.TimeSeriesAlert(*, history=None)
Bases:
MonitorProvides a
HistoryofSamplesover time to support time series alerting. Each subclass is responsible for managing the history.- MAX_HISTORY = 300
- class snsary.utils.tracing.monitors.LivenessAlert(*, history=None)
Bases:
TimeSeriesAlertLogs an error when a complete history of samples is nothing but failures.
The history is reset every time the monitor logs an error.
- analyse(sample)
- class snsary.utils.tracing.monitors.GapAlert(*, max_gaps=MAX_GAPS, **kwargs)
Bases:
TimeSeriesAlertLogs an error when there are too many gaps in
SUCCESSsamples. A gap is one or moreFAILUREsamples followed by aSUCCESSsample.The history is reset every time the monitor logs an error.
- MAX_GAPS = 30
- analyse(sample)