Azure Cosmos DB 监视数据参考Azure Cosmos DB monitoring data reference

本文提供了对所收集日志和指标数据的引用,用于分析 Azure Cosmos DB 的性能和可用性。This article provides a reference of log and metric data collected to analyze the performance and availability of Azure Cosmos DB. 有关如何为 Azure Cosmos DB 收集和分析监视数据,请参阅监视 Azure Cosmos DB 一文。See the Monitor Azure Cosmos DB article for how to collect and analyze monitoring data for Azure Cosmos DB.

资源日志Resource logs

下表列出了 Azure Cosmos DB 中资源日志的属性。The following table lists the properties of resource logs in Azure Cosmos DB. 将资源日志收集到 Azure Monitor 日志或 Azure 存储。The resource logs are collected into Azure Monitor Logs or Azure Storage. 在 Azure Monitor 中,将日志收集到 MICROSOFT.DOCUMENTDB 资源提供程序下的 AzureDiagnostics 表中。In Azure Monitor, logs are collected in the AzureDiagnostics table under the resource provider** name of MICROSOFT.DOCUMENTDB.

Azure 存储字段或属性Azure Storage field or property Azure Monitor 日志属性Azure Monitor Logs property 说明Description
timetime TimeGeneratedTimeGenerated 操作发生时的日期和时间 (UTC)。The date and time (UTC) when the operation occurred.
resourceIdresourceId 资源Resource 为其启用日志的 Azure Cosmos DB 帐户。The Azure Cosmos DB account for which logs are enabled.
categorycategory 类别Category 对于 Azure Cosmos DB,DataPlaneRequests、MongoRequests、QueryRuntimeStatistics、PartitionKeyStatistics、PartitionKeyRUConsumption、ControlPlaneRequests 是可用的日志类型。For Azure Cosmos DB, DataPlaneRequests, MongoRequests, QueryRuntimeStatistics, PartitionKeyStatistics, PartitionKeyRUConsumption, ControlPlaneRequests are the available log types.
operationNameoperationName OperationNameOperationName 操作的名称。Name of the operation. 操作名称可以是 CreateUpdateReadReadFeedDeleteReplaceExecuteSqlQueryQueryJSQueryHeadHeadFeedUpsertThe operation name can be Create, Update, Read, ReadFeed, Delete, Replace, Execute, SqlQuery, Query, JSQuery, Head, HeadFeed, or Upsert.
propertiesproperties 不适用n/a 下面的行中描述了此字段的内容。The contents of this field are described in the rows that follow.
activityIdactivityId activityId_gactivityId_g 日志记录操作的唯一 GUID。The unique GUID for the logged operation.
userAgentuserAgent userAgent_suserAgent_s 用于指定从中发送请求的客户端用户代理的字符串。A string that specifies the client user agent from which, the request was sent. 用户代理的格式是 {user agent name}/{version}The format of user agent is {user agent name}/{version}.
requestResourceTyperequestResourceType requestResourceType_srequestResourceType_s 所访问资源的类型。The type of the resource accessed. 此值可以是数据库、容器、文档、附件、用户、权限、存储过程、触发器、用户定义的函数或产品/服务。This value can be database, container, document, attachment, user, permission, stored procedure, trigger, user-defined function, or an offer.
statusCodestatusCode statusCode_sstatusCode_s 操作的响应状态。The response status of the operation.
requestResourceIdrequestResourceId ResourceIdResourceId 与请求相关的 resourceId。The resourceId that pertains to the request. 根据执行的操作,此值可能指向 databaseRidcollectionRiddocumentRidDepending on the operation performed, this value may point to databaseRid, collectionRid, or documentRid.
clientIpAddressclientIpAddress clientIpAddress_sclientIpAddress_s 客户端的 IP 地址。The client's IP address.
requestChargerequestCharge requestCharge_srequestCharge_s 操作使用的 RU/s 数目The number of RU/s that are used by the operation
collectionRidcollectionRid collectionId_scollectionId_s 集合的唯一 ID。The unique ID for the collection.
durationduration duration_dduration_d 操作持续时间,以毫秒为单位。The duration of the operation, in milliseconds.
requestLengthrequestLength requestLength_srequestLength_s 请求的长度(按字节计)。The length of the request, in bytes.
responseLengthresponseLength responseLength_sresponseLength_s 响应的长度(按字节计)。The length of the response, in bytes.
resourceTokenUserRidresourceTokenUserRid resourceTokenUserRid_sresourceTokenUserRid_s 资源令牌用于身份验证时,此值非空。This value is non-empty when resource tokens are used for authentication. 值指向用户的资源 ID。The value points to the resource ID of the user.
responseLengthresponseLength responseLength_sresponseLength_s 响应的长度(按字节计)。The length of the response, in bytes.

如需所有 Azure Monitor 日志类别的列表和指向关联架构的链接,请参阅 Azure Monitor 日志类别和架构For a list of all Azure Monitor log categories and links to associated schemas, see Azure Monitor Logs categories and schemas.

指标Metrics

以下各表列出了为 Azure CosmOS DB 收集的平台指标。The following tables list the platform metrics collected for Azure CosmOS DB. 所有指标都存储在“Cosmos DB 标准指标”命名空间中。All metrics are stored in the namespace Cosmos DB standard metrics.

有关所有 Azure Monitor 支持指标(包括 Azure Cosmos DB)的列表,请参阅 Azure Monitor 受支持指标For a list of all Azure Monitor support metrics (including Azure Cosmos DB), see Azure Monitor supported metrics.

请求指标Request metrics

Metric(指标显示名称)Metric (Metric Display Name) Unit(聚合类型)Unit (Aggregation Type) 说明Description 维度Dimensions 时间粒度Time granularities 旧指标映射Legacy metric mapping 使用情况Usage
TotalRequests(请求总数)TotalRequests (Total Requests) Count(计数)Count (Count) 已发出的请求数Number of requests made DatabaseName, CollectionName, Region, StatusCodeDatabaseName, CollectionName, Region, StatusCode 全部All TotalRequests、Http 2xx、Http 3xx、Http 400、Http 401、内部服务器错误、服务不可用、受限制的请求数、每秒平均请求数TotalRequests, Http 2xx, Http 3xx, Http 400, Http 401, Internal Server error, Service Unavailable, Throttled Requests, Average Requests per Second 用于按状态代码、容器监视请求,以分钟为粒度。Used to monitor requests per status code, container at a minute granularity. 若要获取每秒的平均请求数,请在分钟级别使用“计数”聚合并除以 60。To get average requests per second, use Count aggregation at minute and divide by 60.
MetadataRequests(元数据请求数)MetadataRequests (Metadata Requests) Count(计数)Count (Count) 元数据请求的计数。Count of metadata requests. Azure Cosmos DB 为每个帐户维护系统元数据容器,允许你免费枚举集合、数据库及其配置等等。Azure Cosmos DB maintains system metadata container for each account, that allows you to enumerate collections, databases, etc., and their configurations, free of charge. DatabaseName, CollectionName, Region, StatusCodeDatabaseName, CollectionName, Region, StatusCode 全部All 用于监视由于元数据请求而导致的限制。Used to monitor throttles due to metadata requests.
MongoRequests(Mongo 请求数)MongoRequests (Mongo Requests) Count(计数)Count (Count) 已发出的 Mongo 请求数Number of Mongo Requests Made DatabaseName, CollectionName, Region, CommandName, ErrorCodeDatabaseName, CollectionName, Region, CommandName, ErrorCode 全部All Mongo 查询请求速率、Mongo 更新请求速率、Mongo 删除请求速率、Mongo 插入请求速率、Mongo 计数请求速率Mongo Query Request Rate, Mongo Update Request Rate, Mongo Delete Request Rate, Mongo Insert Request Rate, Mongo Count Request Rate 用于监视 Mongo 请求错误以及每个命令类型的使用情况。Used to monitor Mongo request errors, usages per command type.

请求单位指标Request Unit metrics

