CfnAnomalyDetectorPropsMixin
- class aws_cdk.mixins_preview.aws_aps.mixins.CfnAnomalyDetectorPropsMixin(props, *, strategy=None)
Bases:
MixinAnomaly detection uses the Random Cut Forest algorithm for time-series analysis.
The anomaly detector analyzes Amazon Managed Service for Prometheus metrics to identify unusual patterns and behaviors.
- See:
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-aps-anomalydetector.html
- CloudformationResource:
AWS::APS::AnomalyDetector
- Mixin:
true
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview import mixins from aws_cdk.mixins_preview.aws_aps import mixins as aps_mixins cfn_anomaly_detector_props_mixin = aps_mixins.CfnAnomalyDetectorPropsMixin(aps_mixins.CfnAnomalyDetectorMixinProps( alias="alias", configuration=aps_mixins.CfnAnomalyDetectorPropsMixin.AnomalyDetectorConfigurationProperty( random_cut_forest=aps_mixins.CfnAnomalyDetectorPropsMixin.RandomCutForestConfigurationProperty( ignore_near_expected_from_above=aps_mixins.CfnAnomalyDetectorPropsMixin.IgnoreNearExpectedProperty( amount=123, ratio=123 ), ignore_near_expected_from_below=aps_mixins.CfnAnomalyDetectorPropsMixin.IgnoreNearExpectedProperty( amount=123, ratio=123 ), query="query", sample_size=123, shingle_size=123 ) ), evaluation_interval_in_seconds=123, labels=[aps_mixins.CfnAnomalyDetectorPropsMixin.LabelProperty( key="key", value="value" )], missing_data_action=aps_mixins.CfnAnomalyDetectorPropsMixin.MissingDataActionProperty( mark_as_anomaly=False, skip=False ), tags=[CfnTag( key="key", value="value" )], workspace="workspace" ), strategy=mixins.PropertyMergeStrategy.OVERRIDE )
Create a mixin to apply properties to
AWS::APS::AnomalyDetector.- Parameters:
props (
Union[CfnAnomalyDetectorMixinProps,Dict[str,Any]]) – L1 properties to apply.strategy (
Optional[PropertyMergeStrategy]) – (experimental) Strategy for merging nested properties. Default: - PropertyMergeStrategy.MERGE
Methods
- apply_to(construct)
Apply the mixin properties to the construct.
- Parameters:
construct (
IConstruct)- Return type:
- supports(construct)
Check if this mixin supports the given construct.
- Parameters:
construct (
IConstruct)- Return type:
bool
Attributes
- CFN_PROPERTY_KEYS = ['alias', 'configuration', 'evaluationIntervalInSeconds', 'labels', 'missingDataAction', 'tags', 'workspace']
Static Methods
- classmethod is_mixin(x)
(experimental) Checks if
xis a Mixin.- Parameters:
x (
Any) – Any object.- Return type:
bool- Returns:
true if
xis an object created from a class which extendsMixin.- Stability:
experimental
AnomalyDetectorConfigurationProperty
- class CfnAnomalyDetectorPropsMixin.AnomalyDetectorConfigurationProperty(*, random_cut_forest=None)
Bases:
objectThe configuration for the anomaly detection algorithm.
- Parameters:
random_cut_forest (
Union[IResolvable,RandomCutForestConfigurationProperty,Dict[str,Any],None]) – The Random Cut Forest algorithm configuration for anomaly detection.- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_aps import mixins as aps_mixins anomaly_detector_configuration_property = aps_mixins.CfnAnomalyDetectorPropsMixin.AnomalyDetectorConfigurationProperty( random_cut_forest=aps_mixins.CfnAnomalyDetectorPropsMixin.RandomCutForestConfigurationProperty( ignore_near_expected_from_above=aps_mixins.CfnAnomalyDetectorPropsMixin.IgnoreNearExpectedProperty( amount=123, ratio=123 ), ignore_near_expected_from_below=aps_mixins.CfnAnomalyDetectorPropsMixin.IgnoreNearExpectedProperty( amount=123, ratio=123 ), query="query", sample_size=123, shingle_size=123 ) )
Attributes
- random_cut_forest
The Random Cut Forest algorithm configuration for anomaly detection.
IgnoreNearExpectedProperty
- class CfnAnomalyDetectorPropsMixin.IgnoreNearExpectedProperty(*, amount=None, ratio=None)
Bases:
objectConfiguration for threshold settings that determine when values near expected values should be ignored during anomaly detection.
- Parameters:
amount (
Union[int,float,None]) – The absolute amount by which values can differ from expected values before being considered anomalous.ratio (
Union[int,float,None]) – The ratio by which values can differ from expected values before being considered anomalous.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_aps import mixins as aps_mixins ignore_near_expected_property = aps_mixins.CfnAnomalyDetectorPropsMixin.IgnoreNearExpectedProperty( amount=123, ratio=123 )
Attributes
- amount
The absolute amount by which values can differ from expected values before being considered anomalous.
- ratio
The ratio by which values can differ from expected values before being considered anomalous.
LabelProperty
- class CfnAnomalyDetectorPropsMixin.LabelProperty(*, key=None, value=None)
Bases:
objectThe Amazon Managed Service for Prometheus metric labels associated with the anomaly detector.
- Parameters:
key (
Optional[str]) – The key of the label.value (
Optional[str]) – The value for this label.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_aps import mixins as aps_mixins label_property = aps_mixins.CfnAnomalyDetectorPropsMixin.LabelProperty( key="key", value="value" )
Attributes
- key
The key of the label.
- value
The value for this label.
MissingDataActionProperty
- class CfnAnomalyDetectorPropsMixin.MissingDataActionProperty(*, mark_as_anomaly=None, skip=None)
Bases:
objectSpecifies the action to take when data is missing during anomaly detection evaluation.
- Parameters:
mark_as_anomaly (
Union[bool,IResolvable,None]) – Marks missing data points as anomalies.skip (
Union[bool,IResolvable,None]) – Skips evaluation when data is missing.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_aps import mixins as aps_mixins missing_data_action_property = aps_mixins.CfnAnomalyDetectorPropsMixin.MissingDataActionProperty( mark_as_anomaly=False, skip=False )
Attributes
- mark_as_anomaly
Marks missing data points as anomalies.
- skip
Skips evaluation when data is missing.
RandomCutForestConfigurationProperty
- class CfnAnomalyDetectorPropsMixin.RandomCutForestConfigurationProperty(*, ignore_near_expected_from_above=None, ignore_near_expected_from_below=None, query=None, sample_size=None, shingle_size=None)
Bases:
objectConfiguration for the Random Cut Forest algorithm used for anomaly detection in time-series data.
- Parameters:
ignore_near_expected_from_above (
Union[IResolvable,IgnoreNearExpectedProperty,Dict[str,Any],None]) – Configuration for ignoring values that are near expected values from above during anomaly detection.ignore_near_expected_from_below (
Union[IResolvable,IgnoreNearExpectedProperty,Dict[str,Any],None]) – Configuration for ignoring values that are near expected values from below during anomaly detection.query (
Optional[str]) – The Prometheus query used to retrieve the time-series data for anomaly detection. .. epigraph:: Random Cut Forest queries must be wrapped by a supported PromQL aggregation operator. For more information, see Aggregation operators on the Prometheus docs website. Supported PromQL aggregation operators :avg,count,group,max,min,quantile,stddev,stdvar, andsum.sample_size (
Union[int,float,None]) – The number of data points sampled from the input stream for the Random Cut Forest algorithm. The default number is 256 consecutive data points. Default: - 256shingle_size (
Union[int,float,None]) – The number of consecutive data points used to create a shingle for the Random Cut Forest algorithm. The default number is 8 consecutive data points. Default: - 8
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_aps import mixins as aps_mixins random_cut_forest_configuration_property = aps_mixins.CfnAnomalyDetectorPropsMixin.RandomCutForestConfigurationProperty( ignore_near_expected_from_above=aps_mixins.CfnAnomalyDetectorPropsMixin.IgnoreNearExpectedProperty( amount=123, ratio=123 ), ignore_near_expected_from_below=aps_mixins.CfnAnomalyDetectorPropsMixin.IgnoreNearExpectedProperty( amount=123, ratio=123 ), query="query", sample_size=123, shingle_size=123 )
Attributes
- ignore_near_expected_from_above
Configuration for ignoring values that are near expected values from above during anomaly detection.
- ignore_near_expected_from_below
Configuration for ignoring values that are near expected values from below during anomaly detection.
- query
The Prometheus query used to retrieve the time-series data for anomaly detection.
Random Cut Forest queries must be wrapped by a supported PromQL aggregation operator. For more information, see Aggregation operators on the Prometheus docs website.
Supported PromQL aggregation operators :
avg,count,group,max,min,quantile,stddev,stdvar, andsum.
- sample_size
The number of data points sampled from the input stream for the Random Cut Forest algorithm.
The default number is 256 consecutive data points.
- shingle_size
The number of consecutive data points used to create a shingle for the Random Cut Forest algorithm.
The default number is 8 consecutive data points.