Alert
AlertDispatchType
¶
Source code in python/scouter/alert/_alert.pyi
AlertThreshold
¶
Enum representing different alert conditions for monitoring metrics.
Attributes:
Name | Type | Description |
---|---|---|
Below |
AlertThreshold
|
Indicates that an alert should be triggered when the metric is below a threshold. |
Above |
AlertThreshold
|
Indicates that an alert should be triggered when the metric is above a threshold. |
Outside |
AlertThreshold
|
Indicates that an alert should be triggered when the metric is outside a specified range. |
Source code in python/scouter/alert/_alert.pyi
from_value(value)
staticmethod
¶
Creates an AlertThreshold enum member from a string value.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
str
|
The string representation of the alert condition. |
required |
Returns:
Name | Type | Description |
---|---|---|
AlertThreshold |
AlertThreshold
|
The corresponding AlertThreshold enum member. |
Source code in python/scouter/alert/_alert.pyi
ConsoleDispatchConfig
¶
Source code in python/scouter/alert/_alert.pyi
CustomMetricAlertCondition
¶
Source code in python/scouter/alert/_alert.pyi
alert_threshold
property
writable
¶
Return the alert_threshold
alert_threshold_value
property
writable
¶
Return the alert_threshold_value
__init__(alert_threshold, alert_threshold_value)
¶
Initialize a CustomMetricAlertCondition instance. Args: alert_threshold (AlertThreshold): The condition that determines when an alert should be triggered. This could be comparisons like 'greater than', 'less than', 'equal to', etc. alert_threshold_value (Optional[float], optional): A numerical boundary used in conjunction with the alert_threshold. This can be None for certain types of comparisons that don't require a fixed boundary. Example: alert_threshold = CustomMetricAlertCondition(AlertCondition.BELOW, 2.0)
Source code in python/scouter/alert/_alert.pyi
CustomMetricAlertConfig
¶
Source code in python/scouter/alert/_alert.pyi
alert_conditions
property
writable
¶
Return the alert_condition that were set during metric definition
dispatch_config
property
¶
Return the dispatch config
dispatch_type
property
¶
Return the alert dispatch type
schedule
property
writable
¶
Return the schedule
__init__(dispatch_config=None, schedule=None)
¶
Initialize alert config
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dispatch_config
|
Optional[SlackDispatchConfig | OpsGenieDispatchConfig]
|
Alert dispatch config. Defaults to console |
None
|
schedule
|
Optional[str | CommonCrons]
|
Schedule to run monitor. Defaults to daily at midnight |
None
|
Source code in python/scouter/alert/_alert.pyi
OpsGenieDispatchConfig
¶
Source code in python/scouter/alert/_alert.pyi
PsiAlertConfig
¶
Source code in python/scouter/alert/_alert.pyi
dispatch_config
property
¶
Return the dispatch config
dispatch_type
property
¶
Return the alert dispatch type
features_to_monitor
property
writable
¶
Return the features to monitor
schedule
property
writable
¶
Return the schedule
threshold
property
¶
Return the threshold config
__init__(dispatch_config=None, schedule=None, features_to_monitor=[], threshold=PsiChiSquareThreshold())
¶
Initialize alert config
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dispatch_config
|
Optional[SlackDispatchConfig | OpsGenieDispatchConfig]
|
Alert dispatch configuration to use. Defaults to an internal "Console" type where the alerts will be logged to the console |
None
|
schedule
|
Optional[str | CommonCrons]
|
Schedule to run monitor. Defaults to daily at midnight |
None
|
features_to_monitor
|
List[str]
|
List of features to monitor. Defaults to empty list, which means all features |
[]
|
threshold
|
Optional[PsiThresholdType]
|
Configuration that helps determine how to calculate PSI critical values. Defaults to PsiChiSquareThreshold, which uses the chi-square distribution. |
PsiChiSquareThreshold()
|
Source code in python/scouter/alert/_alert.pyi
PsiChiSquareThreshold
¶
Source code in python/scouter/alert/_alert.pyi
alpha
property
writable
¶
Statistical significance level for drift detection.
__init__(alpha=0.05)
¶
Initialize PSI threshold using chi-square approximation.
Uses the asymptotic chi-square distribution of PSI.
The chi-square method is generally more statistically rigorous than normal approximation, especially for smaller sample sizes.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
alpha
|
float
|
Significance level (0.0 to 1.0, exclusive). Common values: 0.05 (95% confidence), 0.01 (99% confidence) |
0.05
|
Raises:
Type | Description |
---|---|
ValueError
|
If alpha not in range (0.0, 1.0) |
Source code in python/scouter/alert/_alert.pyi
PsiFixedThreshold
¶
Source code in python/scouter/alert/_alert.pyi
threshold
property
writable
¶
Fixed PSI threshold value for drift detection.
__init__(threshold=0.25)
¶
Initialize PSI threshold using a fixed value.
Uses a predetermined PSI threshold value, similar to traditional "rule of thumb" approaches (e.g., 0.10 for moderate drift, 0.25 for significant drift).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
threshold
|
float
|
Fixed PSI threshold value (must be positive). Common industry values: 0.10, 0.25 |
0.25
|
Raises:
Type | Description |
---|---|
ValueError
|
If threshold is not positive |
Source code in python/scouter/alert/_alert.pyi
PsiNormalThreshold
¶
Source code in python/scouter/alert/_alert.pyi
alpha
property
writable
¶
Statistical significance level for drift detection.
__init__(alpha=0.05)
¶
Initialize PSI threshold using normal approximation.
Uses the asymptotic normal distribution of PSI to calculate critical values for population drift detection.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
alpha
|
float
|
Significance level (0.0 to 1.0, exclusive). Common values: 0.05 (95% confidence), 0.01 (99% confidence) |
0.05
|
Raises:
Type | Description |
---|---|
ValueError
|
If alpha not in range (0.0, 1.0) |
Source code in python/scouter/alert/_alert.pyi
SlackDispatchConfig
¶
Source code in python/scouter/alert/_alert.pyi
SpcAlert
¶
Source code in python/scouter/alert/_alert.pyi
SpcAlertConfig
¶
Source code in python/scouter/alert/_alert.pyi
dispatch_config
property
¶
Return the dispatch config
dispatch_type
property
¶
Return the alert dispatch type
features_to_monitor
property
writable
¶
Return the features to monitor
rule
property
writable
¶
Return the alert rule
schedule
property
writable
¶
Return the schedule
__init__(rule=SpcAlertRule(), dispatch_config=None, schedule=None, features_to_monitor=[])
¶
Initialize alert config
Parameters:
Name | Type | Description | Default |
---|---|---|---|
rule
|
SpcAlertRule
|
Alert rule to use. Defaults to Standard |
SpcAlertRule()
|
dispatch_config
|
Optional[SlackDispatchConfig | OpsGenieDispatchConfig]
|
Alert dispatch config. Defaults to console |
None
|
schedule
|
Optional[str | CommonCrons]
|
Schedule to run monitor. Defaults to daily at midnight |
None
|
features_to_monitor
|
List[str]
|
List of features to monitor. Defaults to empty list, which means all features |
[]
|
Source code in python/scouter/alert/_alert.pyi
SpcAlertRule
¶
Source code in python/scouter/alert/_alert.pyi
rule
property
writable
¶
Return the alert rule
zones_to_monitor
property
writable
¶
Return the zones to monitor
__init__(rule='8 16 4 8 2 4 1 1', zones_to_monitor=[AlertZone.Zone1, AlertZone.Zone2, AlertZone.Zone3, AlertZone.Zone4])
¶
Initialize alert rule
Parameters:
Name | Type | Description | Default |
---|---|---|---|
rule
|
str
|
Rule to use for alerting. Eight digit integer string. Defaults to '8 16 4 8 2 4 1 1' |
'8 16 4 8 2 4 1 1'
|
zones_to_monitor
|
List[AlertZone]
|
List of zones to monitor. Defaults to all zones. |
[Zone1, Zone2, Zone3, Zone4]
|