I checked what kind of CloudWatch alarms are configured when setting up CloudWatch Application Insights for an ECS cluster in Container Insights

I checked what kind of CloudWatch alarms are configured when setting up CloudWatch Application Insights for an ECS cluster in Container Insights

If you want to manage dashboards and alarms for each application
2026.01.18

This page has been translated by machine translation. View original

I want to check what CloudWatch alarms are set when configuring CloudWatch Application Insights for ECS

Hello, this is nonPi (@non____97).

Have you ever wondered what CloudWatch alarms are set when configuring CloudWatch Application Insights for ECS? I have.

As introduced in the article below, you can easily enable CloudWatch Application Insights from the Container Insights console.

https://dev.classmethod.jp/articles/ecs-container-insights-with-enhanced-observability-java-application/

By setting up Application Insights, you can easily configure application dashboards and alarms, as well as manage events.

https://docs.aws.amazon.com/ja_jp/AmazonCloudWatch/latest/monitoring/appinsights-what-is.html

So what kind of alarms are set? I couldn't find any documentation about what alarms are set, so I checked it myself.

Summary

  • CloudWatch Alarms set when configuring CloudWatch Application Insights for ECS
    • ALB's HTTPCode_Target_4XX_Count
    • ALB's HTTPCode_Target_5XX_Count
    • ECS cluster's MemoryUtilized
    • ECS cluster's CpuUtilized

My Investigation

Test Environment

Here's my test environment.

Test environment diagram.png

I'm reusing what I used in the article below.

https://dev.classmethod.jp/articles/aws-firelens-to-s3-with-data-firehose-dynamic-partitioning/

The code is stored in the following repository.

https://github.com/non-97/ecs-native-blue-green/tree/v1.0.1

Enabling CloudWatch Application Insights

I'll enable Application Insights.

This is done from the Container Insights console.

When I checked the Application Insights tab, it displayed "Application monitoring has been successfully enabled. It will take some time for results to appear. Use the refresh button to view results."

1.Application Insights auto configuration.png

I clicked "Auto-configure Application Insights" to enable it.

2.Successfully enabled.png

It appears to be enabled.

Checking the Application Insights Dashboard

After a while, I could see the issues that occurred as shown below. It seems to be about 4XX errors returned by the backend.

3. ALB- Backend 4XX errors.png

When I checked the Application Insights console, I could confirm the same content.

17.Application Insights Overview.png

Selecting the application from Applications, I could see the Application Insights dashboard as shown below.

4.Application Insights.png

There are about four alarms set, and one is in alarm state.

The dashboard shows CPU and memory usage metrics.

When I clicked the Container Insights link "ALB: Backend 4XX errors", I saw the following screen.

19.ALB- Backend 4XX errors.png

For reference, clicking "Edit" shows the following screen.

16.Edit.png

Checking Components

Let's check the components.

5.Components.png

The type appears to be an ECS cluster. I clicked the component and workload links.

I could see the dashboard as shown below.

6.Component_Dashboard.png

I clicked the Resources tab. The ECS service seems to be registered as a resource.

7.Resources.png

When I selected it and clicked "View details", the ECS service was displayed.

8.ECSService.png

The Monitored Workloads, Logs, Metrics, and Alarms tabs are as follows:

9.Monitored Workloads.png
10.Logs.png
11.Metrics.png
12.Metrics2.png
13.Alarms.png

Managing Component Monitoring

I'll edit the metrics handled in the component monitoring. I clicked "Manage component monitoring".

20.Manage component monitoring.png

The screen below allows me to manage the monitored metrics and set custom alarms.

21.Manage monitoring for- EcsNativeBlueGreenStack-EcsConstructCluster14AE103B-0UD5SYuupUOg.png

For component metrics, I can select either built-in metrics or metrics available through Container Insights.

22.Component Metrics.png

ALB metrics can also be selected as shown below.

23.Application Load Balancer Metrics.png

This time, I added TaskCount and ActiveConnectionCount and clicked "Save".

24.Save.png

Then, when I checked the metrics selection list from "Add or remove metrics" in the dashboard, I could see the metrics I just added.

25.Select onboard metrics to track on dashboard.png

When I added the metrics, they were reflected in the dashboard as shown below.

26.Metrics added.png

Checking Configuration History

I checked the Configuration History tab.

14.Configuration History.png

