Azure 監視器概觀Azure Monitor overview

Azure 監視器可協助您將應用程式和服務的可用性和效能最大化。Azure Monitor helps you maximize the availability and performance of your applications and services. 它可提供全方位解決方案,以便收集、分析及處理來自雲端和內部部署環境的遙測資料。It delivers a comprehensive solution for collecting, analyzing, and acting on telemetry from your cloud and on-premises environments. 這項資訊可協助您了解您的應用程式表現如何,並主動識別對其造成影響的問題及其所依賴的資源。This information helps you understand how your applications are performing and proactively identify issues affecting them and the resources they depend on.

有關您可以使用 Azure Monitor 執行之動作的一些範例包括:Just a few examples of what you can do with Azure Monitor include:

注意

此服務支援 Azure Lighthouse,可讓服務提供者登入其本身的租用戶,以管理客戶所委派的訂用帳戶和資源群組。This service supports Azure Lighthouse, which lets service providers sign in to their own tenant to manage subscriptions and resource groups that customers have delegated.

概觀Overview

下圖提供 Azure 監視器的高階檢視。The following diagram gives a high-level view of Azure Monitor. 圖表的中間是計量與記錄的資料存放區,而這兩者是 Azure 監視器所用資料的兩個基本類型。At the center of the diagram are the data stores for metrics and logs, which are the two fundamental types of data used by Azure Monitor. 左邊的監視資料來源會填入這些資料存放區On the left are the sources of monitoring data that populate these data stores. 右邊是 Azure 監視器對此收集資料執行的不同功能。On the right are the different functions that Azure Monitor performs with this collected data. 這包括分析、警示,以及串流至外部系統等動作。This includes such actions as analysis, alerting, and streaming to external systems.

Azure 監視器概觀

監視資料平台Monitoring data platform

Azure 監視器所收集的所有資料均符合下列兩個基本類型之一:計量和記錄All data collected by Azure Monitor fits into one of two fundamental types, metrics and logs. 計量為數值,可描述系統在特定時間點的某個方面。Metrics are numerical values that describe some aspect of a system at a particular point in time. 它們屬於輕量型,而且能夠支援近乎即時的案例。They are lightweight and capable of supporting near real-time scenarios. 記錄包含不同類型的資料,而資料會針對每個類型組織成不同的屬性集。Logs contain different kinds of data organized into records with different sets of properties for each type. 除了效能資料,還會將事件和追蹤之類的遙測資料儲存為記錄,讓它能夠全部組合在一起進行分析。Telemetry such as events and traces are stored as logs in addition to performance data so that it can all be combined for analysis.

對於許多 Azure 資源,您會在 Azure 入口網站的 [概觀] 頁面當中看到 Azure 監視器所收集的資料。For many Azure resources, you'll see data collected by Azure Monitor right in their Overview page in the Azure portal. 比方說,查看一下任何虛擬機器,您會看到數個顯示效能計量的圖表。Have a look at any virtual machine for example, and you'll see several charts displaying performance metrics. 按一下任何圖表,以在 Azure 入口網站的計量瀏覽器中開啟資料,可讓您將一段時間的多個計量值繪製成圖表。Click on any of the graphs to open the data in metrics explorer in the Azure portal, which allows you to chart the values of multiple metrics over time. 您可以互動方式檢視圖表,或將其釘選到儀表板,利用其他視覺效果進行檢視。You can view the charts interactively or pin them to a dashboard to view them with other visualizations.

圖表顯示流入「計量瀏覽器」的計量資料,以便在視覺效果中使用。

可以使用查詢分析 Azure 監視器收集的記錄資料,以快速擷取、彙總和分析收集的資料。Log data collected by Azure Monitor can be analyzed with queries to quickly retrieve, consolidate, and analyze collected data. 您可以使用 Azure 入口網站中的 Log Analytics 來建立及測試查詢。You can create and test queries using Log Analytics in the Azure portal. 然後,您可以使用不同的工具直接分析資料,或儲存查詢以便搭配視覺效果警示規則使用。You can then either directly analyze the data using different tools or save queries for use with visualizations or alert rules.

Azure 監視器使用的 Kusto 查詢語言版本適合用於簡單的記錄查詢,但也包含進階功能,例如彙總、聯結和智慧分析。Azure Monitor uses a version of the Kusto query language that is suitable for simple log queries but also includes advanced functionality such as aggregations, joins, and smart analytics. 您可以使用多個課程,快速了解查詢語言。You can quickly learn the query language using multiple lessons. 我們會為已經熟悉 SQLSplunk 的使用者提供特別指引。Particular guidance is provided to users who are already familiar with SQL and Splunk.

