{
    "variables": [
        {
            "type": "property",
            "property": "ClusterName",
            "inputType": "input",
            "id": "ClusterName",
            "label": "[ECS] ClusterName",
            "defaultValue": "",
            "visible": true
        }
    ],
    "widgets": [
        {
            "height": 6,
            "width": 6,
            "y": 8,
            "x": 0,
            "type": "metric",
            "properties": {
                "metrics": [
                    [ { "expression": "SEARCH('{ECS/ContainerInsights,ClusterName,ServiceName,TaskId} ClusterName=\\"project-cluster\\" MetricName=\\"TaskCpuUtilization\\"', 'p99', 60)", "id": "e1", "period": 60, "region": "ap-northeast-2", "label": "${PROP('Dim.ServiceName')}-${PROP('Dim.TaskId')}" } ]
                ],
                "view": "timeSeries",
                "stacked": false,
                "region": "ap-northeast-2",
                "stat": "Average",
                "period": 60,
                "title": "TaskCPU (1m)",
                "yAxis": {
                    "left": {
                        "showUnits": false,
                        "label": "CPU Utilization (%)",
                        "min": 0,
                        "max": 100
                    }
                },
                "liveData": true,
                "legend": {
                    "position": "hidden"
                }
            }
        },
        {
            "height": 6,
            "width": 6,
            "y": 8,
            "x": 6,
            "type": "metric",
            "properties": {
                "metrics": [
                    [ { "expression": "SEARCH('{ECS/ContainerInsights,ClusterName,ServiceName,TaskId} ClusterName=\\"project-cluster\\" MetricName=\\"TaskMemoryUtilization\\"', 'p99', 60)", "id": "e1", "period": 60, "region": "ap-northeast-2", "label": "${PROP('Dim.ServiceName')}-${PROP('Dim.TaskId')}" } ]
                ],
                "view": "timeSeries",
                "stacked": false,
                "region": "ap-northeast-2",
                "stat": "Average",
                "period": 60,
                "title": "TaskMemory (1m)",
                "yAxis": {
                    "left": {
                        "showUnits": false,
                        "label": "Memory Utilization (%)",
                        "min": 0,
                        "max": 100
                    }
                },
                "liveData": true,
                "legend": {
                    "position": "hidden"
                },
                "annotations": {
                    "horizontal": [
                        {
                            "label": "100%",
                            "value": 100
                        }
                    ]
                }
            }
        },
        {
            "height": 6,
            "width": 6,
            "y": 8,
            "x": 12,
            "type": "metric",
            "properties": {
                "metrics": [
                    [ { "expression": "SEARCH('{AWS/ECS/ManagedScaling,CapacityProviderName,ClusterName} ClusterName=\\"project-cluster\\" MetricName=\\"CapacityProviderReservation\\"', 'Maximum', 60)", "id": "e1", "period": 60, "region": "ap-northeast-2" } ]
                ],
                "view": "timeSeries",
                "stacked": false,
                "region": "ap-northeast-2",
                "stat": "Average",
                "period": 60,
                "title": "CapacityProviderReservation (1m)",
                "yAxis": {
                    "left": {
                        "showUnits": false,
                        "label": "Current/Needs (%)",
                        "min": 0,
                        "max": 200
                    }
                },
                "liveData": true,
                "legend": {
                    "position": "hidden"
                },
                "annotations": {
                    "horizontal": [
                        {
                            "label": "100%",
                            "value": 100
                        }
                    ]
                }
            }
        },
        {
            "height": 6,
            "width": 6,
            "y": 14,
            "x": 0,
            "type": "metric",
            "properties": {
                "metrics": [
                    [ { "expression": "SEARCH('{AWS/ApplicationELB,LoadBalancer,TargetGroup} MetricName=\\"RequestCount\\"', 'Sum', 60)", "id": "e1", "region": "ap-northeast-2", "period": 60 } ]
                ],
                "view": "timeSeries",
                "stacked": false,
                "region": "ap-northeast-2",
                "stat": "Average",
                "period": 60,
                "title": "ALbRequest (1m)",
                "yAxis": {
                    "left": {
                        "min": 0,
                        "label": "Request Count",
                        "showUnits": false
                    }
                },
                "liveData": true,
                "legend": {
                    "position": "hidden"
                }
            }
        },
        {
            "height": 6,
            "width": 6,
            "y": 14,
            "x": 6,
            "type": "metric",
            "properties": {
                "metrics": [
                    [ { "expression": "SUM(SEARCH('{AWS/ApplicationELB,LoadBalancer,TargetGroup} MetricName=\\"UnHealthyHostCount\\"', 'Maximum', 60))", "label": "UnHealthyHostCount", "id": "e1", "period": 300, "color": "#d62728", "region": "ap-northeast-2" } ],
                    [ { "expression": "SUM(SEARCH('{AWS/ApplicationELB,LoadBalancer,TargetGroup} MetricName=\\"HealthyHostCount\\"', 'Maximum', 60))", "label": "HealthyHostCount", "id": "e2", "period": 300, "color": "#2ca02c", "region": "ap-northeast-2" } ]
                ],
                "view": "timeSeries",
                "stacked": true,
                "region": "ap-northeast-2",
                "stat": "Average",
                "period": 300,
                "title": "ALBHostStatus (1m)",
                "liveData": true,
                "yAxis": {
                    "left": {
                        "min": 0
                    }
                }
            }
        },
        {
            "height": 6,
            "width": 6,
            "y": 14,
            "x": 12,
            "type": "metric",
            "properties": {
                "metrics": [
                    [ { "expression": "SEARCH('{AWS/ApplicationELB,LoadBalancer,TargetGroup} MetricName=\\"TargetResponseTime\\"', 'Average', 60)*1000", "id": "e2", "region": "ap-northeast-2", "label": "Average", "period": 60 } ],
                    [ { "expression": "SEARCH('{AWS/ApplicationELB,LoadBalancer,TargetGroup} MetricName=\\"TargetResponseTime\\"', 'p99', 60)*1000", "id": "e3", "region": "ap-northeast-2", "label": "99 Percentile", "period": 60 } ]
                ],
                "view": "timeSeries",
                "stacked": false,
                "region": "ap-northeast-2",
                "stat": "Average",
                "period": 60,
                "title": "LbLatency (1m)",
                "yAxis": {
                    "left": {
                        "min": 0,
                        "label": "Latency (ms)",
                        "showUnits": false
                    }
                },
                "liveData": true,
                "legend": {
                    "position": "hidden"
                }
            }
        },
        {
            "height": 6,
            "width": 6,
            "y": 14,
            "x": 18,
            "type": "metric",
            "properties": {
                "metrics": [
                    [ { "expression": "SEARCH('{AWS/ApplicationELB,LoadBalancer,TargetGroup} MetricName=\\"HTTPCode_ELB_5XX_Count\\"', 'Sum', 60)", "label": "5XX", "id": "e1", "period": 60, "region": "ap-northeast-2" } ]
                ],
                "view": "timeSeries",
                "stacked": false,
                "region": "ap-northeast-2",
                "stat": "Average",
                "period": 60,
                "liveData": true,
                "legend": {
                    "position": "hidden"
                },
                "yAxis": {
                    "left": {
                        "label": "Request Count",
                        "showUnits": false,
                        "min": 0
                    }
                },
                "title": "LbFront5xxStatus (1m)"
            }
        },
        {
            "height": 6,
            "width": 6,
            "y": 20,
            "x": 0,
            "type": "metric",
            "properties": {
                "metrics": [
                    [ { "expression": "SEARCH('{AWS/ApplicationELB,LoadBalancer,TargetGroup} MetricName=\\"HTTPCode_Target_4XX_Count\\"', 'Sum', 60)", "label": "4XX", "id": "e1", "period": 60, "region": "ap-northeast-2" } ]
                ],
                "view": "timeSeries",
                "stacked": false,
                "region": "ap-northeast-2",
                "stat": "Average",
                "period": 60,
                "liveData": true,
                "legend": {
                    "position": "hidden"
                },
                "yAxis": {
                    "left": {
                        "label": "Request Count",
                        "showUnits": false,
                        "min": 0
                    }
                },
                "title": "LbTarget4xxStatus (1m)"
            }
        },
        {
            "height": 6,
            "width": 6,
            "y": 8,
            "x": 18,
            "type": "metric",
            "properties": {
                "metrics": [
                    [ { "expression": "SEARCH('{AWS/ApplicationELB,LoadBalancer,TargetGroup} MetricName=\\"HTTPCode_Target_5XX_Count\\"', 'Sum', 60)", "label": "5XX", "id": "e1", "period": 60, "region": "ap-northeast-2" } ]
                ],
                "view": "timeSeries",
                "stacked": false,
                "region": "ap-northeast-2",
                "stat": "Average",
                "period": 60,
                "liveData": true,
                "legend": {
                    "position": "hidden"
                },
                "yAxis": {
                    "left": {
                        "label": "Request Count",
                        "showUnits": false,
                        "min": 0
                    }
                },
                "title": "LbTarget5xxStatus (1m)"
            }
        },
        {
            "height": 6,
            "width": 6,
            "y": 20,
            "x": 18,
            "type": "metric",
            "properties": {
                "metrics": [
                    [ { "expression": "SEARCH('{AWS/CloudFront,DistributionId,Region} MetricName=\\"Requests\\"', 'Sum', 60)", "id": "e1", "region": "us-east-1", "period": 60 } ]
                ],
                "view": "timeSeries",
                "stacked": false,
                "region": "us-east-1",
                "title": "CfRequest (1m)",
                "stat": "Average",
                "period": 60,
                "yAxis": {
                    "left": {
                        "label": "Request Count",
                        "min": 0,
                        "showUnits": false
                    }
                },
                "liveData": true,
                "legend": {
                    "position": "hidden"
                }
            }
        },
        {
            "height": 6,
            "width": 6,
            "y": 26,
            "x": 0,
            "type": "metric",
            "properties": {
                "metrics": [
                    [ { "expression": "SEARCH('{AWS/CloudFront,DistributionId,Region} MetricName=\\"4xxErrorRate\\"', 'p99', 60)", "id": "e1", "region": "us-east-1", "period": 60 } ]
                ],
                "view": "timeSeries",
                "stacked": false,
                "region": "us-east-1",
                "title": "Cf4xxStatus (1m)",
                "stat": "Average",
                "period": 60,
                "yAxis": {
                    "left": {
                        "label": "Status Percent (%)",
                        "min": 0,
                        "showUnits": false,
                        "max": 100
                    }
                },
                "liveData": true,
                "legend": {
                    "position": "hidden"
                }
            }
        },
        {
            "height": 6,
            "width": 6,
            "y": 26,
            "x": 6,
            "type": "metric",
            "properties": {
                "metrics": [
                    [ { "expression": "SEARCH('{AWS/CloudFront,DistributionId,Region} MetricName=\\"5xxErrorRate\\"', 'p99', 60)", "id": "e1", "region": "us-east-1", "period": 60 } ]
                ],
                "view": "timeSeries",
                "stacked": false,
                "region": "us-east-1",
                "title": "Cf5xxStatus (1m)",
                "stat": "Average",
                "period": 60,
                "yAxis": {
                    "left": {
                        "label": "Status Percent (%)",
                        "min": 0,
                        "showUnits": false,
                        "max": 100
                    }
                },
                "liveData": true,
                "legend": {
                    "position": "hidden"
                }
            }
        },
        {
            "height": 6,
            "width": 6,
            "y": 32,
            "x": 0,
            "type": "metric",
            "properties": {
                "metrics": [
                    [ { "expression": "SEARCH('{AWS/RDS,DBInstanceIdentifier} MetricName=\\"DatabaseConnections\\"', 'Maximum', 60)", "id": "e1", "period": 60, "region": "ap-northeast-2" } ]
                ],
                "view": "timeSeries",
                "stacked": false,
                "region": "ap-northeast-2",
                "stat": "Average",
                "period": 60,
                "title": "RDSConnection (1m)",
                "yAxis": {
                    "left": {
                        "showUnits": false,
                        "label": "Connection Count",
                        "min": 0
                    }
                }
            }
        },
        {
            "height": 6,
            "width": 6,
            "y": 26,
            "x": 12,
            "type": "metric",
            "properties": {
                "metrics": [
                    [ { "expression": "SEARCH('{AWS/EC2,InstanceId} MetricName=\\"CPUUtilization\\"', 'Maximum', 60)", "label": "", "id": "e2", "period": 60, "region": "ap-northeast-2" } ]
                ],
                "view": "timeSeries",
                "stacked": false,
                "region": "ap-northeast-2",
                "stat": "Average",
                "period": 60,
                "title": "EC2CPU (1m)",
                "yAxis": {
                    "left": {
                        "showUnits": false,
                        "label": "CPU Utilization (%)",
                        "min": 0,
                        "max": 100
                    }
                },
                "legend": {
                    "position": "hidden"
                }
            }
        },
        {
            "height": 6,
            "width": 6,
            "y": 26,
            "x": 18,
            "type": "metric",
            "properties": {
                "metrics": [
                    [ { "expression": "SEARCH('{AWS/RDS,DBInstanceIdentifier} MetricName=\\"Queries\\"', 'Sum', 60)", "id": "e1", "period": 60 } ]
                ],
                "view": "timeSeries",
                "stacked": false,
                "region": "ap-northeast-2",
                "stat": "Average",
                "period": 60,
                "title": "RDSQuery (1m)",
                "yAxis": {
                    "left": {
                        "showUnits": false,
                        "label": "Query Count",
                        "min": 0
                    }
                },
                "liveData": true
            }
        },
        {
            "height": 12,
            "width": 24,
            "y": 38,
            "x": 0,
            "type": "log",
            "properties": {
                "query": "SOURCE logGroups(namePrefix: [\\"/aws/ecs/\\"], class: \\"STANDARD\\")  |\\nfields @entity.KeyAttributes.Name, @message\\n| sort @timestamp desc\\n| filter @log not like /containerinsights/\\n| limit 100",
                "queryBy": "logGroupPrefix",
                "logGroupPrefixes": {
                    "accountIds": [
                        "All"
                    ],
                    "logGroupPrefix": [
                        "/aws/ecs/"
                    ],
                    "logClass": "STANDARD"
                },
                "region": "ap-northeast-2",
                "stacked": false,
                "title": "[ECS] Brief Container Logs (Last 100)",
                "view": "table"
            }
        },
        {
            "type": "metric",
            "x": 6,
            "y": 32,
            "width": 6,
            "height": 6,
            "properties": {
                "metrics": [
                    [ { "expression": "SUM(SEARCH('{AWS/AutoScaling,AutoScalingGroupName} MetricName=\\"GroupInServiceInstances\\"', 'Average', 60))", "label": "InService", "id": "e1", "period": 300, "color": "#2ca02c", "region": "ap-northeast-2" } ],
                    [ { "expression": "SUM(SEARCH('{AWS/AutoScaling,AutoScalingGroupName} MetricName=\\"GroupTerminatingCapacity\\"', 'Average', 60))", "label": "Terminating", "id": "e2", "period": 60, "color": "#d62728", "region": "ap-northeast-2" } ],
                    [ { "expression": "SUM(SEARCH('{AWS/AutoScaling,AutoScalingGroupName} MetricName=\\"GroupPendingCapacity\\"', 'Average', 60))", "label": "Pending", "id": "e3", "period": 60, "color": "#c7c7c7", "region": "ap-northeast-2" } ]
                ],
                "view": "timeSeries",
                "stacked": true,
                "region": "ap-northeast-2",
                "stat": "Average",
                "period": 60,
                "legend": {
                    "position": "hidden"
                },
                "liveData": true,
                "yAxis": {
                    "left": {
                        "showUnits": false
                    }
                },
                "title": "ASGInstanceStatus"
            }
        },
        {
            "type": "metric",
            "x": 12,
            "y": 32,
            "width": 6,
            "height": 6,
            "properties": {
                "metrics": [
                    [ { "expression": "SUM(SEARCH('{AWS/AutoScaling,AutoScalingGroupName} MetricName=\\"GroupTotalCapacity\\"', 'Maximum', 60))", "label": "Current", "id": "e1", "period": 60, "color": "#2ca02c", "stat": "Maximum", "region": "ap-northeast-2" } ],
                    [ { "expression": "SUM(SEARCH('{AWS/AutoScaling,AutoScalingGroupName} MetricName=\\"GroupDesiredCapacity\\"', 'Maximum', 60))", "label": "Desired", "id": "e2", "period": 60, "color": "#d62728", "stat": "Maximum", "region": "ap-northeast-2" } ]
                ],
                "view": "timeSeries",
                "stacked": false,
                "region": "ap-northeast-2",
                "stat": "Maximum",
                "period": 60,
                "title": "ASGDesiredFollowing",
                "yAxis": {
                    "left": {
                        "min": 0,
                        "showUnits": false
                    }
                }
            }
        },
        {
            "height": 2,
            "width": 24,
            "y": 0,
            "x": 0,
            "type": "text",
            "properties": {
                "markdown": "[]()\\\\\\n[]()\\n\\n---",
                "background": "transparent"
            }
        }
    ]
}