Configure the log sampling rate

Updated at:

By default, Network Analysis samples and uploads logs at a 1% rate. You can adjust this rate.

Prerequisites

The Mobile Analytics component must be integrated. For more information, see Quick Start.

Procedure

  1. Log in to the console. In the left-side navigation pane, choose Mobile Analytics > Log Management > Upload Switch Configuration.

  2. In the list of tracking businesses, find and modify the items named "APM Network Analysis iOS" and "APM Network Analysis Android". These correspond to the seven tracking businesses.

    Tracking ID

    Tracking business name

    mPaaSAPMNetiOS

    APM Network Analysis iOS

    mPaaSMonitorNetiOS

    APM Network Analysis iOS

    mPaaSCustomAPMNetiOS

    APM Network Analysis iOS

    mPaaSAPMOffinePKGiOS

    APM Network Analysis iOS

    mPaaSAPMNetAndroid

    APM Network Analysis Android

    mPaaSCustomAPMNetAndroid

    APM Network Analysis Android

    mPaaSAPMOffinePKGAndroid

    APM Network Analysis Android

  3. In the Actions column, click Modify to open the edit panel, and modify the upload ratio and other settings as needed.

  4. After you finish, click OK.

The following table describes the fields for the tracking configuration.

Parameter

Description

Log header

Corresponds to Field 01 in the log model and is used to identify different log types. The log header for Network Analysis tracking is DF. For more information, see Log tracking overview.

Upload switch

Specifies whether to enable log uploads.

Network

The network conditions for uploads. You can choose to upload tracking logs in all network environments (such as 2G, 3G, 4G, and Wi-Fi) or only on Wi-Fi.

Minimum upload level

Each log has an importance level: 1 (most important), 2 (secondary), and 3 (least important). If you set the minimum upload level to 2, logs with levels 1 and 2 are uploaded, while level 3 logs are not. For iOS apps, you can modify the log level in the client-side code when you implement tracking. For more information, see Add custom event logs.

Log upload ratio

Sets the log upload ratio on a per-user basis. The value is based on a per-mille scale, where 1000 means logs from all users are uploaded.

Log upload count

The client writes tracking logs to local files first. When the number of logs with this business code reaches the specified threshold, the client automatically uploads them to the Mobile Analytics server. For more information, see Upload Logs or Upload Logs.

Policy

If you select the Background Upload policy, the upload timing differs by platform.

  • Android: When the app enters the background and remains there for more than 30 minutes, the client triggers an automatic log upload.

  • iOS: When the app enters the background, the client triggers an automatic log upload immediately. For more information, see Upload Logs or Upload Logs.