可视化 Azure Monitor 中的数据Visualizing data from Azure Monitor

本文概述了将 Azure Monitor 中存储的日志和指标数据可视化时可使用的方法。This article provides a summary of the available methods to visualize log and metric data stored in Azure Monitor.

图表和图形等可视化效果有助于你分析监视数据,从而深入了解问题并识别模式。Visualizations such as charts and graphs can help you analyze your monitoring data to drill-down on issues and identify patterns. 根据使用的工具,你还可以选择与组织内外的其他用户共享可视化效果。Depending on the tool you use, you may also have the option to share visualizations with other users inside and outside of your organization.

Note

本文最近已更新,从使用术语“Log Analytics”改为使用术语“Azure Monitor 日志”。This article was recently updated to use the term Azure Monitor logs instead of Log Analytics. 日志数据仍然存储在 Log Analytics 工作区中,并仍然由同一 Log Analytics 服务收集并分析。Log data is still stored in a Log Analytics workspace and is still collected and analyzed by the same Log Analytics service. 我们正在更新术语,以便更好地反映 Azure Monitor 中日志的角色。We are updating the terminology to better reflect the role of logs in Azure Monitor. 有关详细信息,请参阅 Azure Monitor 术语更改See Azure Monitor terminology changes for details.

Azure 仪表板Azure Dashboards

Azure 仪表板是 Azure 的主要仪表板技术。Azure dashboards are the primary dashboarding technology for Azure. 这种在 Azure 基础结构和服务上提供的单一管理平台,在实现快速识别重要问题方面尤其有用。They're particularly useful in providing single pane of glass over your Azure infrastructure and services allowing you to quickly identify important issues.

仪表板

优点Advantages

  • 深度集成到 Azure 中。Deep integration into Azure. 可视化效果可以固定到多个 Azure 页面的仪表板,包括指标资源管理器、Log Analytics 和 Application Insights。Visualizations can be pinned to dashboards from multiple Azure pages including Metrics Explorer, Log Analytics, and Application Insights.
  • 支持指标和日志。Supports both metrics and logs.
  • 合并来自多个源的数据,包括指标资源管理器日志查询以及 Application Insights 中的映射和可用性的输出。Combine data from multiple sources including output from metrics explorer, Log queries, and maps and availability in Application Insights.
  • 包含个人或共享仪表板的选项。Option for personal or shared dashboards. 与 Azure 基于角色的身份验证 (RBAC) 集成。Integrated with Azure role based authentication (RBAC).
  • 自动刷新。Automatic refresh. 指标刷新的时间范围至少为 5 分钟。Metrics refresh depends on time range with minimum of five minutes. 日志以 1 分钟为间隔刷新。Logs refresh at one minute.
  • 带有时间戳和自定义参数的参数化指标仪表板。Parametrized metrics dashboards with timestamp and custom parameters.
  • 灵活的布局选项。Flexible layout options.
  • 全屏模式。Full screen mode.

限制Limitations

  • 对日志可视化效果具有有限控制,不支持数据表。Limited control over log visualizations with no support for data tables. 数据系列总数限制为 10,其他数据系列在“其他” Bucket 下进行分组。Total number of data series is limited to 10 with further data series grouped under an other bucket.
  • 对于日志图表,不支持自定义参数。No custom parameters support for log charts.
  • 日志图表仅限于过去 30 天。Log charts are limited to last 30 days.
  • 日志图表只能固定到共享仪表板。Log charts can only be pinned to shared dashboards.
  • 没有与仪表板数据的交互操作。No interactivity with dashboard data.
  • 上下文向下钻取受限。Limited contextual drill-down.

Azure Monitor 视图Azure Monitor Views

借助 Azure Monitor 中的视图,可以使用日志数据创建自定义可视化效果。Views in Azure Monitor allow you to create custom visualizations with log data. 它们由监视解决方案用于呈现所收集的数据。They are used by monitoring solutions to present the data they collect.

查看

优点Advantages

  • 为日志数据提供了丰富的可视化效果。Rich visualizations for log data.
  • 导出和导入视图可以将其传输到其他资源组和订阅。Export and import views to transfer them to other resource groups and subscriptions.
  • 通过工作区和监视解决方案集成到 Azure Monitor 管理模型中。Integrates into Azure Monitor management model with workspaces and monitoring solutions.
  • 用于自定义参数的筛选器Filters for custom parameters.
  • 具有交互性,支持多级钻取(一个视图钻取到另一个视图)Interactive, supports multi-level drill-in (view that drills into another view)

