Skip to content

Documentation: Adding an alarm to watchful's scope #754

Open
@eisenhowerj

Description

@eisenhowerj

Really enjoying cdk-watchful but I wanted to add my own custom alarm, here is how I did it:

        watchful.watch_lambda_function("MyLambda", my_lambda)
        lambda_invocations = my_lambda.metric_invocations(period=cdk.Duration.minutes(1))
        invocation_alarm = cloudwatch.Alarm(
            self,
            "Invocations",
            metric=lambda_invocations,
            evaluation_periods=1,
            threshold=20,
        )
        watchful.add_alarm(invocation_alarm)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions