监视 Batch 解决方案Monitor Batch solutions

Azure 和 Batch 服务提供了一系列服务、工具和 API 来监视 Batch 解决方案。Azure and the Batch service provide a range of services, tools, and APIs to monitor your Batch solutions. 本概述文章可帮助你选择适合需求的监视方法。This overview article helps you choose a monitoring approach that fits your needs.

有关可用来监视 Azure 资源的 Azure 组件和服务的概述,请参阅监视 Azure 应用程序和资源For an overview of the Azure components and services available to monitor Azure resources, see Monitoring Azure applications and resources.

订阅级监视Subscription-level monitoring

在订阅级别(包括 Batch 帐户),Azure 活动日志将操作事件数据收集到几个类别中。At the subscription level, which includes Batch accounts, the Azure activity log collects operational event data in several categories.

对于 Batch 帐户,具体而言,活动日志收集与帐户创建和删除以及密钥管理相关的事件。For Batch accounts specifically, the activity log collects events related to account creation and deletion and key management.

从活动日志中检索事件的一种方法是使用 Azure 门户。One way to retrieve events from your activity log is to use the Azure portal. 单击“所有服务” > “活动日志”。Click All services > Activity Log. 或者,使用 Azure CLI、PowerShell cmdlet 或 Azure Monitor REST API 来查询事件。Or, query for events using the Azure CLI, PowerShell cmdlets, or the Azure Monitor REST API.

Batch 帐户级监视Batch account-level monitoring

使用 Azure Monitor 的各项功能监视每个 Batch 帐户。Monitor each Batch account using features of Azure Monitor. Azure Monitor 针对 Batch 帐户级别范围内的资源(例如池、作业和任务)选择性地收集诊断日志Azure Monitor collects optionally diagnostic logs for resources scoped at the level of a Batch account, such as pools, jobs, and tasks. 可以手动或以编程方式收集并使用此数据来监视 Batch 帐户中的活动以及对问题进行诊断。Collect and consume this data manually or programmatically to monitor activities in your Batch account and to diagnose issues. 有关详细信息,请参阅用于诊断评估和监视的 Batch 指标、警报和日志For details, see Batch metrics, alerts, and logs for diagnostic evaluation and monitoring.

Note

指标默认情况下在 Batch 帐户中可用,不需要进行额外配置,它们具有为期 30 天的滚动历史记录。Metrics are available by default in your Batch account without additional configuration, and they have a 30-day rolling history. 必须为 Batch 帐户启用诊断日志记录,并且,若要存储或处理诊断日志数据,可能会产生其他成本。You must enable diagnostic logging for a Batch account, and you may incur additional costs to store or process diagnostic log data.

Batch 资源监视Batch resource monitoring

在 Batch 应用程序中,可以使用 Batch API 来监视或查询资源(包括作业、任务、节点和池)的状态。In your Batch applications, use the Batch APIs to monitor or query the status of your resources including jobs, tasks, nodes, and pools. 例如:For example:

VM 性能计数器和应用程序监视VM performance counters and application monitoring

后续步骤Next steps