CfnAnomalyDetectorPropsMixin

class aws_cdk.mixins_preview.aws_aps.mixins.CfnAnomalyDetectorPropsMixin(props, *, strategy=None)

Bases: Mixin

Anomaly 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:

Methods

apply_to(construct)

Apply the mixin properties to the construct.

Parameters:

construct (IConstruct)

Return type:

IConstruct

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 x is a Mixin.

Parameters:

x (Any) – Any object.

Return type:

bool

Returns:

true if x is an object created from a class which extends Mixin.

Stability:

experimental

AnomalyDetectorConfigurationProperty

class CfnAnomalyDetectorPropsMixin.AnomalyDetectorConfigurationProperty(*, random_cut_forest=None)

Bases: object

The 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:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-aps-anomalydetector-anomalydetectorconfiguration.html

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-aps-anomalydetector-anomalydetectorconfiguration.html#cfn-aps-anomalydetector-anomalydetectorconfiguration-randomcutforest

IgnoreNearExpectedProperty

class CfnAnomalyDetectorPropsMixin.IgnoreNearExpectedProperty(*, amount=None, ratio=None)

Bases: object

Configuration 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:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-aps-anomalydetector-ignorenearexpected.html

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-aps-anomalydetector-ignorenearexpected.html#cfn-aps-anomalydetector-ignorenearexpected-amount

ratio

The ratio by which values can differ from expected values before being considered anomalous.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-aps-anomalydetector-ignorenearexpected.html#cfn-aps-anomalydetector-ignorenearexpected-ratio

LabelProperty

class CfnAnomalyDetectorPropsMixin.LabelProperty(*, key=None, value=None)

Bases: object

The 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:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-aps-anomalydetector-label.html

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-aps-anomalydetector-label.html#cfn-aps-anomalydetector-label-key

value

The value for this label.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-aps-anomalydetector-label.html#cfn-aps-anomalydetector-label-value

MissingDataActionProperty

class CfnAnomalyDetectorPropsMixin.MissingDataActionProperty(*, mark_as_anomaly=None, skip=None)

Bases: object

Specifies 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:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-aps-anomalydetector-missingdataaction.html

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-aps-anomalydetector-missingdataaction.html#cfn-aps-anomalydetector-missingdataaction-markasanomaly

skip

Skips evaluation when data is missing.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-aps-anomalydetector-missingdataaction.html#cfn-aps-anomalydetector-missingdataaction-skip

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: object

Configuration 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 , and sum .

  • 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: - 256

  • shingle_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:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-aps-anomalydetector-randomcutforestconfiguration.html

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-aps-anomalydetector-randomcutforestconfiguration.html#cfn-aps-anomalydetector-randomcutforestconfiguration-ignorenearexpectedfromabove

ignore_near_expected_from_below

Configuration for ignoring values that are near expected values from below during anomaly detection.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-aps-anomalydetector-randomcutforestconfiguration.html#cfn-aps-anomalydetector-randomcutforestconfiguration-ignorenearexpectedfrombelow

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 , and sum .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-aps-anomalydetector-randomcutforestconfiguration.html#cfn-aps-anomalydetector-randomcutforestconfiguration-query

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.

Default:
  • 256

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-aps-anomalydetector-randomcutforestconfiguration.html#cfn-aps-anomalydetector-randomcutforestconfiguration-samplesize

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.

Default:
  • 8

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-aps-anomalydetector-randomcutforestconfiguration.html#cfn-aps-anomalydetector-randomcutforestconfiguration-shinglesize