圖表顯示流入 Log Analytics 以便進行分析的記錄資料。

Azure 監視器會收集哪些資料?What data does Azure Monitor collect?

Azure 監視器可以從多種來源收集資料。Azure Monitor can collect data from a variety of sources. 此範圍包括您的應用程式、其倚賴的任何作業系統和服務,乃至於平台本身。This ranges from your application, any operating system and services it relies on, down to the platform itself. Azure 監視器會從下列各層收集資料:Azure Monitor collects data from each of the following tiers:

  • 應用程式監視資料: 您所撰寫程式碼的效能和功能相關資料 (不論其平台為何)。Application monitoring data: Data about the performance and functionality of the code you have written, regardless of its platform.
  • 客體 OS 監視資料: 有關應用程式執行所在作業系統的資料。Guest OS monitoring data: Data about the operating system on which your application is running. 這可以在 Azure、其他雲端或內部部署中執行。This could be running in Azure, another cloud, or on-premises.
  • Azure 資源監視資料: 有關 Azure 資源作業的資料。Azure resource monitoring data: Data about the operation of an Azure resource.
  • Azure 訂用帳戶監視資料: 有關 Azure 訂用帳戶作業和管理的資料,以及有關 Azure 本身健康情況和作業的資料。Azure subscription monitoring data: Data about the operation and management of an Azure subscription, as well as data about the health and operation of Azure itself.
  • Azure 租用戶監視資料: 租用戶層級 Azure 服務的作業相關資料,例如 Azure Active Directory。Azure tenant monitoring data: Data about the operation of tenant-level Azure services, such as Azure Active Directory.

當您建立 Azure 訂用帳戶並開始新增資源 (例如虛擬機器和 Web 應用程式) 時,Azure 監視器就會開始收集資料。As soon as you create an Azure subscription and start adding resources such as virtual machines and web apps, Azure Monitor starts collecting data. 活動記錄會記錄資源的建立或修改時間。Activity logs record when resources are created or modified. 計量會告訴您如何執行資源以及它所取用的資源。Metrics tell you how the resource is performing and the resources that it's consuming.

啟用診斷,將您收集到的資料擴充至資源的內部作業。Enable diagnostics to extend the data you're collecting into the internal operation of the resources. 新增代理程式以計算資源,從其客體作業系統收集遙測資料。Add an agent to compute resources to collect telemetry from their guest operating systems.

為您的 Application Insights 啟用監視功能,讓 Application Insights 收集各種詳細資訊,包括頁面檢視、應用程式要求和例外狀況。Enable monitoring for your application with Application Insights to collect detailed information including page views, application requests, and exceptions. 設定可用性測試來模擬使用者流量,進一步確認您應用程式的可用性。Further verify the availability of your application by configuring an availability test to simulate user traffic.

自訂來源Custom sources

Azure 監視器可以使用資料收集器 API,從任何 REST 用戶端收集記錄資料。Azure Monitor can collect log data from any REST client using the Data Collector API. 這可讓您建立自訂監視案例,並且將監視延伸到不會透過其他來源公開遙測的資源。This allows you to create custom monitoring scenarios and extend monitoring to resources that don't expose telemetry through other sources.

深入解析Insights

如果監視資料可以提高您對於運算環境作業的可見性,監視資料才有用處。Monitoring data is only useful if it can increase your visibility into the operation of your computing environment. Insights 可為特定 Azure 服務提供自訂的監視體驗。Insights provide a customized monitoring experience for particular Azure services. 這只需要最基本的設定,且能夠提升您對重要資源作業的可見度。They require minimal configuration and increase your visibility into the operation of critical resources.

Application InsightsApplication Insights

Application Insights 可監視 Web 應用程式的可用性、效能及使用情況 (不論應用程式是裝載在雲端還是內部部署環境)。Application Insights monitors the availability, performance, and usage of your web applications whether they're hosted in the cloud or on-premises. 它會利用 Azure 監視器中強大的資料分析平台,為您提供應用程式作業的深入解析以及診斷錯誤。It leverages the powerful data analysis platform in Azure Monitor to provide you with deep insights into your application's operations. 如此,您即可快速診斷錯誤,而無須等待使用者回報錯誤。It enables you to diagnose errors without waiting for a user to report them. Application Insights 包含各種開發工具的連接點,並與 Visual Studio 整合以支援您的 DevOps 程序。Application Insights includes connection points to a variety of development tools and integrates with Visual Studio to support your DevOps processes.

