什麼是 Application Insights?What is Application Insights?

Application Insights 是多個平台上的 Web 開發人員所適用的可延伸「應用程式效能管理」(APM) 服務。Application Insights is an extensible Application Performance Management (APM) service for web developers on multiple platforms. 您可以使用它來監視即時 Web 應用程式。Use it to monitor your live web application. 它將會自動偵測效能異常。It will automatically detect performance anomalies. 其中包括強大的分析工具可協助您診斷問題,並了解使用者實際如何運用您的應用程式。It includes powerful analytics tools to help you diagnose issues and to understand what users actually do with your app. 它是設計來協助您持續改善效能和可用性。It's designed to help you continuously improve performance and usability. 它適用於各種不同平台上的應用程式,包括裝載在內部部署或雲端的 .NET、Node.js 和 J2EE。It works for apps on a wide variety of platforms including .NET, Node.js and J2EE, hosted on-premises or in the cloud. 它可與您的 DevOps 程序整合,並有各種開發工具的連接點。It integrates with your DevOps process, and has connection points to a variety of development tools. 透過與 Visual Studio App Center 整合,還可以從行動應用程式監視並分析遙測資料。It can monitor and analyze telemetry from mobile apps by integrating with Visual Studio App Center.

看一下簡介動畫Take a look at the intro animation.

Application Insights 的運作方式How does Application Insights work?