Resource Status Creation Date Details
CLOUDWATCH_ALARM Info January 17, 2026, 23:36 (UTC+09:00) Not enough data to predict the threshold. Metric : TargetResponseTime. Component: arn:aws:elasticloadbalancing:us-east-1:<AWSAccountID>:loadbalancer/app/EcsNat-AlbCo-gB01lRgFgX9v/34111fdfed82112c
CLOUDWATCH_METRIC Info January 17, 2026, 23:36 (UTC+09:00) Metric UnHealthyHostCount does not exist for component arn:aws:ecs:us-east-1:<AWSAccountID>:cluster/EcsNativeBlueGreenStack-EcsConstructCluster14AE103B-0UD5SYuupUOg, subcomponent arn:aws:elasticloadbalancing:us-east-1:<AWSAccountID>:loadbalancer/app/EcsNat-AlbCo-gB01lRgFgX9v/34111fdfed82112c, alarm cannot be created. Possible reason might be metric misses data points for two weeks, or required workload to emit this metric not installed.
CLOUDWATCH_METRIC Info January 17, 2026, 23:36 (UTC+09:00) Metric PendingTaskCount does not exist for component arn:aws:ecs:us-east-1:<AWSAccountID>:cluster/EcsNativeBlueGreenStack-EcsConstructCluster14AE103B-0UD5SYuupUOg, alarm cannot be created. Possible reason might be metric misses data points for two weeks, or required workload to emit this metric not installed.
CLOUDWATCH_ALARM Info January 17, 2026, 23:36 (UTC+09:00) Not enough data to predict the threshold. Metric : StorageReadBytes. Component: arn:aws:ecs:us-east-1:<AWSAccountID>:cluster/EcsNativeBlueGreenStack-EcsConstructCluster14AE103B-0UD5SYuupUOg
SNS_NOTIFICATIONS Info January 17, 2026, 23:36 (UTC+09:00) Problem notifications aren't enabled. Notifications can be enabled on the application edit page.
CLOUDWATCH_ALARM Info January 17, 2026, 23:36 (UTC+09:00) Not enough data to predict the threshold. Metric : NetworkTxBytes. Component: arn:aws:ecs:us-east-1:<AWSAccountID>:cluster/EcsNativeBlueGreenStack-EcsConstructCluster14AE103B-0UD5SYuupUOg
CLOUDWATCH_METRIC Info January 17, 2026, 23:36 (UTC+09:00) Metric RunningTaskCount does not exist for component arn:aws:ecs:us-east-1:<AWSAccountID>:cluster/EcsNativeBlueGreenStack-EcsConstructCluster14AE103B-0UD5SYuupUOg, alarm cannot be created. Possible reason might be metric misses data points for two weeks, or required workload to emit this metric not installed.
CLOUDWATCH_ALARM Info January 17, 2026, 23:36 (UTC+09:00) Not enough data to predict the threshold. Metric : StorageWriteBytes. Component: arn:aws:ecs:us-east-1:<AWSAccountID>:cluster/EcsNativeBlueGreenStack-EcsConstructCluster14AE103B-0UD5SYuupUOg
CLOUDWATCH_ALARM Info January 17, 2026, 23:36 (UTC+09:00) Not enough data to predict the threshold. Metric : NetworkRxBytes. Component: arn:aws:ecs:us-east-1:<AWSAccountID>:cluster/EcsNativeBlueGreenStack-EcsConstructCluster14AE103B-0UD5SYuupUOg

There are several resources with "Not enough data to predict the threshold. Metric" for CLOUDWATCH_ALARM.

The target metrics are:

  • ALB's TargetResponseTime
  • ECS cluster's StorageReadBytes
  • ECS cluster's StorageWriteBytes
  • ECS cluster's NetworkTxBytes
  • ECS cluster's NetworkRxBytes

These weren't in the CloudWatch alarms I checked later.

Based on the message, I thought it might be trying to set up CloudWatch Anomaly Detection, but I couldn't find any evidence in CloudTrail that it was trying to create such CloudWatch alarms.

Checking Log Patterns

No log patterns are set.

15.Log Patterns.png

Checking CloudWatch Alarms

Let's check the CloudWatch alarms.

Looking at CloudWatch Alarms, four are set as follows:

18.Alarms.png

Specifically, alarms were set for the following four metrics:

  • ALB's HTTPCode_Target_4XX_Count
  • ALB's HTTPCode_Target_5XX_Count
  • ECS cluster's MemoryUtilized
  • ECS cluster's CpuUtilized

The configuration for each alarm is as follows:

ApplicationInsights/ApplicationInsights-ContainerInsights-ECS_CLUSTER-EcsNativeBlueGreenStack-EcsConstructCluster14AE103B-0UD5SYuupUOg/AWS/ApplicationELB/HTTPCode_Target_4XX_Count/app/EcsNat-AlbCo-gB01lRgFgX9v/34111fdfed82112c/
Type: AWS::CloudWatch::Alarm
Properties:
    AlarmName: ApplicationInsights/ApplicationInsights-ContainerInsights-ECS_CLUSTER-EcsNativeBlueGreenStack-EcsConstructCluster14AE103B-0UD5SYuupUOg/AWS/ApplicationELB/HTTPCode_Target_4XX_Count/app/EcsNat-AlbCo-gB01lRgFgX9v/34111fdfed82112c/
    AlarmDescription: This is math expression alarm created and managed by the
        CloudWatch Application Insights. To make changes please go to your
        application's configuration in Application Insights
    Tags:
        - Key: ApplicationInsightsManaged
          Value: "TRUE"
    ActionsEnabled: true
    OKActions: []
    AlarmActions: []
    InsufficientDataActions: []
    Dimensions: []
    EvaluationPeriods: 2
    DatapointsToAlarm: 2
    Threshold: 0.7
    ComparisonOperator: GreaterThanOrEqualToThreshold
    TreatMissingData: notBreaching
    Metrics:
        - Id: m8
          Label: HTTPCode_Target_4XX_Count
          Expression: m8_HTTPCode_Target_4XX_Count/m8_RequestCount
        - Id: m8_HTTPCode_Target_4XX_Count
          Label: input
          ReturnData: false
          MetricStat:
              Metric:
                  Namespace: AWS/ApplicationELB
                  MetricName: HTTPCode_Target_4XX_Count
                  Dimensions:
                      - Name: LoadBalancer
                        Value: app/EcsNat-AlbCo-gB01lRgFgX9v/34111fdfed82112c
              Period: 300
              Stat: Sum
              Unit: Count
        - Id: m8_RequestCount
          Label: input
          ReturnData: false
          MetricStat:
              Metric:
                  Namespace: AWS/ApplicationELB
                  MetricName: RequestCount
                  Dimensions:
                      - Name: LoadBalancer
                        Value: app/EcsNat-AlbCo-gB01lRgFgX9v/34111fdfed82112c
              Period: 300
              Stat: Sum
              Unit: Count

ApplicationInsights/ApplicationInsights-ContainerInsights-ECS_CLUSTER-EcsNativeBlueGreenStack-EcsConstructCluster14AE103B-0UD5SYuupUOg/AWS/ApplicationELB/HTTPCode_Target_5XX_Count/app/EcsNat-AlbCo-gB01lRgFgX9v/34111fdfed82112c/
Type: AWS::CloudWatch::Alarm
Properties:
    AlarmName: ApplicationInsights/ApplicationInsights-ContainerInsights-ECS_CLUSTER-EcsNativeBlueGreenStack-EcsConstructCluster14AE103B-0UD5SYuupUOg/AWS/ApplicationELB/HTTPCode_Target_5XX_Count/app/EcsNat-AlbCo-gB01lRgFgX9v/34111fdfed82112c/
    AlarmDescription: This is math expression alarm created and managed by the
        CloudWatch Application Insights. To make changes please go to your
        application's configuration in Application Insights
    Tags:
        - Key: ApplicationInsightsManaged
          Value: "TRUE"
    ActionsEnabled: true
    OKActions: []
    AlarmActions: []
    InsufficientDataActions: []
    Dimensions: []
    EvaluationPeriods: 2
    DatapointsToAlarm: 2
    Threshold: 0.1
    ComparisonOperator: GreaterThanOrEqualToThreshold
    TreatMissingData: notBreaching
    Metrics:
        - Id: m7
          Label: HTTPCode_Target_5XX_Count
          Expression: m7_HTTPCode_Target_5XX_Count/m7_RequestCount
        - Id: m7_HTTPCode_Target_5XX_Count
          Label: input
          ReturnData: false
          MetricStat:
              Metric:
                  Namespace: AWS/ApplicationELB
                  MetricName: HTTPCode_Target_5XX_Count
                  Dimensions:
                      - Name: LoadBalancer
                        Value: app/EcsNat-AlbCo-gB01lRgFgX9v/34111fdfed82112c
              Period: 300
              Stat: Sum
              Unit: Count
        - Id: m7_RequestCount
          Label: input
          ReturnData: false
          MetricStat:
              Metric:
                  Namespace: AWS/ApplicationELB
                  MetricName: RequestCount
                  Dimensions:
                      - Name: LoadBalancer
                        Value: app/EcsNat-AlbCo-gB01lRgFgX9v/34111fdfed82112c
              Period: 300
              Stat: Sum
              Unit: Count

