Azure Monitor 中的 Azure 事件中心指标Azure Event Hubs metrics in Azure Monitor

事件中心指标可提供 Azure 订阅中的事件中心资源状态。Event Hubs metrics give you the state of Event Hubs resources in your Azure subscription. 通过多种指标数据集,可在命名空间和实体级别评估事件中心的总体运行状况。With a rich set of metrics data, you can assess the overall health of your event hubs not only at the namespace level, but also at the entity level. 由于它们能够帮助监视事件中心的状态,因此这些统计信息非常重要。These statistics can be important as they help you to monitor the state of your event hubs. 另外,指标也可帮助解决由根本原因造成的问题,而无需联系 Azure 支持。Metrics can also help troubleshoot root-cause issues without needing to contact Azure support.

Azure Monitor 提供了统一的用户界面,可用于监视各种 Azure 服务。Azure Monitor provides unified user interfaces for monitoring across various Azure services. 有关详细信息,请参阅 GitHub 上的在 Microsoft Azure 中进行监视通过 .NET 检索 Azure Monitor 指标示例。For more information, see Monitoring in Microsoft Azure and the Retrieve Azure Monitor metrics with .NET sample on GitHub.

访问指标Access metrics

Azure Monitor 提供多种访问指标的方法。Azure Monitor provides multiple ways to access metrics. 可通过 Azure 门户、Azure Monitor API(REST 和 .Net)与分析解决方案(例如 Log Analytics 和事件中心)访问指标。You can either access metrics through the Azure portal, or use the Azure Monitor APIs (REST and .NET) and analysis solutions such as Log Analytics and Event Hubs. 有关详细信息,请参阅 Azure Monitor 收集的监视数据For more information, see Monitoring data collected by Azure Monitor.

默认情况下,已启用指标,并且可访问最近 30 天的数据。Metrics are enabled by default, and you can access the most recent 30 days of data. 如需将数据保留更长一段时间,可将指标数据存档到 Azure 存储帐户。If you need to retain data for a longer period of time, you can archive metrics data to an Azure Storage account. 可在 Azure Monitor 的 诊断设置 中完成这种配置。This is configured in diagnostic settings in Azure Monitor.

在门户中访问指标Access metrics in the portal

可在 Azure 门户中监视一段时间内的指标。You can monitor metrics over time in the Azure portal. 以下示例演示了如何在帐户级别查看成功的请求和传入的请求:The following example shows how to view successful requests and incoming requests at the account level:

查看成功的指标

也可以直接通过命名空间来访问指标。You can also access metrics directly via the namespace. 为此,请选择命名空间,然后单击“指标” 。To do so, select your namespace and then click Metrics. 若要显示筛选到事件中心范围的指标,请选择事件中心,然后单击“指标” 。To display metrics filtered to the scope of the event hub, select the event hub and then click Metrics.

对于支持维度的指标,必须使用所需的维度值进行筛选,如以下示例所示:For metrics supporting dimensions, you must filter with the desired dimension value as shown in the following example:

使用维度值进行筛选

计费Billing

目前,在 Azure Monitor 中可以免费使用指标。Using metrics in Azure Monitor is currently free. 但是,如果使用引入指标数据的其他解决方案,可能就需要收费。However, if you use additional solutions that ingest metrics data, you may be billed by these solutions. 例如,如果将指标数据存档到 Azure 存储帐户,则 Azure 存储会收费。For example, you are billed by Azure Storage if you archive metrics data to an Azure Storage account.

以下指标可提供服务运行状况的概述。The following metrics give you an overview of the health of your service.

备注

我们弃用了多个指标,因为它们已移动到不同的名称下。We are deprecating several metrics as they are moved under a different name. 这可能会要求你更新引用。This might require you to update your references. 今后将不再支持标有“弃用的”关键字的指标。Metrics marked with the "deprecated" keyword will not be supported going forward.

所有指标值每隔一分钟发送到 Azure Monitor。All metrics values are sent to Azure Monitor every minute. 时间粒度定义了提供指标值的时间间隔。The time granularity defines the time interval for which metrics values are presented. 所有事件中心指标所支持的时间间隔为一分钟。The supported time interval for all Event Hubs metrics is 1 minute.

请求指标Request metrics

计算数据量和管理操作请求数。Counts the number of data and management operations requests.

标准名称Metric Name 说明Description
传入请求数Incoming Requests 在指定期间内向 Azure 事件中心服务发送的请求数。The number of requests made to the Azure Event Hubs service over a specified period.

单位:计数Unit: Count
聚合类型:总计Aggregation Type: Total
维度:EntityNameDimension: EntityName
成功的请求数Successful Requests 在指定期间内向 Azure 事件中心服务发送成功的请求数。The number of successful requests made to the Azure Event Hubs service over a specified period.

单位:计数Unit: Count
聚合类型:总计Aggregation Type: Total
维度:EntityNameDimension: EntityName
服务器错误数Server Errors 由于 Azure 事件中心服务发生错误,在指定期间内未处理的请求数。The number of requests not processed due to an error in the Azure Event Hubs service over a specified period.

单位:计数Unit: Count
聚合类型:总计Aggregation Type: Total
维度:EntityNameDimension: EntityName
用户错误数User Errors 由于存在用户错误,在指定期间内未处理的请求数。The number of requests not processed due to user errors over a specified period.

单位:计数Unit: Count
聚合类型:总计Aggregation Type: Total
维度:EntityNameDimension: EntityName
超过配额错误Quota Exceeded Errors 超出可用配额的请求数。The number of requests exceeded the available quota. 有关事件中心配额的详细信息,请参阅本文See this article for more information about Event Hubs quotas.

