Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Amazon CloudWatchのメトリクスインターバルについて / Metrics int...

Amazon CloudWatchのメトリクスインターバルについて / Metrics interval matters

JAWS-UG SRE #13にて発表した資料です。
https://jawsug-sre.connpass.com/event/358781/

メトリクスインターバルはMTTDに直接影響があります、という話をしました

Avatar for ymotongpoo

ymotongpoo

July 23, 2025
Tweet

More Decks by ymotongpoo

Other Decks in Technology

Transcript

  1. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 1 © 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon CloudWatchの メトリクスインターバルについて Yoshi Yamaguchi (@ymotongpoo) J A W S - U G S R E # 1 3 Senior Developer Advocate Amazon Web Services Japan, G.K.
  2. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 2 © 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. ⾃⼰紹介 ⼭⼝ 能迪(やまぐち よしふみ) アマゾンウェブサービスジャパン合同会社 シニアデベロッパーアドボケイト 専⾨領域 • オブザーバビリティ • SRE全般 @ymotongpoo
  3. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 3 Level 400 Sessions are for attendees who are deeply familiar with the topic, have implemented a solution on their own already, and are comfortable with how the technology works across multiple services, architectures, and implementations. Expert
  4. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 4 Level 400 トピックに精通しており、既に独⾃ソリューションを実装 している⽅が対象です。複数のサービス、アーキテクチャ による実装でテクノロジーがどのように機能するかを解説 します。 エキスパート
  5. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 5 今⽇のイベント主旨 ポカンとではなくドキッとさせます ⾼度かもしれないですが、例がAWSなだけのもっと⼀般的な話をします
  6. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 6 Amazon CloudWatch のメトリクス間隔 基本モニタリングのメトリクス間隔を意識しながら聞いて下さい • 基本モニタリング: メトリクス頻度 5分 ※1 https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch-metrics-basic-detailed.html
  7. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 7 • 信頼性について • エラーバジェットについて • MTTX について • アラート戦略について • メトリクスインターバルについて アジェンダ
  8. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 8 © 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. 信頼性について
  9. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 9 信頼性 ユーザーがサービスに期待する性能品質 ← システムメトリクスではない 指標 許容ライン
  10. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 10 サービスレベル指標 SLI / サービスレベル⽬標 SLO 信頼性 = ユーザーがサービスに期待する性能品質 = システムメトリクスではない SLI SLO
  11. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 11 サービスレベル指標 SLI / サービスレベル⽬標 SLO SLI = ユーザーがサービスに期待する性能品質 = 良いイベント/時間 全イベント/時間 例1: チケットの予約にかかる時間(レイテンシー) 500ms以内のレスポンスの数 全レスポンスの数 例2: 予約ページにアクセスできる時間(可⽤性) アクセスできてた時間 計測中の全期間
  12. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 12 100%のサービスレベル⽬標 SLO は不可能 SLI = ユーザーがサービスに期待する性能品質 = 良いイベント/時間 全イベント/時間 SLO 100%とは 良いイベント/時間 全イベント/時間 =
  13. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 13 100%のサービスレベル⽬標 SLO は不可能 SLI = ユーザーがサービスに期待する性能品質 = 良いイベント/時間 全イベント/時間 SLO 100%とは 良いイベント/時間 全イベント/時間 = SLO 100% 不満なユーザーしかいないことに
  14. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 14 いい感じのラインを⾒つけるのが肝⼼ SLI SLO 90%? 95%?
  15. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 15 © 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. エラーバジェットについて
  16. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 16 エラーバジェット エラーバジェット = 100% - SLO 余裕がある SLO違反 SLO SLO SLI エラーバジェット 新規開発のリスクが取れる すでに信頼性を毀損している 100% 90% 97% 93% ユーザーに影響がでている 使ったエラー
  17. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 17 エラーバジェットの管理 SLO を上げると当然許容される⾮信頼性時間が少なくなる 可⽤性 ⽉間許容時間 年間許容時間 90% 3⽇ 36.5⽇ 95% 1.5⽇ 18.25⽇ 99% 7.2時間 3.65⽇ 99.5% 3.6時間 1.83⽇ 99.9% 43.2分 8.76時間 99.95% 21.6分 4.38時間 99.99% 4.32分 52.6分 uptime.is を使って確認してみよう
  18. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 18 © 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. MTTXについて
  19. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 19 Mean Time to X(平均x時間) • MTTF: 平均故障時間 Mean Time to Failure • MTTD: 平均検出時間 Mean Time to Detect • MTTR: 平均修復時間 Mean Time to Repair/Recovery • MTRS: 平均サービス修復時間 Mean Time to Restore Service • MTBF: 平均故障間隔 Mean Time Between Failure • MSBSI: 平均サービスインシデント間隔 Mean Time Between Service Incident ref: Availability and Beyond: Understanding and Improving the Resilience of Distributed Systems on AWS
  20. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 20 MTTX 関係図 問題発⽣ 問題検知 暫定復旧 完全復旧 問題発⽣ MTTD MTTR MTRS MTBF MTBSI
  21. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 21 © 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. アラート戦略について
  22. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 22 アラート = MTTDを短くするもの アクションが必要なときにしぼってアラートを設定し、MTTDを短くできる SLO SLI 100% 90% すごい勢いでエラーバジェットが減ってたらやばい c.f. バーンレートアラーム
  23. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 23 アラートが鳴るタイミング T T+I T+2I T+3I T+4I 時刻 T: ある時刻 I: 集計インターバル ここで発報 ここで回復 ETTD (Estimated Time to Detect)
  24. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 24 MTTD はメトリクス分解能に依存する T T+I T+2I T+3I T+4I 時刻 T: ある時刻 I: 集計インターバル 本当はここで発報してほしい 本当はここで回復してほしい ETTD
  25. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 25 MTTX とメトリクスインターバル 問題発⽣ 問題検知 暫定復旧 完全復旧 問題発⽣ ETTD ETTR 無駄な時間
  26. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 26 © 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. メトリクスインターバルについて
  27. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 27 Amazon CloudWatch 基本モニタリングと詳細モニタリング※1がある • 基本モニタリング: メトリクス頻度 5分 • 詳細モニタリング: メトリクス頻度 1分 ※1 https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch-metrics-basic-detailed.html
  28. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 28 詳細モニタリング 1分間隔でメトリクスを送れるのは以下のサービスだけ • Amazon EC2 • Amazon ECS • Amazon S3 • Amazon API Gateway • Amazon CloudFront • Amazon Kinesis Data Streams • Amazon MSK (Managed Streaming for Apache Kafka) 他のサービスはすべて基本モニタリングとなる
  29. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 29 基本モニタリングでの限界 メトリクスインターバルが5分 → ハードダウン許容時間より⻑いことも 可⽤性 ⽉間許容時間 90% 3⽇ 95% 1.5⽇ 99% 7.2時間 99.5% 3.6時間 99.9% 43.2分 99.95% 21.6分 99.99% 4.32分 前回の計測点の直後に問題が発⽣した場合 最悪次の計測点までに対応できない
  30. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 30 例: 冗⻑化による回避 ソフトダウンにより許容時間の⾒た⽬を増やせる 可⽤性 ⽉間許容時間 90% 3⽇ 95% 1.5⽇ 99% 7.2時間 99.5% 3.6時間 99.9% 43.2分 99.95% 21.6分 99.99% 4.32分 エラー率 ⽉間許容時間 100% 4.32分 50% 8.64分 10% 43.2分 v1 v1 50% 50%
  31. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 31 例: カナリアリリース さらにバージョンによる冗⻑化も実施 → さらに冗⻑化と組み合わせて軽減 可⽤性 ⽉間許容時間 90% 3⽇ 95% 1.5⽇ 99% 7.2時間 99.5% 3.6時間 99.9% 43.2分 99.95% 21.6分 99.99% 4.32分 エラー率 ⽉間許容時間 100% 4.32分 50% 8.64分 10% 43.2分 v1 v2 90% 10%
  32. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 32 まとめ • メトリクスインターバルはMTTDに直接影響する • ⾃分が使っているモニタリングサービスのメトリクスインターバルは意識しよう • ⾮信頼性時間は冗⻑化によって緩和可能
  33. © 2025, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 33 Thank you! © 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Yoshi Yamaguchi @ymotongpoo Any questions?