應用程式情資

容器深入解析Container insights

容器深入 解析會監視部署至裝載于 AZURE KUBERNETES SERVICE (AKS) 上受管理 Kubernetes 叢集的容器工作負載效能。Container insights monitors the performance of container workloads that are deployed to managed Kubernetes clusters hosted on Azure Kubernetes Service (AKS). 它可透過計量 API 從 Kubernetes 中提供的控制器、節點與容器收集計量,為您提供效能可見性。It gives you performance visibility by collecting metrics from controllers, nodes, and containers that are available in Kubernetes through the Metrics API. 容器記錄也會一併收集。Container logs are also collected. 在您從 Kubernetes 叢集啟用監視之後,系統會透過適用於 Linux 的 Log Analytics 代理程式容器化版本自動收集這些計量和記錄。After you enable monitoring from Kubernetes clusters, these metrics and logs are automatically collected for you through a containerized version of the Log Analytics agent for Linux.

容器健康情況

VM 深入解析VM insights

Vm 深入 解析會大規模監視您的 Azure 虛擬機器 (VM) 。VM insights monitors your Azure virtual machines (VM) at scale. 此服務會分析 Windows 和 Linux VM 的效能和健康情況,並識別其不同的程序以及對外部程序的相互關聯相依性。It analyzes the performance and health of your Windows and Linux VMs and identifies their different processes and interconnected dependencies on external processes. 此解決方案包含針對在內部部署環境或其他雲端提供者上裝載的 VM,監視效能和應用程式相依性的支援。The solution includes support for monitoring performance and application dependencies for VMs hosted on-premises or another cloud provider.

VM Insights

回應重大情況Responding to critical situations

有效的監視解決方案除了可讓您以互動方式分析監視資料,還必須能夠主動回應在它所收集資料中找到的重大情況。In addition to allowing you to interactively analyze monitoring data, an effective monitoring solution must be able to proactively respond to critical conditions identified in the data that it collects. 可以是傳送文字或郵件給負責調查問題的系統管理員。This could be sending a text or mail to an administrator responsible for investigating an issue. 或者,您可啟動自動化程序,嘗試更正錯誤情況。Or you could launch an automated process that attempts to correct an error condition.

警示Alerts

Azure 監視器中的警示會主動通知您重大情況,並可能嘗試採取矯正措施。Alerts in Azure Monitor proactively notify you of critical conditions and potentially attempt to take corrective action. 以計量為基礎的警示規則會根據數值提供近乎即時的警示。Alert rules based on metrics provide near real time alerts based on numeric values. 以記錄為基礎的規則允許使用跨多個資料來源的複雜邏輯。Rules based on logs allow for complex logic across data from multiple sources.

Azure 監視器中的警示規則會使用動作群組,其中包含幾組獨特的收件人以及多個規則可共用的動作。Alert rules in Azure Monitor use action groups, which contain unique sets of recipients and actions that can be shared across multiple rules. 根據您的需求,動作群組可以執行一些動作,例如使用 Webhook 讓警示啟動外部動作,或與 ITSM 工具整合。Based on your requirements, action groups can perform such actions as using webhooks to have alerts start external actions or to integrate with your ITSM tools.

螢幕擷取畫面顯示 Azure 監視器中的警示,其中包含嚴重性、警示總計和其他資訊。

AutoscaleAutoscale

自動調整可讓您執行適當數量的資源來處理應用程式的負載。Autoscale allows you to have the right amount of resources running to handle the load on your application. 建立規則,並使用 Azure 監視器所收集的計量,以判斷何時應在負載增加時自動新增資源。Create rules that use metrics collected by Azure Monitor to determine when to automatically add resources when load increases. 移除閒置的資源可節省成本。Save money by removing resources that are sitting idle. 您可指定執行個體的數目上限和下限,以及何時要增加或減少資源的邏輯。You specify a minimum and maximum number of instances and the logic for when to increase or decrease resources.

圖表顯示自動調整功能,其中有數個伺服器位在標示「處理器時間 > 80%」的線條上,兩部伺服器標示為最小值、三部伺服器標示為目前的容量,以及五部伺服器標示為最大值。

將監視資料視覺化Visualizing monitoring data

