Azure 存储分析指标(经典)Azure Storage Analytics metrics (classic)

Azure 存储使用存储分析解决方案存储一些指标,这些指标包括有关存储服务请求的聚合事务统计信息和容量数据。Azure Storage uses the Storage Analytics solution to store metrics that include aggregated transaction statistics and capacity data about requests to a storage service. 事务在 API 操作级别以及存储服务级别报告。Transactions are reported at the API operation level and at the storage service level. 容量在存储服务级别报告。Capacity is reported at the storage service level. 指标数据可用于:Metrics data can be used to:

  • 分析存储服务使用情况。Analyze storage service usage.
  • 通过针对存储服务发出的请求诊断问题。Diagnose issues with requests made against the storage service.
  • 提高使用服务的应用程序的性能。Improve the performance of applications that use a service.

默认为新存储帐户启用存储分析指标。Storage Analytics metrics are enabled by default for new storage accounts. 你可以使用 PowerShell 或 Azure CLI 在 Azure 门户中配置指标。You can configure metrics in the Azure portal, by using PowerShell, or by using the Azure CLI. 有关分步指南,请参阅启用和管理 Azure 存储分析指标(经典)For step-by-step guidance, see Enable and manage Azure Storage Analytic metrics (classic). 还可以通过 REST API 或客户端库以编程方式启用存储分析。You can also enable Storage Analytics programmatically via the REST API or the client library. 使用“获取服务属性”操作为每项服务启用存储分析。Use the Set Service Properties operations to enable Storage Analytics for each service.

备注

存储分析指标可用于 Azure Blob 存储、Azure 队列存储、Azure 表存储以及 Azure 文件。Storage Analytics metrics are available for Azure Blob storage, Azure Queue storage, Azure Table storage, and Azure Files. 存储分析指标现在是经典指标。Storage Analytics metrics are now classic metrics. 建议你使用 Azure Monitor 中的存储指标,而不是存储分析指标。We recommend that you use storage metrics in Azure Monitor instead of Storage Analytics metrics.

事务指标Transaction metrics

对于每个存储服务和请求的 API 操作,将按小时或分钟为间隔记录一组可靠的数据,其中包括入口和出口、可用性、错误和分类请求百分比。A robust set of data is recorded at hourly or minute intervals for each storage service and requested API operation, which includes ingress and egress, availability, errors, and categorized request percentages. 有关事务详细信息的完整列表,请参阅存储分析指标表架构For a complete list of the transaction details, see Storage Analytics metrics table schema.

事务数据在服务级别和 API 操作级别记录。Transaction data is recorded at the service level and the API operation level. 在服务级别,汇总所有请求的 API 操作的统计信息将每小时写入一次表实体,即使未向服务发出请求也是如此。At the service level, statistics that summarize all requested API operations are written to a table entity every hour, even if no requests were made to the service. 在 API 操作级别,仅当在该小时内请求操作时才将统计信息写入实体。At the API operation level, statistics are only written to an entity if the operation was requested within that hour.

例如,如果对 Blob 服务执行 GetBlob 操作,则存储分析指标将记录请求并将其包含在 Blob 服务以及 GetBlob 操作的聚合数据中。For example, if you perform a GetBlob operation on your blob service, Storage Analytics Metrics logs the request and includes it in the aggregated data for the blob service and the GetBlob operation. 如果在一小时内未请求 GetBlob 操作,则不会将实体写入该操作的 $MetricsTransactionsBlob。If no GetBlob operation is requested during the hour, an entity isn't written to $MetricsTransactionsBlob for that operation.

会为用户请求和存储分析本身发出的请求记录事务指标。Transaction metrics are recorded for user requests and requests made by Storage Analytics itself. 例如,存储分析写入日志和表实体的请求会被记录。For example, requests by Storage Analytics to write logs and table entities are recorded.

容量度量值Capacity metrics

备注

目前,容量指标仅适用于 blob 服务。Currently, capacity metrics are available only for the blob service.