ApplicationInsights/ApplicationInsights-ContainerInsights-ECS_CLUSTER-EcsNativeBlueGreenStack-EcsConstructCluster14AE103B-0UD5SYuupUOg/ECS/ContainerInsights/MemoryUtilized/EcsNativeBlueGreenStack-EcsConstructCluster14AE103B-0UD5SYuupUOg/
Type: AWS::CloudWatch::Alarm
Properties:
    AlarmName: ApplicationInsights/ApplicationInsights-ContainerInsights-ECS_CLUSTER-EcsNativeBlueGreenStack-EcsConstructCluster14AE103B-0UD5SYuupUOg/ECS/ContainerInsights/MemoryUtilized/EcsNativeBlueGreenStack-EcsConstructCluster14AE103B-0UD5SYuupUOg/
    AlarmDescription: This is math expression alarm created and managed by the
        CloudWatch Application Insights. To make changes please go to your
        application's configuration in Application Insights
    Tags:
        - Key: ApplicationInsightsManaged
          Value: "TRUE"
    ActionsEnabled: true
    OKActions: []
    AlarmActions: []
    InsufficientDataActions: []
    Dimensions: []
    EvaluationPeriods: 2
    DatapointsToAlarm: 2
    Threshold: 0.9
    ComparisonOperator: GreaterThanOrEqualToThreshold
    TreatMissingData: ignore
    Metrics:
        - Id: m1
          Label: MemoryUtilized
          Expression: m1_MemoryUtilized/m1_MemoryReserved
        - Id: m1_MemoryUtilized
          Label: input
          ReturnData: false
          MetricStat:
              Metric:
                  Namespace: ECS/ContainerInsights
                  MetricName: MemoryUtilized
                  Dimensions:
                      - Name: ClusterName
                        Value: EcsNativeBlueGreenStack-EcsConstructCluster14AE103B-0UD5SYuupUOg
              Period: 300
              Stat: Average
              Unit: Megabytes
        - Id: m1_MemoryReserved
          Label: input
          ReturnData: false
          MetricStat:
              Metric:
                  Namespace: ECS/ContainerInsights
                  MetricName: MemoryReserved
                  Dimensions:
                      - Name: ClusterName
                        Value: EcsNativeBlueGreenStack-EcsConstructCluster14AE103B-0UD5SYuupUOg
              Period: 300
              Stat: Average
              Unit: Megabytes

ApplicationInsights/ApplicationInsights-ContainerInsights-ECS_CLUSTER-EcsNativeBlueGreenStack-EcsConstructCluster14AE103B-0UD5SYuupUOg/ECS/ContainerInsights/CpuUtilized/EcsNativeBlueGreenStack-EcsConstructCluster14AE103B-0UD5SYuupUOg/
Type: AWS::CloudWatch::Alarm
Properties:
    AlarmName: ApplicationInsights/ApplicationInsights-ContainerInsights-ECS_CLUSTER-EcsNativeBlueGreenStack-EcsConstructCluster14AE103B-0UD5SYuupUOg/ECS/ContainerInsights/CpuUtilized/EcsNativeBlueGreenStack-EcsConstructCluster14AE103B-0UD5SYuupUOg/
    AlarmDescription: This is math expression alarm created and managed by the
        CloudWatch Application Insights. To make changes please go to your
        application's configuration in Application Insights
    Tags:
        - Key: ApplicationInsightsManaged
          Value: "TRUE"
    ActionsEnabled: true
    OKActions: []
    AlarmActions: []
    InsufficientDataActions: []
    Dimensions: []
    EvaluationPeriods: 2
    DatapointsToAlarm: 2
    Threshold: 0.9
    ComparisonOperator: GreaterThanOrEqualToThreshold
    TreatMissingData: ignore
    Metrics:
        - Id: m3
          Label: CpuUtilized
          Expression: m3_CpuUtilized/m3_CpuReserved
        - Id: m3_CpuUtilized
          Label: input
          ReturnData: false
          MetricStat:
              Metric:
                  Namespace: ECS/ContainerInsights
                  MetricName: CpuUtilized
                  Dimensions:
                      - Name: ClusterName
                        Value: EcsNativeBlueGreenStack-EcsConstructCluster14AE103B-0UD5SYuupUOg
              Period: 300
              Stat: Average
              Unit: None
        - Id: m3_CpuReserved
          Label: input
          ReturnData: false
          MetricStat:
              Metric:
                  Namespace: ECS/ContainerInsights
                  MetricName: CpuReserved
                  Dimensions:
                      - Name: ClusterName
                        Value: EcsNativeBlueGreenStack-EcsConstructCluster14AE103B-0UD5SYuupUOg
              Period: 300
              Stat: Average
              Unit: None

For managing dashboards and alarms for each application

I checked what CloudWatch Alarms are set when configuring CloudWatch Application Insights for an ECS cluster in Container Insights.

It seems useful for managing dashboards and alarms for each application.

I hope this article helps someone.

That's all from nonPi (@non____97) in the Consulting Department of the Cloud Business Division!

Share this article

FacebookHatena blogX

Related articles