ladderlore
  • S3 や IAM などのサービス名を入力してください。

サービス · Management and Governance · CLF-C02 の発展

Amazon CloudWatch

Choose metrics from business needs, build alarms and composite alarms, search logs, and auto-recover instances.

このレッスンはまだ翻訳されていないため、英語で表示しています。

クラウドプラクティショナーで学んだこと

  • CloudWatch collects metrics and logs, shows dashboards and runs alarms.
  • An alarm can notify through SNS, or act on EC2 and Auto Scaling.
  • Memory and disk use inside an instance need the CloudWatch agent.
クラウドプラクティショナーのレッスンを読む
  • Pages load quickly

    Metric
    TargetResponseTime
    Source
    ALB
  • Few errors

    Metric
    HTTPCode_Target_5XX_Count
    Source
    ALB
  • Enough healthy servers

    Metric
    HealthyHostCount
    Source
    Target group
  • Jobs finish on time

    Metric
    ApproximateAgeOfOldestMessage
    Source
    SQS
  • Database not saturated

    Metric
    CPUUtilization, connections
    Source
    RDS
  • No lost orders

    Metric
    Messages in the dead-letter queue
    Source
    SQS
Turn a business goal into a metric to alarm on.

1 / 2

  • Pages load quickly

    Metric
    TargetResponseTime
    Source
    ALB
  • Few errors

    Metric
    HTTPCode_Target_5XX_Count
    Source
    ALB
  • Enough healthy servers

    Metric
    HealthyHostCount
    Source
    Target group

2 / 2

  • Jobs finish on time

    Metric
    ApproximateAgeOfOldestMessage
    Source
    SQS
  • Database not saturated

    Metric
    CPUUtilization, connections
    Source
    RDS
  • No lost orders

    Metric
    Messages in the dead-letter queue
    Source
    SQS
Turn a business goal into a metric to alarm on.
Metric
Alarm
SNSAuto Scaling
EC2 recover
notifyscalerecover
An alarm can notify, scale or recover.

概要

Pick metrics that show what users feel, not only what servers do. Good signals are latency (the ALB TargetResponseTime), error rate (HTTP 5xx), traffic (request count), saturation (CPU) and, for queues, the age of the oldest message. Match them to the goal. An availability goal of 99.9 percent points to error rate and healthy host count. A goal of “jobs done in 5 minutes” points to queue age.

概要

An alarm watches one metric and has three states: OK, ALARM and INSUFFICIENT_DATA. A composite alarm combines alarms with AND, OR and NOT to cut noise: alert only when high latency and high errors happen together. Alarm actions include SNS, Auto Scaling and EC2 actions (stop, terminate, reboot, recover). An alarm on the EC2 system status check with the recover action moves an instance with a failed host to new hardware. The instance keeps its ID, private IP and Elastic IP. It does not work for instances with instance store volumes.

概要

CloudWatch Logs Insights searches and charts logs with a query language. A metric filter turns log text, such as the word ERROR, into a metric you can alarm on. Container Insights collects metrics and logs from ECS and EKS. Basic EC2 monitoring gives 5-minute data, and detailed monitoring gives 1-minute data. Custom metrics can be as fine as 1 second.

概要

More tools: Logs Live Tail shows log events in real time. Contributor Insights shows the top contributors in your logs, such as the busiest client IP addresses. Application Insights sets up monitoring for an application’s resources and flags problems, and Lambda Insights adds curated metrics for Lambda functions. Amazon Managed Grafana runs dashboards, and Amazon Managed Service for Prometheus stores container metrics.

覚えること

  • Pick user-facing metrics: latency, 5xx errors, request count, queue age.
  • Alarm states: OK, ALARM, INSUFFICIENT_DATA.
  • Composite alarm: AND, OR, NOT over alarms, for less noise.
  • The EC2 recover action on the system status check moves the instance to healthy hardware.

覚えること

  • Logs Insights queries logs. A metric filter turns log patterns into metrics.
  • Container Insights covers ECS and EKS. Detailed monitoring is 1-minute data.

試験では

  • “Recover an instance automatically when its host fails” points to a CloudWatch alarm with the EC2 recover action.
  • “Alert only when several conditions are true at once” points to a composite alarm.
  • “Count the ERROR lines in application logs and alert” points to a metric filter and an alarm.
  • “Find the cause of an error spike across logs” points to CloudWatch Logs Insights.