每天记录存储帐户的 Blob 服务的容量数据,并写入两个表实体。Capacity data is recorded daily for a storage account's blob service, and two table entities are written. 一个条目提供用户数据的统计信息,另一个条目提供有关存储分析所使用的 $logs Blob 容器的统计信息。One entity provides statistics for user data, and the other provides statistics about the $logs blob container used by Storage Analytics. $MetricsCapacityBlob 表包含以下统计信息:The $MetricsCapacityBlob table includes the following statistics:

  • 容量:存储帐户的 Blob 服务使用的存储量(以字节为单位)。Capacity: The amount of storage used by the storage account's blob service, in bytes.

  • ContainerCount:存储帐户的 Blob 服务中的 blob 容器数。ContainerCount: The number of blob containers in the storage account's blob service.

  • ObjectCount:存储帐户的 Blob 服务中已提交和未提交的块 blob 或页 blob 数量。ObjectCount: The number of committed and uncommitted block or page blobs in the storage account's blob service.

    有关容量指标的详细信息,请参阅存储分析指标表架构For more information about capacity metrics, see Storage Analytics metrics table schema.

如何存储指标How metrics are stored

每个存储服务的所有指标数据都存储在为该服务保留的三个表中。All metrics data for each of the storage services is stored in three tables reserved for that service. 一个表存储事务信息,一个表存储分钟事务信息,还有一个表存储容量信息。One table is for transaction information, one table is for minute transaction information, and another table is for capacity information. 事务和分钟事务信息由请求和响应数据组成。Transaction and minute transaction information consists of request and response data. 容量信息由存储使用情况数据组成。Capacity information consists of storage usage data. 存储帐户的 Blob 服务的小时指标、分钟指标和容量可在按下表所述命名的表中访问。Hour metrics, minute metrics, and capacity for a storage account's blob service is accessed in tables that are named as described in the following table.

指标级别Metrics level 表名Table names 支持的版本Supported for versions
小时指标,主位置Hourly metrics, primary location - $MetricsTransactionsBlob- $MetricsTransactionsBlob
- $MetricsTransactionsTable- $MetricsTransactionsTable
- $MetricsTransactionsQueue- $MetricsTransactionsQueue
仅 2013 年 8 月 15 日之前的版本。Versions prior to August 15, 2013, only. 虽然仍然支持这些名称,但还是建议改用下面列出的表。While these names are still supported, we recommend that you switch to using the tables that follow.
小时指标,主位置Hourly metrics, primary location - $MetricsHourPrimaryTransactionsBlob- $MetricsHourPrimaryTransactionsBlob
- $MetricsHourPrimaryTransactionsTable- $MetricsHourPrimaryTransactionsTable
- $MetricsHourPrimaryTransactionsQueue- $MetricsHourPrimaryTransactionsQueue
- $MetricsHourPrimaryTransactionsFile- $MetricsHourPrimaryTransactionsFile
所有版本。All versions. 仅在 2015 年 4 月 5 日版及更高版本中提供对文件服务指标的支持。Support for file service metrics is available only in version April 5, 2015, and later.
分钟指标,主位置Minute metrics, primary location - $MetricsMinutePrimaryTransactionsBlob- $MetricsMinutePrimaryTransactionsBlob
- $MetricsMinutePrimaryTransactionsTable- $MetricsMinutePrimaryTransactionsTable
- $MetricsMinutePrimaryTransactionsQueue- $MetricsMinutePrimaryTransactionsQueue
- $MetricsMinutePrimaryTransactionsFile- $MetricsMinutePrimaryTransactionsFile
所有版本。All versions. 仅在 2015 年 4 月 5 日版及更高版本中提供对文件服务指标的支持。Support for file service metrics is available only in version April 5, 2015, and later.
小时指标,辅助位置Hourly metrics, secondary location - $MetricsHourSecondaryTransactionsBlob- $MetricsHourSecondaryTransactionsBlob
- $MetricsHourSecondaryTransactionsTable- $MetricsHourSecondaryTransactionsTable
- $MetricsHourSecondaryTransactionsQueue- $MetricsHourSecondaryTransactionsQueue
所有版本。All versions. 必须启用读访问的地域冗余复制。Read-access geo-redundant replication must be enabled.
分钟指标,辅助位置Minute metrics, secondary location - $MetricsMinuteSecondaryTransactionsBlob- $MetricsMinuteSecondaryTransactionsBlob
- $MetricsMinuteSecondaryTransactionsTable- $MetricsMinuteSecondaryTransactionsTable
- $MetricsMinuteSecondaryTransactionsQueue- $MetricsMinuteSecondaryTransactionsQueue
所有版本。All versions. 必须启用读访问的地域冗余复制。Read-access geo-redundant replication must be enabled.
容量(仅限 Blob 服务)Capacity (blob service only) $MetricsCapacityBlob$MetricsCapacityBlob 所有版本。All versions.

为存储服务终结点启用存储分析时,会自动创建这些表。These tables are automatically created when Storage Analytics is enabled for a storage service endpoint. 这些指标可通过存储帐户的命名空间进行访问,例如:https://<accountname>.table.core.chinacloudapi.cn/Tables("$MetricsTransactionsBlob")They're accessed via the namespace of the storage account, for example, https://<accountname>.table.core.chinacloudapi.cn/Tables("$MetricsTransactionsBlob"). 指标表不会显示在列表操作中,必须直接通过表名称进行访问。The metrics tables don't appear in a listing operation and must be accessed directly via the table name.

度量警报Metrics alerts

考虑在 Azure 门户中设置警报,以在存储服务行为发生重要更改时自动通知你。Consider setting up alerts in the Azure portal so you'll be automatically notified of important changes in the behavior of your storage services. 有关分步指南,请参阅创建指标警报For step-by-step guidance, see Create metrics alerts.

如果使用存储资源管理器工具下载这种采用分隔格式的指标数据,则可以使用 Microsoft Excel 分析数据。If you use a Storage Explorer tool to download this metrics data in a delimited format, you can use Microsoft Excel to analyze the data. 有关可用存储资源管理器工具的列表,请参阅 Azure 存储客户端工具For a list of available Storage Explorer tools, see Azure Storage client tools.

重要

在存储事件与记录对应每小时或分钟指标数据的时间之间可能存在延迟。There might be a delay between a storage event and when the corresponding hourly or minute metrics data is recorded. 对于分钟指标,可能会一次写入几分钟的数据。In the case of minute metrics, several minutes of data might be written at once. 此问题可能会导致将前面几分钟的事务聚合到当前分钟的事务中。This issue can lead to transactions from earlier minutes being aggregated into the transaction for the current minute. 发生此问题时,警报服务可能没有已配置警报间隔内的所有可用指标数据,这可能会导致意外触发警报。When this issue happens, the alert service might not have all available metrics data for the configured alert interval, which might lead to alerts firing unexpectedly.

对存储指标计费Billing on storage metrics

为度量值创建表实体的写入请求,按适用于所有 Azure 存储操作的标准费率收费。Write requests to create table entities for metrics are charged at the standard rates applicable to all Azure Storage operations.

客户端针对指标数据的读取和删除请求也按标准费率收费。Read and delete requests of metrics data by a client are also billable at standard rates. 如果已配置数据保留策略,则当 Azure 存储删除旧的指标数据时,不用付费。If you configured a data retention policy, you aren't charged when Azure Storage deletes old metrics data. 但是,如果删除分析数据,则会针对删除操作向帐户收费。If you delete analytics data, your account is charged for the delete operations.

指标表使用的容量也要付费。The capacity used by the metrics tables is also billable. 使用以下信息估算用于存储指标数据的容量:Use the following information to estimate the amount of capacity used for storing metrics data:

  • 如果某个服务每小时都会利用每个服务的每个 API,则在启用服务级别和 API 级别摘要的情况下,每小时约有 148KB 的数据存储在指标事务表中。If each hour a service utilizes every API in every service, approximately 148 KB of data is stored every hour in the metrics transaction tables if you enabled a service-level and API-level summary.
  • 如果某个服务每小时都会利用服务的每个 API,则在仅启用服务级别摘要的情况下,每小时约有 12KB 的数据存储在指标事务表中。If within each hour a service utilizes every API in the service, approximately 12 KB of data is stored every hour in the metrics transaction tables if you enabled only a service-level summary.
  • Blob 的容量表每天添加两行(如果你已为日志选择加入)。The capacity table for blobs has two rows added each day provided you opted in for logs. 这表示,此表的大小每天最多以约 300 字节的幅度增加。This scenario implies that every day the size of this table increases by up to approximately 300 bytes.

后续步骤Next steps