您會在應用程式中安裝小型檢測套件,並且在 Microsoft Azure 入口網站中設定 Application Insights 資源。You install a small instrumentation package in your application, and set up an Application Insights resource in the Microsoft Azure portal. 此檢測套件會監視您的應用程式,並將遙測資料傳送至入口網站。The instrumentation monitors your app and sends telemetry data to the portal. (應用程式可以在任何地方執行 - 不一定要裝載於 Azure 中。)(The application can run anywhere - it doesn't have to be hosted in Azure.)

您不僅可以檢測 Web 服務應用程式,也可以檢測任何背景元件以及網頁本身中的 JavaScript。You can instrument not only the web service application, but also any background components, and the JavaScript in the web pages themselves.

您應用程式中的 Application Insights 檢測功能會將遙測傳送到 Application Insights 資源。

此外,您可以從主機環境 (例如效能計數器、Azure 診斷或 Docker 記錄) 提取遙測資料。In addition, you can pull in telemetry from the host environments such as performance counters, Azure diagnostics, or Docker logs. 您也可以設定會定期將綜合要求傳送至 Web 服務的 Web 測試。You can also set up web tests that periodically send synthetic requests to your web service.

上述所有遙測串流都會整合於 Azure 入口網站中,您可在其中將強大的分析和搜尋工具套用於未經處理的資料。All these telemetry streams are integrated in the Azure portal, where you can apply powerful analytic and search tools to the raw data.

負荷為何?What's the overhead?

對您的應用程式效能的影響很小。The impact on your app's performance is very small. 追蹤呼叫非封鎖性,而且會在個別的執行緒中分批傳送。Tracking calls are non-blocking, and are batched and sent in a separate thread.

Application Insights 可監視什麼?What does Application Insights monitor?

Application Insights 是以開發小組為目標,以協助您了解您的應用程式的執行和使用情況。Application Insights is aimed at the development team, to help you understand how your app is performing and how it's being used. 它可監視︰It monitors:

  • 要求率、回應時間和失敗率 - 找出哪些頁面在每天哪些時段最受歡迎,以及使用者位於何處。Request rates, response times, and failure rates - Find out which pages are most popular, at what times of day, and where your users are. 查看哪些頁面的表現最好。See which pages perform best. 如果您的回應時間和失敗率隨著要求增加而提高,您或許有資源配置問題。If your response times and failure rates go high when there are more requests, then perhaps you have a resourcing problem.
  • 相依比率、回應時間和失敗率 - 找出外部服務是否會使您降低效能。Dependency rates, response times, and failure rates - Find out whether external services are slowing you down.
  • 例外狀況 - 分析彙總統計資料,或挑選特定執行個體並深入了解堆疊追蹤和相關要求。Exceptions - Analyse the aggregated statistics, or pick specific instances and drill into the stack trace and related requests. 伺服器和瀏覽器例外狀況都會報告。Both server and browser exceptions are reported.
  • 頁面檢視和載入效能 - 由使用者的瀏覽器報告。Page views and load performance - reported by your users' browsers.
  • 來自網頁的 AJAX 呼叫 - 比率、回應時間和失敗率。AJAX calls from web pages - rates, response times, and failure rates.
  • 使用者和工作階段計數User and session counts.
  • Windows 或 Linux 伺服器電腦中的效能計數器,例如 CPU、記憶體和網路使用量。Performance counters from your Windows or Linux server machines, such as CPU, memory, and network usage.
  • 來自 Docker 或 Azure 的主機診斷Host diagnostics from Docker or Azure.
  • 來自您應用程式的診斷追蹤記錄檔 - 讓您使追蹤事件與要求相互關聯。Diagnostic trace logs from your app - so that you can correlate trace events with requests.
  • 您在用戶端或伺服器程式碼中自行撰寫的自訂事件和計量,可追蹤商業事件,例如售出的項目或獲勝的遊戲。Custom events and metrics that you write yourself in the client or server code, to track business events such as items sold or games won.

哪裡可以查看我的遙測?Where do I see my telemetry?

有許多方式可以探索您的資料。There are plenty of ways to explore your data. 請參閱下列文章:Check out these articles:

智慧型偵測和手動警示Smart detection and manual alerts
如果在常見模式之外發生一些狀況,則自動警示會適應您應用程式的一般遙測和觸發程式模式。Automatic alerts adapt to your app's normal patterns of telemetry and trigger when there's something outside the usual pattern. 您也可以在自訂或標準計量的特定層級上設定警示You can also set alerts on particular levels of custom or standard metrics.
警示範例
應用程式對應Application map
應用程式的元件,包含重要計量和警示。The components of your app, with key metrics and alerts.
應用程式對應
分析工具Profiler
檢查取樣要求的執行設定檔。Inspect the execution profiles of sampled requests.
分析工具
使用量分析Usage analysis
分析使用者區隔和保留期。Analyze user segmentation and retention.
保留期工具
執行個體資料的診斷搜尋Diagnostic search for instance data
搜尋和篩選事件,例如要求、例外狀況、相依性呼叫、記錄追蹤,以及頁面檢視。Search and filter events such as requests, exceptions, dependency calls, log traces, and page views.
搜尋遙測
彙總資料的計量瀏覽器Metrics Explorer for aggregated data
瀏覽、篩選和分割彙總的資料,例如,要求、錯誤和例外狀況的比率;回應時間、頁面載入時間。Explore, filter, and segment aggregated data such as rates of requests, failures, and exceptions; response times, page load times.
度量
儀表板Dashboards
來自多個資源的交互式資料並與其他人員共用。Mash up data from multiple resources and share with others. 非常適用於多元件的應用程式,以及小組聊天室中的連續顯示。Great for multi-component applications, and for continuous display in the team room.
儀表板範例
即時計量串流Live Metrics Stream
當您部署新的組建時,請觀看這些近乎即時的效能指標,以確定一切如預期運作。When you deploy a new build, watch these near-real-time performance indicators to make sure everything works as expected.
即時計量範例
分析Analytics
使用這個功能強大的查詢語言,回答有關您應用程式效能和使用方式的艱難問題。Answer tough questions about your app's performance and usage by using this powerful query language.
分析範例
Visual StudioVisual Studio
查看程式碼中的效能資料。See performance data in the code. 從堆疊追蹤移至程式碼。Go to code from stack traces.
Visual Studio
快照集偵錯工具Snapshot debugger
使用參數值,對取樣自即時作業的快照集進行偵錯。Debug snapshots sampled from live operations, with parameter values.
Visual Studio
Power BIPower BI
整合使用量計量和其他商業智慧。Integrate usage metrics with other business intelligence.
Power BI
REST APIREST API
撰寫程式碼,對您的計量和未經處理資料執行查詢。Write code to run queries over your metrics and raw data.
REST API
連續匯出Continuous export
立即將送達的未經處理資料大量匯出至儲存體。Bulk export of raw data to storage as soon as it arrives.
匯出

如何使用 Application Insights?How do I use Application Insights?

監視Monitor

在應用程式中安裝 Application Insights、設定可用性 Web 測試,以及︰Install Application Insights in your app, set up availability web tests, and:

  • 設定小組聊天室的儀表板,以持續關注相依項目、頁面載入和 AJAX 呼叫的載入、回應性和效能。Set up a dashboard for your team room to keep an eye on load, responsiveness, and the performance of your dependencies, page loads, and AJAX calls.
  • 探索哪些是最慢和最失敗的要求。Discover which are the slowest and most failing requests.
  • 在部署新版本時觀看即時串流,立即知曉任何效能降低情形。Watch Live Stream when you deploy a new release, to know immediately about any degradation.

偵測、診斷Detect, Diagnose

當您收到警示或發現問題︰When you receive an alert or discover a problem:

  • 評估有多少使用者受到影響。Assess how many users are affected.
  • 將失敗與例外狀況、相依項目呼叫和追蹤相互關聯。Correlate failures with exceptions, dependency calls and traces.
  • 檢查分析工具、快照集、堆疊傾印和追蹤記錄。Examine profiler, snapshots, stack dumps, and trace logs.

建置、測量、學習Build, Measure, Learn

測量所部署之各個新功能的效果Measure the effectiveness of each new feature that you deploy.

  • 計劃測量客戶使用新 UX 或商務功能的情況。Plan to measure how customers use new UX or business features.
  • 在程式碼中撰寫自訂遙測。Write custom telemetry into your code.
  • 讓下一個開發週期以遙測的真憑實據做為根據。Base the next development cycle on hard evidence from your telemetry.

開始使用Get started

Application Insights 是 Microsoft Azure 中裝載的多項服務之一,而遙測資料會送至該處進行分析及呈現。Application Insights is one of the many services hosted within Microsoft Azure, and telemetry is sent there for analysis and presentation. 所以在執行任何動作前,您需要 Microsoft Azure訂用帳戶。So before you do anything else, you'll need a subscription to Microsoft Azure. 您可免費註冊,而且如果選擇 Application Insights 的基本價格方案,在您的應用程式成長到有大量使用量之前,不會有任何變更。It's free to sign up, and if you choose the basic pricing plan of Application Insights, there's no charge until your application has grown to have substantial usage. 如果您的組織已經有訂用帳戶,他們可能會將您的 Microsoft 帳戶新增至其中。If your organization already has a subscription, they could add your Microsoft account to it.

有數種方式可以開始使用。There are several ways to get started. 從最適合您的方式著手。Begin with whichever works best for you. 您可以稍後新增其他帳戶。You can add the others later.

後續步驟Next steps

在執行階段開始使用︰Get started at runtime with:

在開發階段開始使用︰Get started at development time with:

支援與意見反應Support and feedback

影片Videos

動畫簡介Animated introduction