Metric(指标显示名称)Metric (Metric Display Name) Unit(聚合类型)Unit (Aggregation Type) 说明Description 维度Dimensions 时间粒度Time granularities 旧指标映射Legacy metric mapping 使用情况Usage
MongoRequestCharge(Mongo 请求费用)MongoRequestCharge (Mongo Request Charge) Count(总数)Count (Total) Mongo 已消耗的请求单位Mongo Request Units Consumed DatabaseName, CollectionName, Region, CommandName, ErrorCodeDatabaseName, CollectionName, Region, CommandName, ErrorCode 全部All Mongo 查询请求费用、Mongo 更新请求费用、Mongo 删除请求费用、Mongo 插入请求费用、Mongo 计数请求费用Mongo Query Request Charge, Mongo Update Request Charge, Mongo Delete Request Charge, Mongo Insert Request Charge, Mongo Count Request Charge 用于监视一分钟内的 Mongo 资源 RU。Used to monitor Mongo resource RUs in a minute.
TotalRequestUnits(请求单位总数)TotalRequestUnits (Total Request Units) Count(总数)Count (Total) 已消耗的请求单位Request Units consumed DatabaseName, CollectionName, Region, StatusCodeDatabaseName, CollectionName, Region, StatusCode 全部All TotalRequestUnitsTotalRequestUnits 用于在分钟粒度监视总的 RU 使用量。Used to monitor Total RU usage at a minute granularity. 若要获取每秒平均使用的 RU,请在分钟级别使用“总计”聚合并除以 60。To get average RU consumed per second, use Total aggregation at minute and divide by 60.
ProvisionedThroughput(预配的吞吐量)ProvisionedThroughput (Provisioned Throughput) Count(最大值)Count (Maximum) 以容器粒度预配的吞吐量Provisioned throughput at container granularity DatabaseName、ContainerNameDatabaseName, ContainerName 5M5M 用于监视每个容器的预配吞吐量。Used to monitor provisioned throughput per container.

存储度量值Storage metrics

Metric(指标显示名称)Metric (Metric Display Name) Unit(聚合类型)Unit (Aggregation Type) 说明Description 维度Dimensions 时间粒度Time granularities 旧指标映射Legacy metric mapping 使用情况Usage
AvailableStorage(可用存储空间)AvailableStorage (Available Storage) Bytes(总数)Bytes (Total) 每个区域按 5 分钟粒度报告的可用存储总量Total available storage reported at 5-minutes granularity per region DatabaseName、CollectionName、RegionDatabaseName, CollectionName, Region 5M5M 可用存储Available Storage 用于监视可用存储容量(仅适用于固定存储集合)。最小粒度应当为 5 分钟。Used to monitor available storage capacity (applicable only for fixed storage collections) Minimum granularity should be 5 minutes.
DataUsage(数据用量)DataUsage (Data Usage) Bytes(总数)Bytes (Total) 每个区域按 5 分钟粒度报告的数据总用量Total data usage reported at 5-minutes granularity per region DatabaseName、CollectionName、RegionDatabaseName, CollectionName, Region 5M5M 数据大小Data size 用于在容器和区域级别监视总的数据使用情况,最小粒度应当为 5 分钟。Used to monitor total data usage at container and region, minimum granularity should be 5 minutes.
IndexUsage(索引用量)IndexUsage (Index Usage) Bytes(总数)Bytes (Total) 每个区域按 5 分钟粒度报告的索引总用量Total Index usage reported at 5-minutes granularity per region DatabaseName、CollectionName、RegionDatabaseName, CollectionName, Region 5M5M 索引大小Index Size 用于在容器和区域级别监视总的数据使用情况,最小粒度应当为 5 分钟。Used to monitor total data usage at container and region, minimum granularity should be 5 minutes.
DocumentQuota(文档配额)DocumentQuota (Document Quota) Bytes(总数)Bytes (Total) 每个区域按 5 分钟粒度报告的存储配额总量。Total storage quota reported at 5-minutes granularity per region. DatabaseName、CollectionName、RegionDatabaseName, CollectionName, Region 5M5M 存储容量Storage Capacity 用于在容器和区域级别监视总的配额,最小粒度应当为 5 分钟。Used to monitor total quota at container and region, minimum granularity should be 5 minutes.
DocumentCount(文档计数)DocumentCount (Document Count) Count(总数)Count (Total) 每个区域按 5 分钟粒度报告的文档总数Total document count reported at 5-minutes granularity per region DatabaseName、CollectionName、RegionDatabaseName, CollectionName, Region 5M5M 文档计数Document Count 用于在容器和区域级别监视文档计数,最小粒度应当为 5 分钟。Used to monitor document count at container and region, minimum granularity should be 5 minutes.