視覺效果 (例如圖表和資料表) 是摘要監視資料以及向不同對象呈現資料的有效工具。Visualizations such as charts and tables are effective tools for summarizing monitoring data and presenting it to different audiences. Azure 監視器有自己的功能可將監視資料視覺化,並運用其他 Azure 服務向不同的對象發佈資料。Azure Monitor has its own features for visualizing monitoring data and leverages other Azure services for publishing it to different audiences.

儀表板Dashboards

Azure 儀表板可讓您將不同類型的資料結合至 Azure 入口網站的單一窗格中。Azure dashboards allow you to combine different kinds of data into a single pane in the Azure portal. 您可以選擇性地與其他 Azure 使用者共用儀表板。You can optionally share the dashboard with other Azure users. 請將任何記錄查詢或計量圖表的輸出新增至 Azure 儀表板。Add the output of any log query or metrics chart to an Azure dashboard. 例如,您可以建立一個儀表板,將顯示計量圖表、活動記錄表、來自 Application Insights 的使用情況圖表,以及記錄查詢輸出的圖格結合在一起。For example, you could create a dashboard that combines tiles that show a graph of metrics, a table of activity logs, a usage chart from Application Insights, and the output of a log query.

螢幕擷取畫面顯示 Azure 儀表板,其中包括應用程式和安全性磚,以及其他可自訂的資訊。

活頁簿Workbooks

活頁簿提供彈性的畫布用以進行資料分析,以及在 Azure 入口網站中建立豐富的視覺效果報表。Workbooks provide a flexible canvas for data analysis and the creation of rich visual reports in the Azure portal. 活頁簿可讓您從 Azure 中深入了解多個資料來源,並將其合併為整合的互動式體驗。They allow you to tap into multiple data sources from across Azure, and combine them into unified interactive experiences. 您可以使用 Insights 隨附的活頁簿,或從預先定義的範本建立自己的活頁簿。Use workbooks provided with Insights or create your own from predefined templates.

活頁簿範例

Power BIPower BI

Power BI 是一項商務分析服務,可提供跨多種資料來源的互動式視覺效果。Power BI is a business analytics service that provides interactive visualizations across a variety of data sources. 這是將資料提供給組織內、外部人員使用的有效方法。It's an effective means of making data available to others within and outside your organization. 您可以將 Power BI 設定為從 Azure 監視器自動匯入記錄資料,以便利用這些額外的視覺效果。You can configure Power BI to automatically import log data from Azure Monitor to take advantage of these additional visualizations.

Power BI

整合並匯出資料Integrate and export data

您通常需要整合 Azure 監視器與其他系統,以及建置自訂解決方案來使用您的監視資料。You'll often have the requirement to integrate Azure Monitor with other systems and to build custom solutions that use your monitoring data. 其他 Azure 服務會與 Azure 監視器搭配運作來提供這項整合。Other Azure services work with Azure Monitor to provide this integration.

事件中樞Event Hub

Azure 事件中樞是串流平台和事件擷取服務。Azure Event Hubs is a streaming platform and event ingestion service. 此服務可以使用任何即時分析提供者或批次/儲存體配接器來轉換和儲存資料。It can transform and store data using any real-time analytics provider or batching/storage adapters. 使用事件中樞將 Azure 監視器資料串流處理至合作夥伴 SIEM 和監視工具。Use Event Hubs to stream Azure Monitor data to partner SIEM and monitoring tools.

Logic AppsLogic Apps

Logic Apps 是一項服務,可讓您透過工作流程來整合不同的系統和服務,從而實現工作與商務程序的自動化。Logic Apps is a service that allows you to automate tasks and business processes using workflows that integrate with different systems and services. Azure 監視器中有活動可用來讀取和寫入計量和記錄。Activities are available that read and write metrics and logs in Azure Monitor. 這可讓您建置與各種其他系統整合的工作流程。This allows you to build workflows integrating with a variety of other systems.

APIAPI

除了存取所產生的警示,還有多個 API 可供讀取和寫入 Azure 監視器中的計量和記錄。Multiple APIs are available to read and write metrics and logs to and from Azure Monitor in addition to accessing generated alerts. 您也可以設定和擷取警示。You can also configure and retrieve alerts. 這可為您提供基本上無限制的可能性,來建置可與 Azure 監視器整合的自訂解決方案。This provides you with essentially unlimited possibilities to build custom solutions that integrate with Azure Monitor.

後續步驟Next steps

深入了解:Learn more about: