Function Monitoring
After creating a function and trigger, you can monitor the real-time invocation and running statuses of the function.
Viewing Function Metrics
FunctionGraph differentiates the metrics of a function by version, allowing you to query the metrics of a specific function version.
Procedure
- Log in to the FunctionGraph console, and choose Functions > Function List in the navigation pane.
- Click the name of the desired function.
- Choose Monitoring > Metrics, select an interval (5 minutes, 15 minutes, or 1 hour), and check the running status of the function.Note
The following metrics are displayed: invocations, errors, duration (maximum, average, and minimum durations), throttles, and instance statistics.
Function metrics
Table 1 describes the function metrics.
Metric | Unit | Description |
---|---|---|
Invocations | Count | Total number of invocation requests, including invocation errors and throttled invocations. In asynchronous invocation mode, the count starts only when a function is executed in response to a request. |
Duration | ms | Maximum Duration: the maximum duration a function is executed within a period. Minimum Duration: the minimum duration a function is executed within a period. Average Duration: the average duration a function is executed within a period. |
Errors | Count | Number of times that your functions failed with error code 200 being returned. Errors caused by function syntax or execution are also included. |
Throttles | Count | Number of times that FunctionGraph throttles your functions due to the resource limit. |
Instance Statistics | N/A | Numbers of concurrent requests and reserved instances. |
Viewing Monitoring Graphs
Create an alarm rule for a function to report metrics to Cloud Eye so that you can view monitoring graphs and alarm messages on the Cloud Eye console.
- Log in to the FunctionGraph console, and choose Functions > Function List in the navigation pane.
- Click the name of the desired function.
- On the displayed function details page, select a function version or alias, and choose Monitoring > Metrics.
- Click Create Alarm Rule.
- In the Create Alarm Rule dialog box, set alarm parameters and click Next.
- Enter a rule name and click OK.
Function Metrics
Table 2 lists the function metrics that can be monitored by Cloud Eye.
Metric | Display Name | Description | Unit | Upper Limit | Lower Limit | Recommended Threshold | Value Type | Dimension |
---|---|---|---|---|---|---|---|---|
count | Invocations | Number of function invocations | Count | - | 0 | - | int | package-functionname |
failcount | Errors | Number of invocation errors | Count | - | 0 | - | int | package-functionname |
rejectcount | Throttles | Number of function throttles | Count | - | 0 | - | int | package-functionname |
duration | Average Duration | Average duration of function invocation | ms | - | 0 | - | int | package-functionname |
maxDuration | Maximum Duration | Maximum duration of function invocation | ms | - | 0 | - | int | package-functionname |
minDuration | Minimum Duration | Minimum duration of function invocation | ms | - | 0 | - | int | package-functionname |
concurrency | Concurrency | The number of requests that can be processed concurrently | N/A | - | 0 | - | int | package-functionname |
payPerUseInstance | Elastic Instances | Number of instances actually used by a function after reserved instances are excluded | N/A | - | 0 | - | int | package-functionname |
failRate | Error Rate | Percentage of errors to the total invocations of a function | % | - | 0 | - | float | package-functionname |
functionErrorCount | Function Error Count | Number of function errors that occur during invocation | Count | - | 0 | - | float | package-functionname |
memoryUsed | Memory | Memory used by the function | MB | - | 0 | - | float | package-functionname |
duration_p500 | Duration (P50) | P50 execution duration of the function | ms | - | 0 | - | float | package-functionname |
duration_p800 | Duration (P80) | P80 execution duration of the function | ms | - | 0 | - | float | package-functionname |
duration_p950 | Duration (P95) | P95 execution duration of the function | ms | - | 0 | - | float | package-functionname |
duration_p990 | Duration (P990) | P990 execution duration of the function | ms | - | 0 | - | float | package-functionname |
duration_p999 | Duration (P999) | P999 execution duration of the function | ms | - | 0 | - | float | package-functionname |
instances | Instances | Number of reserved instances for function invocation. | N/A | - | 0 | - | int | package-functionname |
systemErrorCount | System Errors | Number of system errors that occur during function invocation | Count | - | 0 | - | int | package-functionname |
reservedinstancenum | Reserved Instances | Number of reserved instances | N/A | - | 0 | - | int | package-functionname |
functionCost | Resource Usage | Resources used by the function (Memory x Duration) | MB | - | 0 | - | float | package-functionname |
Querying Logs
After querying the logs of a function version within a specified date range, you can download the logs for further analysis.
- Log in to the FunctionGraph console, and choose Functions > Function List in the navigation pane.
- Click the name of the desired function.
- Select the version or alias of the function, and choose Monitoring > Logs > Request Logs.
- Set the search criteria.
- Enable LTS to facilitate function log management.
- On the Logs tab page, click Enable LTS.
- On the displayed page, click Enable.
- Search for logs by time, request ID, instance ID, or keyword.
Downloading Logs
- Log in to the FunctionGraph console, and choose Functions > Function List in the navigation pane.
- Click the name of the desired function.
- Choose Monitoring > Logs > Request Logs.
- Select a version and time range, and click Download Log.Note
A maximum of 5000 logs can be downloaded at a time. When querying logs, select a proper time range to avoid the loss of logs.
- Viewing Function Metrics
- Viewing Monitoring Graphs
- Querying Logs
- Downloading Logs