延迟指标Latency metrics

Metric(指标显示名称)Metric (Metric Display Name) Unit(聚合类型)Unit (Aggregation Type) 说明Description 维度Dimensions 时间粒度Time granularities 使用情况Usage
ReplicationLatency(复制延迟)ReplicationLatency (Replication Latency) MilliSeconds(最小值、最大值、平均值)MilliSeconds (Minimum, Maximum, Average) 启用了异地复制的帐户的源和目标区域之间的 P99 复制延迟P99 Replication Latency across source and target regions for geo-enabled account SourceRegion、TargetRegionSourceRegion, TargetRegion 全部All 用于监视异地复制帐户在任何两个区域之间的 P99 复制延迟。Used to monitor P99 replication latency between any two regions for a geo-replicated account.
服务器端延迟Server Side Latency 毫秒(平均值)MilliSeconds (Average) 服务器处理请求所用的时间。Time taken by the server to process the request. CollectionName、ConnectionMode、DatabaseName、OperationType、PublicAPIType、RegionCollectionName, ConnectionMode, DatabaseName, OperationType, PublicAPIType, Region 全部All 用来监视 Azure Cosmos DB 服务器上的请求延迟。Used to monitor the request latency on the Azure Cosmos DB server.

可用性指标Availability metrics

Metric(指标显示名称)Metric (Metric Display Name) Unit(聚合类型)Unit (Aggregation Type) 说明Description 时间粒度Time granularities 旧指标映射Legacy metric mapping 使用情况Usage
ServiceAvailability(服务可用性)ServiceAvailability (Service Availability) Percent(最小值、最大值)Percent (Minimum, Maximum) 在一小时粒度内的帐户请求可用性Account requests availability at one hour granularity 1 小时1H 服务可用性Service Availability 表示传递的请求总数百分比。Represents the percent of total passed requests. 如果状态代码为 410、500 或 503,则会认为请求因系统错误而失败。用于按小时粒度监视帐户的可用性。A request is considered to be failed due to system error if the status code is 410, 500 or 503 Used to monitor availability of the account at hour granularity.

Cassandra API 指标Cassandra API metrics

Metric(指标显示名称)Metric (Metric Display Name) Unit(聚合类型)Unit (Aggregation Type) 说明Description 维度Dimensions 时间粒度Time granularities 使用情况Usage
CassandraRequests(Cassandra 请求数)CassandraRequests (Cassandra Requests) Count(计数)Count (Count) 发出的 Cassandra API 请求数Number of Cassandra API requests made DatabaseName、CollectionName、ErrorCode、Region、OperationType、ResourceTypeDatabaseName, CollectionName, ErrorCode, Region, OperationType, ResourceType 全部All 用于按分钟粒度监视 Cassandra 请求。Used to monitor Cassandra requests at a minute granularity. 若要获取每秒的平均请求数,请在分钟级别使用“计数”聚合并除以 60。To get average requests per second, use Count aggregation at minute and divide by 60.
CassandraRequestCharges(Cassandra 请求费用)CassandraRequestCharges (Cassandra Request Charges) Count(合计、最小值、最大值、平均值)Count (Sum, Min, Max, Avg) Cassandra API 已消耗的请求单位数Request units consumed by the Cassandra API DatabaseName、CollectionName、Region、OperationType、ResourceTypeDatabaseName, CollectionName, Region, OperationType, ResourceType 全部All 用于监视 Cassandra API 帐户每分钟使用的 RU。Used to monitor RUs used per minute by a Cassandra API account.
CassandraConnectionClosures(Cassandra 连接关闭次数)CassandraConnectionClosures (Cassandra Connection Closures) Count(计数)Count (Count) 关闭的 Cassandra 连接数Number of Cassandra Connections closed ClosureReason、RegionClosureReason, Region 全部All 用于监视客户端与 Azure Cosmos DB Cassandra API 之间的连接。Used to monitor the connectivity between clients and the Azure Cosmos DB Cassandra API.

另请参阅See Also