All Products
Search
Document Center

Application Real-Time Monitoring Service:Integrate a mini program

Last Updated:Oct 28, 2024

The Real User Monitoring (RUM) sub-service of Application Real-Time Monitoring Service (ARMS) allows you to monitor mini programs deployed in mainstream apps, such as Alipay, WeChat, DingTalk, QQ, Douyin, Baidu, and JD.com, and compile mini programs across frameworks such as Taro and uni-app. You can integrate npm packages to collect runtime performance metrics, track exceptions, and improve the user experience of your mini program.

Important

RUM has been available for commercial use since 00:00:00 (UTC +8) on June 24, 2024. For more information, see Billing. To obtain technical support, join the DingTalk group chat (ID: 67370002064).

Procedure

  1. Log on to the ARMS console.

  2. In the left-side navigation pane, choose Real User Monitoring > Application List. In the top navigation bar, select a region.

  3. On the Applications page, click Add Application.

  4. In the Create Application panel, click Mini Program.

  5. In the Mini Program panel, enter the name and description of the mini program, and click Create.

    Note

    The name must be unique.

    Then, an address to which monitoring data is reported (endpoint) and a mini program ID (pid) are automatically generated for the app.

  6. Initialize the OpenRUM SDK.

    To initialize the OpenRUM SDK, use a npm package.

    1. Introduce the npm package.

      npm install @arms/rum-miniapp
    2. Initialize the SDK.

      Note

      Replace the pid and endpoint parameters in the following code with the address and mini program ID obtained from the ARMS console.

      import ArmsRum from '@arms/rum-miniapp';
      ArmsRum.init({
        pid: "your app id",
        endpoint: "your endpint"
      });
  7. Configure the address.

    Add the address to the domain name whitelist of the server.

    Sample address: https://aokcd*****-default-cn.rum.aliyuncs.com

References

The RUM SDK for mini programs of ARMS provides a wide variety of custom configurations to meet your business requirements. For more information, see Sample configurations of the RUM SDK for mini programs.