限制Limitations

  • 支持日志,但不支持指标。Supports logs but not metrics.
  • 无个人视图。No personal views. 适用于有权限访问工作区的所有用户。Available to all users with access to the workspace.
  • 无自动刷新。No automatic refresh.
  • 布局选项有限。Limited layout options.
  • 不支持跨多个工作区或 Application Insights 应用程序进行查询。No support for querying across multiple workspaces or Application Insights applications.
  • 查询的响应大小限制为 8MB,查询的执行时间限制为 110 秒。Queries are limited in response size to 8MB and query execution time of 110 seconds.

工作簿Workbooks

工作簿是交互式文档,可以让用户深入了解团队内部的数据、调查和协作。Workbooks are interactive documents that provide deep insights into your data, investigation, and collaboration inside the team. 例如,工作簿在故障排查指南和事件分析方面非常有用。Specific examples where workbooks are useful are troubleshooting guides and incident postmortem.

工作簿

优点Advantages

  • 支持指标和日志。Supports both metrics and logs.
  • 支持启用交互式报表的参数,其中,选择表中的元素将以动态方式更新关联的图表和可视化效果。Supports parameters enabling interactive reports where selecting an element in a table will dynamically update associated charts and visualizations.
  • 类似于文档的流。Document-like flow.
  • 包含个人或共享工作簿的选项。Option for personal or shared workbooks.
  • 轻松、易协作的创作体验。Easy, collaborative-friendly authoring experience.
  • 模板支持基于 GitHub 的公共模板库。Templates support public GitHub-based template gallery.

限制Limitations

  • 无自动刷新。No automatic refresh.
  • 没有类似仪表板的密集布局,这使得工作簿作为单一管理平台不太有用。No dense layout like dashboards, which make workbooks less useful as a single pane of glass. 旨在提供更深入的见解。Intended more for providing deeper insights.

优点Advantages

  • 丰富的可视化效果。Rich visualizations.
  • 广泛的交互性,包括放大和交叉筛选。Extensive interactivity including zoom-in and cross-filtering.
  • 易于在整个组织内共享。Easy to share throughout your organization.
  • 与来自多个数据源的其他数据集成。Integration with other data from multiple data sources.
  • 结果缓存在多维数据集中,性能更佳。Better performance with results cached in a cube.

限制Limitations

  • 支持日志,但不支持指标。Supports logs but not metrics.
  • 无 Azure 集成。No Azure integration. 无法通过 Azure 资源管理器管理仪表板和模型。Can't manage dashboards and models through Azure Resource Manager.
  • 需要将查询结果导入到 Power BI 模型中进行配置。Query results need to be imported into Power BI model to configure. 结果大小和刷新存在限制。Limitation on result size and refresh.
  • 每天的数据刷新次数限制为 8 次。Limited data refresh of eight times per day.

优点Advantages

  • 丰富的可视化效果。Rich visualizations.
  • 丰富的数据源生态系统。Rich ecosystem of datasources.
  • 数据交互功能,包括放大。Data interactivity including zoom in.
  • 支持参数。Supports parameters.

限制Limitations

  • 无 Azure 集成。No Azure integration. 无法通过 Azure 资源管理器管理仪表板和模型。Can't manage dashboards and models through Azure Resource Manager.
  • 支持额外 Grafana 基础结构的成本或用于 Grafana Cloud 的额外成本。Cost to support additional Grafana infrastructure or additional cost for Grafana Cloud.

生成自己的自定义应用程序Build your own custom application

你可以使用任何 REST 客户端通过其 API 访问 Azure Monitor 中的日志和指标数据,从而可以生成自己的自定义网站和应用程序。You can access data in log and metric data in Azure Monitor through their API using any REST client, which allows you to build your own custom websites and applications.

优点Advantages

  • 在 UI、可视化效果、交互性和功能方面具有完全的灵活性。Complete flexibility in UI, visualization, interactivity, and features.
  • 可将指标和日志数据与其他数据源相结合。Combine metrics and log data with other data sources.

缺点Disadvantages

  • 所需的工程工作量明显较大。Significant engineering effort required.

后续步骤Next steps