Monitoring metrics

更新时间:
复制 MD 格式

Function Compute exposes metrics at four dimensions — resource, region, service, and function — so you can track overall usage, diagnose errors, and optimize performance. This topic describes every metric available in each dimension. To monitor a specific metric, specify its name via the MetricName parameter.

To query metrics programmatically via the CloudMonitor API, see Monitoring data.

Resource metrics

View resource metrics in the Resource Usage Statistics section on the Overview page of the Function Compute console.

These metrics show total resource consumption and network traffic across all regions, or within a specific region. All values are summed at a one-day or one-month granularity.

Category Metric name Unit Description
Overview Invocations Count Total number of function invocations.
vCPU usage vCPU Usage vCPU-second vCPU resources consumed during invocations. Calculated as vCPU size × execution duration.
Active vCPU Usage vCPU-second vCPU resources consumed by active instances during invocations. Calculated as vCPU size × execution duration.
Idle vCPU Usage vCPU-second vCPU resources consumed by idle instances. Calculated as vCPU size × idle duration.
Memory usage Memory Usage GB-second Memory consumed during invocations. Calculated as memory size × execution duration.
Disk usage Disk Usage GB-second Disk resources consumed during invocations. Calculated as disk size × execution duration.
GPU usage GPU Usage GB-second GPU resources consumed during invocations. Calculated as GPU size × execution duration.
Active GPU Usage GB-second GPU resources consumed by active instances during invocations. Calculated as GPU size × execution duration.
Idle GPU Usage GB-second GPU resources consumed by idle instances. Calculated as GPU size × idle duration.
Network Outbound Internet Traffic GB Total outbound Internet traffic generated by function executions within the statistical period.

Region-level metrics

In the Function Compute console, go to Advanced Features > Monitoring to view region-level metrics.

These metrics reflect the health and resource usage of all functions within a region. Use them to identify region-wide error spikes, throttling events, and instance capacity. View count-based metrics with the Sum statistic; they are calculated every minute or every hour.

Category Metric name Unit Description
Function executions RegionTotalInvocations Count Total number of function invocations in the region.
Errors RegionServerErrors Count Failed invocations caused by Function Compute server errors. HTTP trigger invocations that return 5xx status codes are not included.
RegionClientErrors Count Invocations that failed or were not executed due to client errors, returning HTTP 4xx status codes. See HTTP 4xx client errors.
RegionFunctionErrors Count Failed invocations caused by function code errors.
Errors due to throttling RegionThrottles Count Failed invocations caused by exceeding the concurrent instance limit, returning HTTP 429.
RegionResourceThrottles Count Failed invocations caused by exceeding the total instance limit, returning HTTP 503.
On-demand instances RegionConcurrencyLimit Count Maximum number of on-demand instances allowed in the region for the current account.
RegionConcurrentCount Count Actual number of on-demand instances concurrently occupied during function invocations.
Provisioned instances RegionProvisionedCurrentInstance Count Total number of provisioned instances created for all functions in the region.

Service-level metrics

In the Function Compute console, go to Advanced Features > Monitoring, then click a service name in the Service Name column.

These metrics break down resource usage by service. Use them to isolate errors or throttling to a specific service. View count-based metrics with the Sum statistic; they are calculated every minute or every hour.

Category Metric name Unit Description
Function executions ServiceTotalInvocations Count Total number of function invocations in the service.
Errors ServiceServerErrors Count Failed invocations caused by Function Compute system errors. HTTP trigger invocations that return 5xx status codes are not included.
ServiceClientErrors Count Invocations that failed or were not executed due to client errors, returning HTTP 4xx status codes. See HTTP 4xx client errors.
ServiceFunctionErrors Count Failed invocations caused by function code errors.
Errors due to throttling ServiceThrottles Count Failed invocations caused by exceeding the concurrent instance limit, returning HTTP 429.
ServiceResourceThrottles Count Failed invocations caused by exceeding the total instance limit, returning HTTP 503.
Provisioned instances ServiceProvisionedCurrentInstance Count Total number of provisioned instances for all functions in the service.

Function-level metrics

In the Function Compute console, go to Advanced Features > Monitoring, click a service name, then click a function in the Function Name section.

For metrics scoped to a function version or alias, the metric name uses the FunctionQualifier prefix — for example, FunctionQualifierTotalInvocations. To monitor CPU utilization, memory usage, and network traffic at the instance level, enable instance-level metrics first.

Invocations

Use invocation metrics to understand the volume and mode of function calls. View these metrics with the Sum statistic.

