Application Real-Time Monitoring Service (ARMS) Real User Monitoring (RUM) allows you to monitor mini programs running on Alipay, WeChat, DingTalk, QQ, Douyin, Baidu, and JD.com. Cross-platform frameworks such as Taro and uni-app are also supported. You can integrate npm packages to collect runtime performance metrics, track exceptions, and improve the user experience of your mini program.
RUM has been available for commercial use since June 24, 2024 (00:00:00 UTC+8). For pricing details, see Billing. For technical support, join the DingTalk group chat (ID: 67370002064).
Quick start
Install the SDK and initialize it in your mini program entry file:
npm install @arms/rum-miniappimport ArmsRum from '@arms/rum-miniapp';
ArmsRum.init({
pid: '<your-pid>',
endpoint: '<your-endpoint>',
});Replace <your-pid> and <your-endpoint> with the values generated in the ARMS console. For the full setup procedure, continue with the steps below.
Prerequisites
Before you begin, make sure that you have:
An Alibaba Cloud account with ARMS activated
A mini program project set up locally with npm support
Access to the mini program platform's management console for domain whitelisting
Step 1: Create an application in the ARMS console
Log on to the ARMS console.
In the left-side navigation pane, choose . In the top navigation bar, select a region.
On the Applications page, click Add Application.
In the Create Application panel, click Mini Program.
Enter a name and description for your mini program, then click Create.
NoteThe name must be unique.
After the application is created, ARMS generates two values that you need for SDK initialization:
pid: A unique identifier for your mini program.
endpoint: The URL where the SDK sends monitoring data.
Copy both values. You need them in the next step.
Step 2: Install and initialize the SDK
Mini programs only support npm-based installation.
Install the
@arms/rum-miniapppackage:npm install @arms/rum-miniappInitialize the SDK.
NoteReplace the
pidandendpointparameters in the following code with the values obtained from the ARMS console.Parameter Required Description pidYes Application ID generated by the ARMS console endpointYes Reporting endpoint generated by the ARMS console. Example: https://aokcd*****-default-cn.rum.aliyuncs.comimport ArmsRum from '@arms/rum-miniapp'; ArmsRum.init({ pid: '<your-pid>', // Application ID from the ARMS console endpoint: '<your-endpoint>', // Reporting endpoint from the ARMS console });
Step 3: Add the endpoint to your domain whitelist
Mini program platforms require all network request domains to be registered in a whitelist. Add your ARMS reporting endpoint to the server domain whitelist in your mini program platform's management console.
The endpoint follows this pattern: https://aokcd*****-default-cn.rum.aliyuncs.com
Use the exact endpoint generated for your application in the ARMS console.
See also
RUM SDK configuration options for mini programs: All available SDK configuration options for customizing monitoring behavior.