WeChat interface
Background
In order to build a more powerful mini-program ecosystem and simplify the difficulty of mini-program development, WeChat officially provides a wealth of API interfaces, including login, payment, code scanning, etc., and these WeChat official interfaces are often very important capabilities. The success or failure directly affects the normal operation of the business. For example, the payment interface may fail due to abnormal WeChat official interface or abnormal merchant order generation system, which may return incorrect payment parameters and cause the payment process to fail. Therefore, it is very necessary to monitor the success rate of WeChat interface calls.
Support status description
Default monitoring interface
By default, the payment interface (requestPayment), code scanning interface (scanCode), and full-screen image preview (previewImage) are automatically monitored. Users only need to use probes with version 1.2.0 or above to automatically obtain data.
Custom monitoring interface
This module can monitor all the Mini Program APIs officially provided by WeChat. Users can monitor the custom interfaces based on their own needs by specifying the interface name they want to monitor through hookApis in the probe initialization configuration (without writing the wx. prefix).
Example (monitoring only the requestPayment interface):
const monitor = require('./agent/tingyun-mp-agent.js');
monitor.config({
...,
hookApis: ['requestPayment']
})
Note:
-
For the
request
interface, it is monitored by a separate request module, and the configuration here will be ignored. -
The number of successes and failures can be monitored only when the custom monitoring interface provides success and fail callbacks, otherwise only the number of calls can be monitored.
Indicator Description
Indicator Name | Indicator Definition |
---|---|
Number of Interface Calls | Number of Interface Calls |
Interface Call Success Rate | (Number of Successful Interface Calls/Total Number of Interface Calls)*100% |
Number of Users Affected by Interface | Number of users who failed to call the interface at least once from the time the user opened the mini program to the time the user actively closed or timed out of the mini program. |
Number of Interface Failed Users | Number of users who failed to call the interface from the time the user opened the mini program to the time the user actively closed or timed out of the mini program, and failed to do so once or multiple times, and did not succeed when leaving. |
Report Description
Interface List
The display list shows the name, number of calls, number of errors, success rate, number of affected users, and number of failed users of the interface, and the interface name and various indicator sorting can be searched.
Interface details
This module displays and analyzes the interface call details, including the interface call success rate trend and the record of each interface call request. You can query the call records based on the userid and IP search.
- Details list
Displays the user details data of the call interface, including three types: success, failure and cancellation.