Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
CloudWatch 大好きなSAが語る CloudWatch キホンのキ
Search
o11yfes
April 15, 2025
Technology
620
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
CloudWatch 大好きなSAが語る CloudWatch キホンのキ
o11yfes
April 15, 2025
More Decks by o11yfes
See All by o11yfes
⽣成 AI で進化する AWS オブザーバビリティ
o11yfes2023
0
370
X-Ray SDKとDaemonのサポート終了と移⾏ガイド
o11yfes2023
0
550
AWS オブザーバビリティサービスアップデート
o11yfes2023
0
330
クロスアカウント/クロスリージョンのオブザーバビリティ
o11yfes2023
0
260
サーバレス、コンテナ、データベース特化型機能をご紹介。CloudWatch をもっと使いこなそう!
o11yfes2023
0
540
Amazon CloudWatch を使って NW 監視を行うには
o11yfes2023
0
950
Amazon CloudWatchで始める エンドユーザー体験のモニタリング
o11yfes2023
0
600
Observabilityジャーニーを実現するためのAWSサービス:CloudWatch編
o11yfes2023
0
820
Observability はじめの一歩 CloudWatch Synthetics
o11yfes2023
0
570
Other Decks in Technology
See All in Technology
時期が悪い!それでもRaspberry Piを買って遊んで活用するには / 20260627-osc26do-rpi-jikigawarui
akkiesoft
1
910
Microsoft のサポートとフィードバック総まとめ
murachiakira
PRO
0
120
Kotlin 開発のツラミを爆破した話! / Explode the difficulty of Kotlin dev!
eller86
0
110
なぜ人は自分のプロジェクトを 「なんちゃってアジャイル」と 自嘲するのか
kozotaira
0
170
自作お家AIエージェントスタックチャンFWで困っている所紹介
74th
0
160
Text-to-SQLをAgentCoreで実現し、生成されるSQLの精度を定量的に評価する
yakumo
2
160
從觀望到全公司落地:AI Agentic Coding 導入實戰 — 流程整合與安全治理
appleboy
0
170
AWS Summit の片隅で、体育座りしながらコミュニティがにぎわう理由を考えた
k_adachi_01
2
290
10年間のブログ発信を振り返って見えたWebアプリケーションエンジニアとしての軌跡
stefafafan
0
190
Agentic AI 時代のテスト手法: Kiro とはじめるプロパティベーステスト (AWS Summit Japan 2026 | DEV212)
ymhiroki
0
100
AWS PrivateLink × SCIM で実現する セキュアで運⽤負荷の低い Databricks 基盤の構築
tsuda7
0
110
元・セキュリティ学習経験0大学生による業務紹介 / An Introduction to the Job by a Former College Student with Zero Security Training Experience
nttcom
0
1k
Featured
See All Featured
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6k
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
400
How Software Deployment tools have changed in the past 20 years
geshan
0
34k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
470
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
850
Crafting Experiences
bethany
1
190
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
620
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.5k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.2k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
230
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2k
Transcript
© 2025, Amazon Web Services, Inc. or its affiliates. All
rights reserved. Amazon Confidential and Trademark. 1 © 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. CloudWatch大好きなSAが語る CloudWatch キホンノキ Miki Tsuwazaki 春 の O b s e r v a b i l i t y 祭 り 2 0 2 5 〜 進 化 す る A m a z o n C l o u d W a t c h 基 礎 か ら 最 新 機 能 ま で 完 全 解 説 〜 Solutions Architect Amazon Web Service Japan G.K.
© 2025, Amazon Web Services, Inc. or its affiliates. All
rights reserved. Amazon Confidential and Trademark. 2 自己紹介 津和崎 美希 Miki Tsuwazaki アマゾンウェブサービスジャパン ソリューションアーキテクト 通信業のお客様を中⼼にご⽀援しています。 2 n⼤好きなサービス n Amazon CloudWatch
© 2025, Amazon Web Services, Inc. or its affiliates. All
rights reserved. Amazon Confidential and Trademark. 3 Amazon CloudWatchの好きなところ ①ある意味サーバーレスなところ ②スケーラビリティが求められる企業の事例があるところ ③初心者に優しいところ ④ログ保管用のストレージなど管理に頭をいためなくていいところ ⑤監視するシステムの進化にあわせて進化するところ
© 2025, Amazon Web Services, Inc. or its affiliates. All
rights reserved. Amazon Confidential and Trademark. 4 CloudWatchの始め方 ⭐まずはダッシュボードを見てみよう CloudWatchをマネージメントコンソールで今使っているAWSサービスの状況を確認してみる。 利⽤中のサービスの ⾃動ダッシュボードが あらかじめ⽤意されている。 ①ダッシュボードをClick ②⾃動ダッシュボードをClick ※この操作にかかる料⾦は無料(2025/04/11時点) • 基本のモニタリングメトリクス (デフォルトで AWS サービ スから送信されるメトリクス)は無料 • すべての⾃動ダッシュボードは無料 料⾦については、AWS公式Webサイトにてご確認ください https://aws.amazon.com/jp/cloudwatch/pricing/
© 2025, Amazon Web Services, Inc. or its affiliates. All
rights reserved. Amazon Confidential and Trademark. 5 再掲:CloudWatch / X-Ray は最初の選択肢 メトリクス ログ トレース Amazon CloudWatch AWS X-Ray Amazon CloudWatch Application Signals
© 2025, Amazon Web Services, Inc. or its affiliates. All
rights reserved. Amazon Confidential and Trademark. 6 メトリクス • CloudWatchに発⾏された時系列のデータポイントのセット • データポイントはタイプスタンプと(オプションで)測定 単位を保持 • メトリクスは作成されたリージョンにのみ存在 • メトリクスは名前空間、メトリクス名、ディメンションで ⼀意に定義される。 • メトリクスは削除不可で保持スケジュールに従い 期限切れになる 名前空間 • CloudWatchメトリクスのコンテナ • 異なる名前空間のメトリクスは相互に切り離される • AWSサービスでは AWS/<service>が使⽤される(例: AWS/EC2) ディメンション • メトリクスを⼀意に識別する名前/値のペア (例:InstanceId=i-12345678) CloudWatch メトリクスとは?
© 2025, Amazon Web Services, Inc. or its affiliates. All
rights reserved. Amazon Confidential and Trademark. 7 ⇨データテーブルなどの他の形式にもできる。 ⭐メトリクスを可視化してみよう - DEMO
© 2025, Amazon Web Services, Inc. or its affiliates. All
rights reserved. Amazon Confidential and Trademark. 8 CloudWatch カスタムメトリクス 標準メトリクス以外の独⾃メトリクスも監視可能 • AWS CLIの”put-metric-data”もしくは”PutMetricData” APIでデータを登録 • CloudWatch Logsに“Embedded Metrics Format”で書くことで、カスタムメトリクスをLogに埋め込んで送ることも可能 • 詳細度が 1秒のデータを含む⾼解像度なメトリクスを発⾏可能 →1分未満のアクティビティを迅速に把握 ⾼解像度にメトリクスを発⾏する場合、APIコール時のスロットリング対策も忘れずに (上限緩和申請も検討) • 単⼀のput-metric-dataに複数のデータポイントを⼊れる • 統計セットを利⽤する • リトライ処理をする $ aws cloudwatch put-metric-data –metric-name RequestLatency¥ --namespace "GetStarted“¥ --timestamp 2014-10-28T12:30:00Z¥ --value 87 ¥ --unit Milliseconds¥ --dimensions InstanceId=1-23456789,InstanceType=t3.small $ aws cloudwatch put-metric-data --metric-name RequestLatency¥ --namespace "GetStarted“¥ --timestamp 2014-10-28T12:30:00Z¥ --statistic-value Sum=60,Minimum=15,Maximum=105,SampleCount=5 ←単⼀値の登録 ←統計セットの登録
© 2025, Amazon Web Services, Inc. or its affiliates. All
rights reserved. Amazon Confidential and Trademark. 9 再掲:CloudWatch / X-Ray は最初の選択肢 メトリクス ログ トレース Amazon CloudWatch AWS X-Ray Amazon CloudWatch Application Signals
© 2025, Amazon Web Services, Inc. or its affiliates. All
rights reserved. Amazon Confidential and Trademark. 10 CloudWatch Logsの例 ロググループが Lambda関数ごとに を作成される Lambda関数を実⾏す るとログストリーム が⾃動で追加される ログイベントで⽣のイベ ントが確認できる
© 2025, Amazon Web Services, Inc. or its affiliates. All
rights reserved. Amazon Confidential and Trademark. 11 CloudWatch Logsの仕組み Web Server web001.ap-northeast-1 ロググループ ログストリーム ログイベント web002.ap-northeast-1 web003.ap-northeast-1 ログイベント • 1つのログエントリ • モニタリングしているリソースに よって記録されたアクティビティの レコード • イベント発⽣時のタイムスタンプお よび⽣のイベントメッセージで構成 ログストリーム • 同じソースを共有する⼀連のログイ ベント • モニタリングしているリソースのタ イムスタンプ順でイベントを表す ロググループ • 複数のログストリームで構成 • 保持、監視、アクセス制御について 同じ設定を共有するログストリーム のグループを定義
© 2025, Amazon Web Services, Inc. or its affiliates. All
rights reserved. Amazon Confidential and Trademark. 12 ⭐ログを可視化してみよう - DEMO
© 2025, Amazon Web Services, Inc. or its affiliates. All
rights reserved. Amazon Confidential and Trademark. 13 CloudWatch Logs Insightsを活用して ロググループからエラーログを抽出して可視化 ⇨①⾃然⾔語でクエリを⽣成 ⇨②⽣成されたクエリを実⾏ ※Log Insightsは スキャンされた データのGB単位の 料⾦体系
© 2025, Amazon Web Services, Inc. or its affiliates. All
rights reserved. Amazon Confidential and Trademark. 14 再掲:CloudWatch / X-Ray は最初の選択肢 メトリクス ログ トレース Amazon CloudWatch AWS X-Ray Amazon CloudWatch Application Signals
© 2025, Amazon Web Services, Inc. or its affiliates. All
rights reserved. Amazon Confidential and Trademark. 15 ポストモーテム Amazon での対応例 アラーム ダッシュボード メトリクス分析 ログ分析 生ログ トレース 抽 象 度 ⾼ 低 参考)AmazonでのObservability best practice なぜビジネスに影響がでたのか?ア ラームはなったのか?の質問に答える ために計装を追加していく *計装とは: ログ、メトリクス、トレースなどの データを取得し、外部に送信できるよ うシステムに組み込むこと h"ps://aws.amazon.com/jp/builders-library/building-dashboards-for-opera;onal-visibility/ ӡ༻ΛՄࢹԽ͢ΔͨΊͷ μογϡϘʔυͷߏங
© 2025, Amazon Web Services, Inc. or its affiliates. All
rights reserved. Amazon Confidential and Trademark. 16 ⭐トレースでできること
© 2025, Amazon Web Services, Inc. or its affiliates. All
rights reserved. Amazon Confidential and Trademark. 17 CloudWatchにテレメトリーデータを集めるには? • 統合CloudWatchエージェントを使えば、 CloudWatch Logs・Metrics・Traceに対応している • クラウドでもオンプレミスでもコンテナでも利用可能。 • Linux, Windowsの両方で稼働。 17 ★コンテナ向けには、 CloudWatch エージェントコンテナイメージを提供 → h2ps://docs.aws.amazon.com/ja_jp/AmazonCloudWatch/latest/monitoring/ContainerInsights.html ★サーバーへのインストール⽅法は⼤きく以下3パターン 1. コマンドラインで実⾏(複数サーバーに⾏うには⼯夫が必要)→コマンドラインを使⽤した CloudWatch エージェントのインストール 2. SSMを活⽤(SSMなら多数のサーバーにも簡単導⼊)→AWS Systems Manager を使⽤した CloudWatch エージェントのインストール 3. IaCで(CFnで併せてAgentも導⼊)→AWS CloudFormationを使⽤してCloudWatch エージェントのインストール
© 2025, Amazon Web Services, Inc. or its affiliates. All
rights reserved. Amazon Confidential and Trademark. 18 参考:CloudWatch Agentでx-Rayにトレースを送る "8493BZͱ 0QFO5FMFNFUSZ4%,ͷ྆ํ͔ΒͷτϨʔεΛऩूͯ͠ "8493BZʹૹ ৴͢ΔΑ͏ $MPVE8BUDIΤʔδΣϯτΛઃఆͰ͖ΔΑ͏ʹͳ͍ͬͯΔɻ
© 2025, Amazon Web Services, Inc. or its affiliates. All
rights reserved. Amazon Confidential and Trademark. 19 CloudWatch Alarmsでメトリクスをアクションにつなげる メトリクス アクション Amazon CloudWatch Amazon EC2 Amazon SNS Amazon EC2 Auto Scaling Alarm AWS Systems Manager OpsCenter AWS Systems Manager Incident Manager ①静的閾値に基づくアラーム ▪例︓5分間平均のCPU使⽤率が90%を6つの評価期間に2回以上発⽣ =30分の評価間隔で閾値超え2回ならばアラーム ※Event Bridgeにも アラーム状態変化は 配信される ②Metrics Insights クエリに基づく CloudWatch アラーム ▪例︓フリートのすべてのインスタンスの CPU 使⽤率を監視する →アラーム作成後の追加インスタンスにも監視が⾃動で適⽤される ④複合アラーム (例︓①と③両⽅ALARM状態のときにSNSトピックに通知する ※EC2アクション未対応) ③CloudWatch 異常検出に基づいたアラーム ▪例︓最⼤2週間分のErrorCountメトリクスに機械学習アルゴリズムを 適⽤して、メトリクスの想定値のモデルから“正常の範囲”を超えてError がある場合、突然の変化として検出する
© 2025, Amazon Web Services, Inc. or its affiliates. All
rights reserved. Amazon Confidential and Trademark. 20 アラームを作成する例 1.ナビゲーション ペインで、[アラー ム]、[すべてのア ラーム] の順に選 択 2.[アラームの作 成] を選択 3.メトリクス を選択 A [期間] は、アラームの各データポイントを作 成するためにメトリクスや式を評価する期間 B [評価期間] は、アラームの状態を決定するま でに要する直近の期間 (データポイント) の数 C [Datapoints to Alarm (アラームを実⾏す るデータポイント)] は、アラームが ALARM 状 態に移るためにしきい値を超過する必要がある評 価期間内のデータポイントの数 5分間平均のCPU使⽤率が90%を6つの評価期間に2回以上発⽣(⽋落データはない場合) ≒30分の評価間隔で閾値超え2回ならばアラーム A C B 4.条件・アクションを 設定
© 2025, Amazon Web Services, Inc. or its affiliates. All
rights reserved. Amazon Confidential and Trademark. 21 アラームを数多く作成するのが大変な時 アラームに関する推奨事項と その設定のための IaC や CLI サンプ ルをAWSマネージメントコンソール からダウンロードして活⽤できます。
© 2025, Amazon Web Services, Inc. or its affiliates. All
rights reserved. Amazon Confidential and Trademark. 22 CloudWatchの全体像 Logs RUM Amazon CloudWatch Digital experience monitoring Visualizations Insights and analysis Foundations Partners and integrations Instrumentation and collection Synthetics Metrics Internet Monitor Traces Container Insights Lambda Insights Contributor Insights Application Insights Metrics streams CloudWatch embedded metric format Metrics explorer Dashboards Live Tail Logs Insights Cross account observability OpenTelemetry CloudWatch agent Application Signals ApplicaBon Signalsの進化に伴いアプリケーションモニタリングのカバレッジ向上に加え、 監視するシステムの進化にあわせて、Network Monitoring、Database Insights等も加わり進化を続けてい る。
© 2025, Amazon Web Services, Inc. or its affiliates. All
rights reserved. Amazon Confidential and Trademark. 23 CloudWatch基本は簡単!まずは使ってみよう。
© 2025, Amazon Web Services, Inc. or its affiliates. All
rights reserved. Amazon Confidential and Trademark. 24 Thank you