Metric name Unit Description
FunctionTotalInvocations Count Total invocations in both provisioned and on-demand modes. Summed every minute or every hour.
FunctionProvisionInvocations Count Invocations served by provisioned instances. Summed every minute or every hour.

HTTP status codes

Use HTTP status code metrics to understand the distribution of response outcomes for HTTP-triggered functions. Statistics are calculated at 1-minute, 5-minute, or 1-hour granularity.

Metric name Unit Description
FunctionHTTPStatus2xx Count Invocations that returned a 2XX status code per second.
FunctionHTTPStatus3xx Count Invocations that returned a 3XX status code per second.
FunctionHTTPStatus4xx Count Invocations that returned a 4XX status code per second.
FunctionHTTPStatus5xx Count Invocations that returned a 5XX status code per second.

Errors

Use error metrics to identify failure patterns and their root causes. When FunctionServerErrors or FunctionFunctionErrors spikes, check function invocation logs for details. View these metrics with the Sum statistic; they are calculated every minute or every hour.

Metric name Unit Description
FunctionServerErrors Count Failed invocations caused by Function Compute system errors. HTTP trigger invocations that return 5xx status codes are not included.
FunctionClientErrors Count Invocations that failed or were not executed due to client errors, returning HTTP 4xx status codes. See HTTP 4xx client errors.
FunctionFunctionErrors Count Failed invocations caused by function code errors.

Errors due to throttling

Throttling metrics indicate capacity pressure. If FunctionConcurrencyThrottles (429) is rising, check your concurrency limit. If FunctionResourceThrottles (503) is rising, the total number of instances has exceeded the limit — adjust provisioned instance settings or contact support. View these metrics with the Sum statistic; they are calculated every minute or every hour.

Metric name Unit Description
FunctionConcurrencyThrottles Count Failed invocations caused by exceeding the concurrent instance limit, returning HTTP 429.
FunctionResourceThrottles Count Failed invocations caused by exceeding the total instance limit, returning HTTP 503.

Function execution time

Execution time metrics measure how long your function code runs, excluding platform overhead. Use Average for baseline performance, Max to catch outliers, and P90/P99 for tail latency analysis — P90 means 90% of invocations completed within that duration, and P99 means 99% did.

Metric name Unit Description
FunctionAvgDuration Milliseconds Average execution time across all invocations. Calculated every minute or every hour.
FunctionP90Duration Milliseconds The execution time below which 90% of invocations fall. Calculated at specific granularities.
FunctionP99Duration Milliseconds The execution time below which 99% of invocations fall. Calculated at specific granularities.
FunctionMaxDuration Milliseconds Maximum execution time across all invocations. Calculated every minute or every hour.

End-to-end latency

End-to-end latency covers the full request lifecycle — from when a request arrives at Function Compute to when it leaves, including all platform overhead. Compare FunctionLatencyAvg with FunctionAvgDuration to quantify platform overhead.

Metric name Unit Description
FunctionLatencyAvg Milliseconds Average end-to-end latency per invocation, including platform time. Calculated every minute or every hour.

Memory usage

Memory metrics help you right-size your function configuration. If FunctionMaxMemoryUsage consistently approaches FunctionMemoryLimitMB, increase the memory limit to avoid out-of-memory (OOM) errors. All metrics are calculated every minute or every hour.

Metric name Unit Description
FunctionMemoryLimitMB MB Memory limit for the function. Exceeding this limit causes an OOM error.
FunctionMaxMemoryUsage MB Peak memory consumed across all instances during function executions.

On-demand instances

Metric name Unit Description
FunctionOndemandInstanceQuota Count Maximum number of on-demand instances allowed for the function. Not displayed if no limit is configured.
FunctionOndemandActiveInstance Count Number of on-demand instances currently occupied during invocations.

Provisioned instances

Metric name Unit Description
FunctionProvisionedCurrentInstance Count Number of provisioned instances currently occupied during function executions.

Asynchronous invocations

Use these metrics to monitor async queue health. FunctionEnqueueCount tracks incoming requests and FunctionDequeueCount tracks processed requests — a growing gap between the two indicates a backlog. When FunctionAsyncMessagesBacklogV2 is greater than 0, adjust your provisioned instance settings or contact support. See Configure provisioned instances and auto scaling rules. All metrics are summed every minute or every hour.

Metric name Unit Description
FunctionEnqueueCount Count Number of requests enqueued for asynchronous processing.
FunctionDequeueCount Count Number of asynchronous requests processed (dequeued).
FunctionAsyncMessagesBacklogV2 Count Total number of pending requests in the async queue.
FunctionAsyncMessagesInProcess Count Approximate number of asynchronous requests currently being processed.

