-
Notifications
You must be signed in to change notification settings - Fork 0
ConfigurationByExample
See config-min-sample.json for minimal case or config-sample.json for more complex case.
For complete configuration specification, refer Configuration.
-
namespace
,metrics
: give namespace and a list of metric names to monitor. Refer the official document AWS services that publish CloudWatch metrics.
resources:
lambda:
target_resource_type: "lambda:function"
alarm:
metrics:
- Errors
This has the effect of raising an alarm if Errors
occurs in the lambda function. By default, the following properties are set for alarms. By this config, if the Errors
metric is reported once in 60 seconds, an alarm is triggered.
Property | Value |
---|---|
Statistic | "Sum" |
Period | 60 |
EvaluationPeriods | 1 |
Threshold | 1 |
ComparisonOperator | "GreaterThanOrEqualToThreshold" |
This default value is intended to detect the occurrence of faults such as Errors
and Throttled
.
-
alarm_param_overrides
: give metric name as a key, and alarm properties as a value.
resources:
sqs:
target_resource_type: "sqs:queue"
alarm:
metrics:
- ApproximateAgeOfOldestMessage
alarm_param_overrides:
ApproximateAgeOfOldestMessage:
Statistic: Maximum
Threshold: 3600
ComparisonOperator: GreaterThanThreshold
This has the effect of raising an alarm if a message exists in the SQS queue for more than 3,600 seconds.
-
globals
>alarm
>alarm_actions
: give a list of ARNs of alarm action. Typically, SNS Topic ARN to notify the alarm. For supported actions in CloudWatch, refer document.
globals:
alarm:
alarm_actions:
- arn:aws:sns:region:account-id:sns-topic-name
resources:
# omit ...
Note: The alarm actions may be given also by CLI option, then those lists are concatenated at creating of the alarm.
alarm-craft -n "arn:aws:sns:region:account-id:sns-topic"
-
target_resource_name_pattern
: give a filter string in regular expression.
resources:
lambda:
target_resource_name_pattern: "^abc-(prod|stage|dev)-"
# ... (omit)
This has the effect of limiting the monitoring to those resource names beginning with "abc-prod-"
, "abc-stage-"
or "abc-dev-"
.
-
target_resource_tags
: giving two or more tags requires having ALL specified tags.
resources:
lambda:
target_resource_tags:
Owner: mydivision
Environment: production
# ... (omit)
This has the effect of limiting the monitoring to those resources tagged with "Owner": "mydivision"
and "Environment": "production"
.
-
globals
>resource_filter
: may specifytarget_resource_name_pattern
andtarget_resource_tags
. It takes effect to all resource configs underresources
section.
globals:
resource_filter:
target_resource_tags:
Owner: mydivision
resources:
lambda:
target_resource_type: lambda:function
# ... (omit)
sfn:
target_resource_type: states:stateMachine
# ... (omit)
This has the effect of limiting the monitoring to lambda:function
and states:stateMachine
resources tagged with "Owner": "mydivision"
.
This section is intended to be configured based on your resource naming rules and tagging strategies.