Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Application Insights Preview
Search
Tatsuro Shibamura
PRO
June 09, 2017
Programming
280
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Application Insights Preview
Tatsuro Shibamura
PRO
June 09, 2017
More Decks by Tatsuro Shibamura
See All by Tatsuro Shibamura
AI Agent を本番環境へ―― Microsoft Foundry × Azure Serverless で作る Enterprise-Ready な基盤
shibayan
PRO
2
1.4k
Azure Cosmos DB パフォーマンス最適化入門 - 設計・開発・運用の実践テクニック
shibayan
PRO
0
600
Azure Serverless のパフォーマンスとコストを 最適化
shibayan
PRO
0
19
Microsoft Azure で実現する最新クラウドアーキテクチャ
shibayan
PRO
0
27
Hack Azure! #5 - Geek of Azure Serverless
shibayan
PRO
0
140
.NET Conf 2020 Online - .NET 5 リリース記念パーティートーク
shibayan
PRO
0
10k
Terraform Provider for Azure に貢献してみた話
shibayan
PRO
0
670
Azure Functions と SendGrid の良い関係
shibayan
PRO
0
1.4k
Azure Serverless を活用したリアルタイム Web のすべて
shibayan
PRO
1
3.1k
Other Decks in Programming
See All in Programming
AI駆動開発にグラフDBを重ねてみた
satoshi256kbyte
2
780
個人開発基盤をまるごとCloudflareに引っ越して爆速で総合的体験を向上させた話
tinykitten
0
150
市販E-Readerを乗っ取れ 〜Embedded Swiftで電子ペーパーガジェットを制御する〜
trickart
0
160
thread_parallel_with_free-threaded_Python_and_NumPy.pdf
riku_sakamoto
0
290
tsc.rip を支える技術 / Kyoto.なんか #8
susisu
0
4.4k
Claude Codeを組織的に動かして月400PRを実現した話
happy_ryo
0
270
ALB ログから Trace を気合で繋げる技術
fohte
7
880
iOS開発×AI駆動開発 〜最近使って便利だったスキルの話〜
nogu66
0
140
The Good Stuff, Not the Slop: Engineering High-Quality Android Apps with Modern AI Tooling
danybony
1
240
Swift愛好会100回記念 第1回を振り返る
jollyjoester
0
120
Webの地図
yosuke_furukawa
PRO
6
4.1k
LLMは4年分のCompose移行を再現できるのか?実プロダクト279件のXMLで探る自動化の境界線
makun
0
540
Featured
See All Featured
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
310
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
410
Music & Morning Musume
bryan
47
7.4k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.9k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
53k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.3k
Fireside Chat
paigeccino
43
4k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
690
Color Theory Basics | Prateek | Gurzu
gurzu
0
460
The Cult of Friendly URLs
andyhume
79
7k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.7k
Writing Fast Ruby
sferik
630
63k
Transcript
Application Insights Preview @shibayan Microsoft MVP for ASP.NET/IIS http://shibayan.jp/
はじめに • 今日は Azure と Visual Studio の間をフラフラしている Application Insights
について話します • Visual Studio 2015 リリース記念なので、Visual Studio から扱 える範囲に絞ることにします
注意点 • Application Insights はまだ Preview です • 必要なものはデータが遅延しても泣かない気持ち
Application Insights とは • アプリケーションのパフォーマンスの解析、クラッシュの診断、 使用状況の追跡が行えるサービス • 先行する New Relic
に近いサービス • データ量に基づく課金体系、無料で使用可能 • 月間 500 万データポイント、生データ保存 7 日の制限のみ • 有料版だと Blob へのデータエクスポート機能も
Application Insights で出来ること • Web アプリケーション • パフォーマンス、クラッシュ監視、使用状況の追跡、パフォーマンス カウンタの確認 •
Web アプリケーション実行環境 • 外部サービスの呼び出し追跡、パフォーマンスカウンタの確認 • クライアントアプリケーション • クラッシュ監視、使用状況の追跡
対応するプラットフォーム • Web アプリケーション • ASP.NET / ASP.NET 5 /
Java / JavaScript / Python / Ruby / PHP • Web アプリケーション実行環境 • Windows Server (IIS) / Azure Web Apps • クライアントアプリケーション • Android / iOS / OS X / Windows Store App / デスクトップアプリ
Web アプリケーション
Application Insights SDK • 基本的なイベントのハンドリング • アプリケーションの起動、終了など • キャッチされていない例外のハンドリング •
スタックトレースなどをテレメトリとして送信 • カスタムメトリック、トレースログの送信 • TraceListener / NLog を使っている場合には、対応するパッケージを インストールするだけで対応可能
ASP.NET アプリケーションに組み込む • Visual Studio から簡単に SDK をインストール可能 • ASP.NET
アプリケーションの作成時 • 作成済みアプリケーションへ追加 • Application Insights 自体は Web App の追加時に作られる • ポータルから単体で作成することも可能
ASP.NET アプリケーションの作成時 チェックを入れるだけ
作成済みアプリケーションへ追加 テレメトリの追加を選ぶ 右クリックして
対象の App Insights を選択して完了 送信先を選択して クリックすれば完了
Web Apps で使う場合の注意 • パフォーマンスカウンタは Web Apps では参照できないので、 Application Insights
の設定から外しておく • 放置しておくとテレメトリがおかしくなる • ApplicationInsights.config の TelemetryModules に存在する PerformanceCollectorModule を削除
パフォーマンスカウンタを使わない コメントアウトする
クライアント用 JavaScript を追加 • Azure ポータルからスクリプトをコピー&ペースト </head> の直前に貼り付ける
ローカル環境で動作確認 • Visual Studio でデバッグ実行を行う • 最初にテレメトリが送信されたタイミングでメッセージ表示 • 診断ツールでもテレメトリの確認が可能
デプロイしてポータルから確認 クライアント側の情報 アプリケーション側の情報
エラー画面を表示している場合 • ASP.NET MVC の場合は HandleError を変更 • http://blogs.msdn.com/b/visualstudioalm/archive/2014/12/12/appl ication-insights-exception-telemetry.aspx
• 任意のタイミングで例外を通知することもできる try { // 例外を投げるかもしれない new WebClient().DownloadString("..."); } catch (WebException ex) { // App Insights に例外が投げられたことだけは伝える var ai = new TelemetryClient(); ai.TrackException(ex); }
アプリケーションのエラーを確認 500 エラーの原因に なった例外 例外が発生した環境 の詳細情報 スタックトレースと メッセージを確認
Web アプリケーション 実行環境
Application Insights Status Monitor • 仮想マシンへのインストール向けモニタリングサービス • Windows の管理者権限があれば利用可能 •
既存のアプリに変更を加えることなく Application Insights を 使ったパフォーマンスの監視が行える • 既に運用中のアプリケーションの監視に最適 • .NET Framework 4.5 と ASP.NET 4.5 が必須
Status Monitor のインストール Web PI でインストール Application Insights を追加 対象のアプリケーションを選ぶ
Application Insights Site Extension • Status Monitor のインストールが出来ない Azure Web
Apps 用 に追加されたモニタリングサービス • Azure ポータルから 30 秒でインストール可能 • App Insights SDK を組み込んだアプリとセットで動作 • 単体での動作は想定していない
Site Extension のインストール Application Insights を選ぶ インストールが完了すると 表示される
外部サービスの呼び出し確認 SQL DB へのアクセス が表示される 実行されたクエリが 確認可能
Application Insights の活用
Web test で可用性の確認 • Azure ポータルから ping テストを作成 テストを行う リージョンを選択
テスト結果が表示される
テストシナリオを作成 • Visual Studio で Web パフォーマンスプロジェクトを作成 プロジェクトを作成して シナリオをレコーディング
作成したシナリオを使ってテスト • 作成した webtest ファイルをアップロード Multi-step を選んで 作成した webtest ファイル
を選択 テスト結果が表示される
Stream Analytics との連携 (1) • Application Insights から継続的に Blob へイベントを書き出す
必要なイベントのみを 選択可能
Stream Analytics との連携 (2) • Stream Analytics でイベントをストリームデータとして処理 • 結果を
SQL Database / Storage / Power BI へ出力 Azure Stream Analytics イベント単位で書き出される
まとめ • Application Insights はプレビューだけど使えるレベルに • データの遅延は頻繁に起こっているので注意 • 当然ながら Azure
との親和性は抜群に良い • Azure ポータルを使えば GUI だけで、ほとんど設定できる • Visual Studio との連携でさらに便利に