单位:计数Unit: Count
聚合类型:总计Aggregation Type: Total
维度:EntityNameDimension: EntityName

吞吐量指标Throughput metrics

标准名称Metric Name 说明Description
限制的请求数Throttled Requests 由于超出吞吐量单位用量而被限制的请求数。The number of requests that were throttled because the throughput unit usage was exceeded.

单位:计数Unit: Count
聚合类型:总计Aggregation Type: Total
维度:EntityNameDimension: EntityName

消息指标Message metrics

标准名称Metric Name 说明Description
传入消息数Incoming Messages 在指定期间内发送到事件中心的事件或邮件数。The number of events or messages sent to Event Hubs over a specified period.

单位:计数Unit: Count
聚合类型:总计Aggregation Type: Total
维度:EntityNameDimension: EntityName
传出消息数Outgoing Messages 在指定期间内从事件中心检索的事件或邮件数。The number of events or messages retrieved from Event Hubs over a specified period.

单位:计数Unit: Count
聚合类型:总计Aggregation Type: Total
维度:EntityNameDimension: EntityName
传入字节数Incoming Bytes 在指定期间内向 Azure 事件中心服务发送的字节数。The number of bytes sent to the Azure Event Hubs service over a specified period.

单元:字节Unit: Bytes
聚合类型:总计Aggregation Type: Total
维度:EntityNameDimension: EntityName
传出字节数Outgoing Bytes 在指定期间内从 Azure 事件中心服务检索的字节数。The number of bytes retrieved from the Azure Event Hubs service over a specified period.

单元:字节Unit: Bytes
聚合类型:总计Aggregation Type: Total
维度:EntityNameDimension: EntityName

连接指标Connection metrics

标准名称Metric Name 说明Description
ActiveConnectionsActiveConnections 命名空间以及实体上的活动连接数。The number of active connections on a namespace as well as on an entity.

单位:计数Unit: Count
聚合类型:总计Aggregation Type: Total
维度:EntityNameDimension: EntityName
打开的连接数Connections Opened 打开的连接数。The number of open connections.

单位:计数Unit: Count
聚合类型:总计Aggregation Type: Total
维度:EntityNameDimension: EntityName
关闭的连接数Connections Closed 关闭的连接数。The number of closed connections.

单位:计数Unit: Count
聚合类型:总计Aggregation Type: Total
维度:EntityNameDimension: EntityName

事件中心捕获指标Event Hubs Capture metrics

当为事件中心启用捕获功能时,即可监视事件中心捕获指标。You can monitor Event Hubs Capture metrics when you enable the Capture feature for your event hubs. 以下指标描述了在启用捕获的情况下可监视的内容。The following metrics describe what you can monitor with Capture enabled.

标准名称Metric Name 说明Description
捕获积压工作 (backlog)Capture Backlog 尚未捕获到所选目标的字节数。The number of bytes that are yet to be captured to the chosen destination.

单元:字节Unit: Bytes
聚合类型:总计Aggregation Type: Total
维度:EntityNameDimension: EntityName
捕获的消息数Captured Messages 在指定期间内捕获到所选目标的邮件或事件数。The number of messages or events that are captured to the chosen destination over a specified period.

单位:计数Unit: Count
聚合类型:总计Aggregation Type: Total
维度:EntityNameDimension: EntityName
捕获的字节数Captured Bytes 在指定期间内捕获到所选目标的字节数。The number of bytes that are captured to the chosen destination over a specified period.

单元:字节Unit: Bytes
聚合类型:总计Aggregation Type: Total
维度:EntityNameDimension: EntityName

指标维度Metrics dimensions

Azure 事件中心支持对 Azure Monitor 中的指标使用以下维度。Azure Event Hubs supports the following dimensions for metrics in Azure Monitor. 为指标添加维度是可选的。Adding dimensions to your metrics is optional. 如果不添加维度,则指标是在命名空间级别指定的。If you do not add dimensions, metrics are specified at the namespace level.

标准名称Metric Name 说明Description
EntityNameEntityName 事件中心支持命名空间下的事件中心实体。Event Hubs supports the event hub entities under the namespace.

Azure Monitor 与 SIEM 工具集成Azure Monitor integration with SIEM tools

使用 Azure Monitor 将监视数据(活动日志、诊断日志等)路由到事件中心,可以轻松地与安全信息和事件管理 (SIEM) 工具集成。Routing your monitoring data (activity logs, diagnostics logs, etc.) to an event hub with Azure Monitor enables you to easily integrate with Security Information and Event Management (SIEM) tools. 有关详细信息,请参阅以下文章/博客文章:For more information, see the following articles/blog posts:

在 SIEM 工具使用事件中心的日志数据的情况下,如果在指标图中看不到传入消息,或者看到传入消息但看不到传出消息,请按照下列步骤操作:In the scenario where an SIEM tool consumes log data from an event hub, if you see no incoming messages or you see incoming messages but no outgoing messages in the metrics graph, follow these steps:

  • 如果没有传入消息,则表示 Azure Monitor 服务没有将审核/诊断日志移到事件中心。If there are no incoming messages, it means that the Azure Monitor service is not moving audit/diagnostics logs into the event hub. 在此方案中,通过 Azure Monitor 团队建立支持票证。Open a support ticket with the Azure Monitor team in this scenario.
  • 如果有传入消息,但没有传出消息,则意味着 SIEM 应用程序未读取消息。if there are incoming messages, but no outgoing messages, it means that the SIEM application is not reading the messages. 请与 SIEM 提供者联系,以确定这些应用程序的事件中心配置是否正确。Contact the SIEM provider to determine whether the configuration of the event hub those applications is correct.

后续步骤Next steps

有关事件中心的详细信息,请访问以下链接:For more information about Event Hubs, visit the following links: