使用 Azure Monitor(预览版)监视资源组Monitor resource groups with Azure Monitor (preview)

现代应用程序通常很复杂且分布广泛,许多独立部件协同工作来提供服务。Modern applications are often complex and highly distributed with many discrete parts working together to deliver a service. Azure Monitor 考虑到这种复杂性,为资源组提供监视见解。Recognizing this complexity, Azure Monitor provides monitoring insights for resource groups. 因此,可以轻松分类和诊断各资源出现的任何问题,同时提供有关资源组和应用程序的运行状况和性能的整体上下文——。This makes it easy to triage and diagnose any problems your individual resources encounter, while offering context as to the health and performance of the resource group—and your application—as a whole.

资源组的访问见解Access insights for resource groups

  1. 在左侧的导航栏中选择“资源组”。Select Resource groups from the left-side navigation bar.
  2. 选择其中一个要浏览的资源组。Pick one of your resource groups that you want to explore. (如果拥有大量资源组,则按订阅筛选有时会很有用。)(If you have a large number of resource groups filtering by subscription can sometimes be helpful.)
  3. 若要访问资源组的见解,单击任意资源组的左侧菜单中的“见解”。To access insights for a resource group, click Insights in the left-side menu of any resource group.

资源组见解概述页的屏幕截图

具有活动警报和运行状况问题的资源Resources with active alerts and health issues

概述页显示已触发且仍处于活动状态的警报数以及每个资源的当前 Azure 资源运行状况。The overview page shows how many alerts have been fired and are still active, along with the current Azure Resource Health of each resource. 这些信息有助于快速发现出现问题的任何资源。Together, this information can help you quickly spot any resources that are experiencing issues. 警报可帮助检测代码中的问题以及配置基础结构的方式。Alerts help you detect issues in your code and how you've configured your infrastructure. Azure 资源运行状况显示 Azure 平台本身的问题,这些问题并非特定于单个应用程序。Azure Resource Health surfaces issue with the Azure platform itself, that aren't specific to your individual applications.

Azure 资源运行状况窗格的屏幕截图

Azure 资源运行状况Azure Resource Health

若要显示 Azure 资源运行状况,选中表格上方的“显示 Azure 资源运行状况”。To display Azure Resource Health, check the Show Azure Resource Health box above the table. 默认情况下隐藏此列,以快速加载页面。This column is hidden by default to help the page load quickly.

添加了资源运行状况图的屏幕截图

默认情况下,按照应用层和资源类型对资源进行分组。By default, the resources are grouped by app layer and resource type. 应用层是资源类型的简单分类,仅存在于资源组见解概述页的上下文中。App layer is a simple categorization of resource types, that only exists within the context of the resource group insights overview page. 存在与应用程序代码、计算基础结构、网络、存储 + 数据库相关的资源类型。There are resource types related to application code, compute infrastructure, networking, storage + databases. 管理工具具有自己的应用层,每个其他资源都归类为属于“其他”应用层。Management tools get their own app layers, and every other resource is categorized as belonging to the Other app layer. 此分组可以帮助快速查看应用程序的哪些子系统运行正常,哪些子系统运行不正常。This grouping can help you see at-a-glance what subsystems of your application are healthy and unhealthy.

诊断资源组中的问题Diagnose issues in your resource group

资源组见解页提供一些可帮助诊断问题的其他工具The resource group insights page provides several other tools scoped to help you diagnose issues

警报Alerts 查看、创建和管理警报。View, create, and manage your alerts.
指标Metrics 可视化并浏览基于指标的数据。Visualize and explore your metric based data.
活动日志Activity logs Azure 中已发生的订阅级别事件。Subscription level events that have occurred in Azure.
应用程序映射Application map 浏览分布式应用程序的拓扑,以识别性能瓶颈或故障作用点。Navigate your distributed application's topology to identify performance bottlenecks or failure hotspots.

故障和性能Failures and performance

如果发现应用程序运行缓慢或用户报告了错误,该怎么办?What if you've noticed your application is running slowly, or users have reported errors? 搜索所有资源以隔离问题是非常耗时的。It's time consuming to search through all of your resources to isolate problems.

“性能”和“故障”选项卡通过结合使用许多常见资源类型的性能和故障诊断视图,简化了此过程 。The Performance and Failures tabs simplify this process by bringing together performance and failure diagnostic views for many common resource types.

大多数资源类型将打开 Azure Monitor 工作簿模板库。Most resource types will open a gallery of Azure Monitor Workbook templates. 可以自定义、保存、与团队共享创建的每个工作簿,并在将来重新用于诊断类似问题。Each workbook you create can be customized, saved, shared with your team, and reused in the future to diagnose similar issues.

调查故障Investigate failures

若要测试“故障”选项卡,选择左侧菜单中“调查”下的“故障” 。To test out the Failures tab select Failures under Investigate in the left-hand menu.

选择完成后,左侧菜单栏会发生更改,提供新选项。The left-side menu bar changes after your selection is made, offering you new options.

故障概述窗格的屏幕截图

选择应用服务时,会看到 Azure Monitor 工作簿模板库。When App Service is chosen, you are presented with a gallery of Azure Monitor Workbook templates.

应用程序工作簿库的屏幕截图

选择故障见解的模板会打开工作簿。Choosing the template for Failure Insights will open the workbook.

故障报告的屏幕截图

可以选择任意行。You can select any of the rows. 然后所选内容显示在图形的详细信息视图中。The selection is then displayed in a graphical details view.

故障详细信息的屏幕截图

工作簿将创建自定义报告和可视化效果的困难工作抽象化为易于使用的格式。Workbooks abstract away the difficult work of creating custom reports and visualizations into an easily consumable format. 虽然一些用户可能只想调整预生成的参数,但工作簿是完全可自定义的。While some users may only want to adjust the prebuilt parameters, workbooks are completely customizable.

若要了解此工作簿是如何在内部运作的,选择顶栏的“编辑”。To get a sense of how this workbook functions internally, select Edit in the top bar.

其他编辑选项的屏幕截图

许多“编辑”框将显示在工作簿的各种元素周围。A number of Edit boxes appear near the various elements of the workbook. 选择操作表下方的“编辑”框。Select the Edit box below the table of operations.

编辑框的屏幕截图

这显示了生成表的可视化效果的底层日志查询。This reveals the underlying log query that is driving the table visualization.

日志查询窗口的屏幕截图

可以直接修改查询。You can modify the query directly. 还可以将其作为参考,并在设计自己的自定义参数化工作簿时从中借用。Or you can use it as a reference and borrow from it when designing your own custom parameterized workbook.

调查性能Investigate performance

性能提供其自己的工作簿库。Performance offers its own gallery of workbooks. 对于应用服务,预生成的应用程序性能工作簿提供以下视图:For App Service the prebuilt Application Performance workbook offers the following view:

性能视图的屏幕截图

在这种情况下,如果选择编辑,将看到这组可视化效果由 Azure Monitor Metrics 提供支持。In this case, if you select edit you will see that this set of visualizations is powered by Azure Monitor Metrics.

Azure Metrics 的性能视图的屏幕截图

疑难解答Troubleshooting

启用对警报的访问Enabling access to alerts

若要在适用于资源组的 Azure Monitor 中查看警报,需要由此订阅中具有“所有者”或“参与者”角色的某人为订阅中的任何资源组打开适用于资源组的 Azure Monitor。To see alerts in Azure Monitor for Resource Groups, someone with an Owner or Contributor role for this subscription needs to open Azure Monitor for Resource Groups for any resource group in the subscription. 这会使得具有读取访问权限的任何人都能够在适用于资源组的 Azure Monitor 中查看针对该订阅中所有资源组的警报。This will enable anyone with read access to see alerts in Azure Monitor for Resource Groups for all of the resource groups in the subscription. 如果你拥有“所有者”或“参与者”角色,请在几分钟后刷新此页面。If you have an Owner or Contributor role, refresh this page in a few minutes.

适用于资源组的 Azure Monitor 依赖于 Azure Monitor 警报管理系统来检索警报状态。Azure Monitor for Resource Groups relies on the Azure Monitor Alerts Management system to retrieve alert status. 默认情况下没有为每个资源组和订阅配置“警报管理”,它只能由具有“所有者”或“参与者”角色的某人来启用。Alerts Management isn't configured for every resource group and subscription by default, and it can only be enabled by someone with an Owner or Contributor role. 可以通过以下任一方式启用它:It can be enabled either by:

  • 为订阅中的任何资源组打开适用于资源组的 Azure Monitor。Opening Azure Monitor for Resource Groups for any resource group in the subscription.
  • 或者,转到订阅,单击“资源提供程序”,然后单击“注册 Alerts.Management”。Or by going to the subscription, clicking Resource Providers, then clicking Register for Alerts.Management.

后续步骤Next steps