JAWS-UG SRE支部#6でお話させていただいた資料です!
COPYRIGHT © 2023 Cloud Centric Corporation, ALL RIGHTS RESERVED. 1JAWS-UG SRE支部#6CloudWatchでバレる「君、仕事中にyo〇tube観てたよね?」2023年5月29日クラウドセントリック株式会社角中源太郎
View Slide
COPYRIGHT © 2023 Cloud Centric Corporation, ALL RIGHTS RESERVED. 22自己紹介クラウドセントリック株式会社角中 源太郎(かどなか げんたろう)AWS経験業務経験 ≒ 0 年re:Invent 2022好きな AWS サービスAmazon Macie , Systems ManagerTwitter@kado__gen (※_2つです)
COPYRIGHT © 2023 Cloud Centric Corporation, ALL RIGHTS RESERVED. 33クラウドセントリック株式会社ご紹介Cloud Centric Corporation(略称C3)会社設立: 2023年4月7日資本金: 1億5000万円(資本準備金を含む)株主: 三菱電機インフォメーションシステムズ(66.6%)スカイアーチネットワークス(33.4%)エンジニア個人と組織の相互発展のもと、最先端のクラウド技術で、お客様のビジネスを変革します。
COPYRIGHT © 2023 Cloud Centric Corporation, ALL RIGHTS RESERVED. 44AWS Summit Tokyo で始まった勘違いCloudWatch Internet Monitor“インターネットサービスプロバイダのページに飛んでいくとファイバーの切断によってネットワークの一部にパケットロスが発生しているということが表示されています”セッション名「Amazon の事例から学ぶ Observability 活用におけるベストプラクティス」自分で書いたメモ「手元のLANケーブルの断線も検知できるかな?」※当時記憶にあったのは黒字の部分だけで、オンデマンド動画を確認して復元してます。
COPYRIGHT © 2023 Cloud Centric Corporation, ALL RIGHTS RESERVED. 55Internet Monitor を試してみたい引用元 https://aws.amazon.com/jp/blogs/aws/cloudwatch-internet-monitor-end-to-end-visibility-into-internet-performance-for-your-applications/
COPYRIGHT © 2023 Cloud Centric Corporation, ALL RIGHTS RESERVED. 66Internet Monitor 検証開始Internet Monitor に「往復時間」という項目があるので試すEC2 へ打鍵したら往復時間に変化!?
COPYRIGHT © 2023 Cloud Centric Corporation, ALL RIGHTS RESERVED. 77Internet Monitor を試してみたい 第2ラウンドツールを使って EC2 へ負荷検証設定起因なのかInternet Monitor では往復時間に変化なしツールの値ConnectTime[ms]Latency[ms]通常時 9 18負荷時 24 41
COPYRIGHT © 2023 Cloud Centric Corporation, ALL RIGHTS RESERVED. 88ドキュメント読むとプロバイダって記載がある…引用 https://docs.aws.amazon.com/ja_jp/AmazonCloudWatch/latest/monitoring/CloudWatch-IM-inside-internet-monitor.html
COPYRIGHT © 2023 Cloud Centric Corporation, ALL RIGHTS RESERVED. 99CloudWatch Internet Monitor“インターネットサービスプロバイダのページに飛んでいくとファイバーの切断によってネットワークの一部にパケットロスが発生しているということが表示されています”セッション名「Amazon の事例から学ぶ Observability 活用におけるベストプラクティス」「どうしたら手元のLANケーブルの断線がわかる?」※記憶にあったのは黒字の部分だけで、オンデマンド動画を確認して復元してます。検証してわかったこと
COPYRIGHT © 2023 Cloud Centric Corporation, ALL RIGHTS RESERVED. 1010業務PC に CloudWatch Agent を入れればローカルの情報がわかるのでは?本題
COPYRIGHT © 2023 Cloud Centric Corporation, ALL RIGHTS RESERVED. 1111CloudWatch Agent のドキュメントMacもWindowsもサポートはされている引用 https://docs.aws.amazon.com/ja_jp/AmazonCloudWatch/latest/monitoring/Install-CloudWatch-Agent.html
COPYRIGHT © 2023 Cloud Centric Corporation, ALL RIGHTS RESERVED. 1212Agent インストール手順①① SSM Agent を PC にインストール③ CloudWatch Agent 設定ファイル作成④ SSM Parameter Store に設定保存⑤ CloudWatch Agent 起動⑥ メトリクスとログを転送②④⑤⑥SystemsManager を使うとPC の環境考慮と Agent とインストール作業が減るSystemsManagerを使わないと9連休が3連休に…CloudWatchSystems ManagerSSM Parameter② 認証情報や Agent 用ファイルをセット③
COPYRIGHT © 2023 Cloud Centric Corporation, ALL RIGHTS RESERVED. 1313メトリクスMac PC の packetWindows PC の packetMac PCWindows PCCloudWatchLAN ケーブル平均 Packet lossを導出できる!メトリクス転送
COPYRIGHT © 2023 Cloud Centric Corporation, ALL RIGHTS RESERVED. 1414当初の目的は達成したが、せっかく端末に Agent を入れたのでログもどこまで見れるか調べてみた次の関心
COPYRIGHT © 2023 Cloud Centric Corporation, ALL RIGHTS RESERVED. 1515イベントログWindowsのイベントビューアーイベントIDが7001と7002でフィルタするとログインログアウト時刻がわかる
COPYRIGHT © 2023 Cloud Centric Corporation, ALL RIGHTS RESERVED. 1616ブラウザログChrome のブラウザ履歴CloudWatch は SQLite 形式をサポートしていない
COPYRIGHT © 2023 Cloud Centric Corporation, ALL RIGHTS RESERVED. 1717Agent インストール手順①① SSM Agent を PC にインストール③ CloudWatch Agent 設定ファイル作成④ SSM Parameter Store に設定保存⑤ CloudWatch Agent 起動⑥ メトリクスとログを転送②④⑤⑥CloudWatchSystems ManagerSSM Parameter② 認証情報や Agent 用ファイルをセット③②´ カスタムスクリプトを実行→SQLite形式からテキスト形式に②´
COPYRIGHT © 2023 Cloud Centric Corporation, ALL RIGHTS RESERVED. 1818ブラウザログChrome のブラウザ履歴Chrome のログは SQLite形式時刻とURLを摘出
COPYRIGHT © 2023 Cloud Centric Corporation, ALL RIGHTS RESERVED. 1919CloudWatch Agent on PC は業務端末なら選択肢の1つ①① SSM Agent を PC にインストール③ CloudWatch Agent 設定ファイル作成④ SSM Parameter Store に設定保存⑤ CloudWatch Agent 起動⑥ メトリクスとログを転送②④⑤⑥CloudWatchSystems ManagerSSM Parameter② 認証情報や Agent 用ファイルをセット③②´ カスタムスクリプトを実行→SQLite形式からテキスト形式に②´SSM Parameter で同じ定義を使いまわして複数の PC に Agent インストールできる
COPYRIGHT © 2023 Cloud Centric Corporation, ALL RIGHTS RESERVED. 2020CloudWatch RUM (Real User Monitoring)引用 https://aws.amazon.com/jp/blogs/news/cloudwatch-rum/・ セッション開始イベント・ ページビュー・ JavaScriptエラー・ DOMイベント・ ナビゲーションイベント・ コアウェブバイタルイベント・ HTTPイベント・ X-Rayイベントユーザにとってのアプリのパフォーマンスメトリクスが見れる引用 『Amazon CloudWatch[本格]入門 ~クラウドネイティブオブザーバビリティストーリー~』
COPYRIGHT © 2023 Cloud Centric Corporation, ALL RIGHTS RESERVED. 2121RUM と Agent の比較CloudWatch RUM CloudWatch Agent on PC視点 ユーザ 端末仕込む場所 クライアントアプリ PC取得データ セッションに関する情報 OSやアプリのログ1ユーザだけユーザ体験がおかしいことを RUM でわかり、Agent で詳細原因がわかる
COPYRIGHT © 2023 Cloud Centric Corporation, ALL RIGHTS RESERVED. 22