Latency of asynchronous messages

Message latency measures how long requests wait in the async queue before being processed. Rising latency combined with increasing FunctionAsyncMessagesBacklogV2 confirms a backlog.

Metric name Unit Description
FunctionAsyncMessageLatencyAvg Milliseconds Average time between when an async request is enqueued and when it is processed. Calculated every minute or every hour.
FunctionAsyncMessageLatencyMax Milliseconds Maximum time between when an async request is enqueued and when it is processed. Calculated every minute or every hour.

Events triggered during asynchronous invocations

Metric name Unit Description
FunctionAsyncEventExpiredDropped Count Requests dropped because they expired before processing when a destination is configured. Summed every minute or every hour.
FunctionDestinationErrors Count Requests that failed to trigger the configured destination service during function execution. Summed every minute or every hour.
FunctionDestinationSucceeded Count Requests that successfully triggered the configured destination service during function execution. Summed every minute or every hour.

Concurrent requests (instance-level metrics)

These metrics require instance-level metrics to be enabled.

Metric name Unit Description
FunctionMaxConcurrentRequests Count Maximum number of requests concurrently executed within function instances. Calculated every minute or every hour.
FunctionAvgConcurrentRequests Count Average number of requests concurrently executed within function instances. Calculated every minute or every hour.

vCPU usage (instance-level metrics)

These metrics require instance-level metrics to be enabled. Use FunctionMaxvCPUUtilization and FunctionAvgvCPUUtilization together — sustained high averages with occasional peaks suggest your vCPU quota needs adjustment.

Metric name Unit Description
FunctionvCPUQuotaCores vCPU vCPU quota configured for the function.
FunctionMaxvCPUCores vCPU Maximum vCPU count used by function instances (1 = 1 vCPU). Collected every minute or every hour.
FunctionAvgvCPUCores vCPU Average vCPU count used by function instances (1 = 1 vCPU). Collected every minute or every hour.
FunctionMaxvCPUUtilization % Maximum ratio of vCPUs used to the vCPU quota. Collected every minute or every hour.
FunctionAvgvCPUUtilization % Average ratio of vCPUs used to the vCPU quota. Collected every minute or every hour.

Memory usage (instance-level metrics)

These metrics require instance-level metrics to be enabled. If FunctionMaxMemoryUsageMB approaches FunctionMemoryLimitMB, increase the memory limit to prevent OOM errors.

Metric name Unit Description
FunctionMemoryLimitMB MB Memory limit for the function. Exceeding this limit causes an OOM error.
FunctionMaxMemoryUsageMB MB Peak memory used across all function instances. Calculated every minute or every hour.
FunctionAvgMemoryUsageMB MB Average memory used across all function instances. Calculated every minute or every hour.
FunctionMaxMemoryUtilization % Maximum ratio of memory used to the memory limit across all instances. Collected every minute or every hour.
FunctionAvgMemoryUtilization % Average ratio of memory used to the memory limit across all instances. Collected every minute or every hour.

Network traffic (instance-level metrics)

These metrics require instance-level metrics to be enabled.

Metric name Unit Description
FunctionRXBytesPerSec Mbit/s Inbound network traffic of the function per unit time.
FunctionTXBytesPerSec Mbit/s Outbound network traffic of the function per unit time.

GPU memory usage (instance-level metrics)

These metrics require instance-level metrics to be enabled and apply to GPU-enabled functions only.

Metric name Unit Description
FunctionGPUMemoryLimitMB MB GPU memory quota for the function.
FunctionGPUMaxMemoryUsage MB Amount of GPU memory currently in use.
FunctionGPUMemoryUsagePercent % GPU memory utilization.

GPU utilization (instance-level metrics)

These metrics require instance-level metrics to be enabled and apply to GPU-enabled functions only.

Metric name Unit Description
FunctionGPUSMPercent % Streaming multiprocessor (SM) utilization.
FunctionGPUEncoderPercent % Hardware encoder utilization.
FunctionGPUDecoderPercent % Hardware decoder utilization.

HTTP 4xx client errors

The following HTTP 4xx status codes appear in RegionClientErrors, ServiceClientErrors, and FunctionClientErrors:

Status code Cause
400 Invalid parameters.
403 Invalid permissions.
404 Resource not found.
412 Precondition failed — for example, the function instance failed to start in a custom runtime.
499 Client closed the connection before the response was sent.

For a full list of error codes, see Public error codes.

For 412 and 499 errors where function execution has already started, logs are generated and billing begins. View the logs in the invocation request list. See View function invocation logs.