All Products
Search
Document Center

Application Real-Time Monitoring Service:Upload multiple symbol tables at a time

Last Updated:Sep 30, 2024

The Real User Monitoring (RUM) sub-service of Application Real-Time Monitoring (ARMS) allows you to upload multiple symbol tables at a time to the Object Storage Service (OSS) bucket that RUM provides in the File Management section of the Application Settings page. This way, you can analyze abnormal stack data based on the symbol tables in the exception details.

Prerequisites

Usage notes

  • Use the OSS bucket based on the region where the application resides. The following OSS buckets are available:

    • China (Hangzhou): arms-rum-sourcemap-hz

    • Singapore: arms-rum-sourcemap-sg

    • US (Silicon Valley): arms-rum-sourcemap-usw

  • OSS path: ${uid}/${pid}/${version}/

    Important
    • In an OSS path, uid specifies an Alibaba Cloud account ID, pid specifies an application ID, and version specifies the version of a symbol table.

    • For an iOS app, before you upload a dSYM file to OSS, you must compress it. After the compressed file is uploaded to OSS, RUM automatically parses the UUID from the file.

You can use one of the following methods to upload multiple symbol tables:

ossutil

Important

To use ossutil to upload symbol tables, you must configure access credentials in advance. For more information, see Configure ossutil.

Upload all files from a local directory

Command format:

ossutil cp -r ${localfolder}/ oss://${bucket}/${uid}/${pid}/${version}/

Sample command:

ossutil cp -r localfolder/ oss://arms-rum-sourcemap-hz/1981000187653069/ji7ex7ti31@f1fadb692e6cdc8/1.0.0/

Upload a local file

Command format:

./ossutil64 cp ${examplefile} oss://${bucket}/${uid}/${pid}/${version}/

Sample command:

./ossutil64 cp examplefile.js.map oss://arms-rum-sourcemap-hz/1981000187653069/ji7ex7ti31@f1fadb692e6cdc8/1.0.0/

OSS SDKs

The following example shows how to use OSS SDK for Python to upload a file named examplefile.js.map. The Alibaba Cloud account ID is 1981000187653069, the application ID is ji7ex7ti31@f1fadb692e6cdc8, and the version of the symbol table is 1.0.0.

Execute the following code. For information about how to use RUM SDKs for other languages, see SDK overview.

# -*- coding: utf-8 -*-
import oss2
import os
from oss2.credentials import EnvironmentVariableCredentialsProvider

# Obtain access credentials from environment variables. Before you execute the sample code, make sure that the OSS_ACCESS_KEY_ID and OSS_ACCESS_KEY_SECRET environment variables are configured. 
auth = oss2.ProviderAuth(EnvironmentVariableCredentialsProvider())
# Specify the endpoint of the region in which the bucket is located. For example, if the bucket is located in the China (Hangzhou) region, set the yourEndpoint parameter to https://oss-cn-hangzhou.aliyuncs.com. 
# Specify the name of the bucket. 
bucket = oss2.Bucket(auth, 'https://oss-cn-hangzhou.aliyuncs.com', 'arms-rum-sourcemap-hz')

# The file must be opened in binary mode. 
# Specify the full path of the local file. By default, if you do not specify the full path of the local file, the local file is uploaded from the path of the project to which the sample program belongs. 
key = '1981000187653069/ji7ex7ti31@f1fadb692e6cdc8/1.0.0/'
bucket.put_object_from_file(key + 'examplefile.js.map', 'D:\\localpath\\examplefile.js.map')

CI/CD pipelines

You can integrate CI/CD pipelines into ossutil or OSS SDKs to upload symbol tables to the specified OSS bucket.

Usage notes for uploading dSYM files

Before you upload dSYM files, you must compress them. Assume that you want to upload the AlibabaCloudRUM.framework.dSYM and iOSDemo.app.dSYM files from a directory. Directory structure:

.
├── AlibabaCloudRUM.framework.dSYM
│   └── Contents
│       ├── Info.plist
│       └── Resources
│           ├── DWARF
│           │   └── AlibabaCloudRUM
│           └── Relocations
│               └── aarch64
│                   └── AlibabaCloudRUM.yml
└── iOSDemo.app.dSYM
    └── Contents
        ├── Info.plist
        └── Resources
            ├── DWARF
            │   ├── iOSDemo
            │   └── iOSDemo.txt
            └── Relocations
                └── aarch64
                    └── iOSDemo.yml

Compress the dSYM files into the test.zip file. Commands and output:

» zip -r test.zip *.dSYM                                                    
  adding: AlibabaCloudRUM.framework.dSYM/ (stored 0%)
  adding: AlibabaCloudRUM.framework.dSYM/Contents/ (stored 0%)
  adding: AlibabaCloudRUM.framework.dSYM/Contents/Resources/ (stored 0%)
  adding: AlibabaCloudRUM.framework.dSYM/Contents/Resources/Relocations/ (stored 0%)
  adding: AlibabaCloudRUM.framework.dSYM/Contents/Resources/Relocations/aarch64/ (stored 0%)
  adding: AlibabaCloudRUM.framework.dSYM/Contents/Resources/Relocations/aarch64/AlibabaCloudRUM.yml (deflated 90%)
  adding: AlibabaCloudRUM.framework.dSYM/Contents/Resources/DWARF/ (stored 0%)
  adding: AlibabaCloudRUM.framework.dSYM/Contents/Resources/DWARF/AlibabaCloudRUM (deflated 71%)
  adding: AlibabaCloudRUM.framework.dSYM/Contents/Info.plist (deflated 52%)
  adding: iOSDemo.app.dSYM/ (stored 0%)
  adding: iOSDemo.app.dSYM/Contents/ (stored 0%)
  adding: iOSDemo.app.dSYM/Contents/Resources/ (stored 0%)
  adding: iOSDemo.app.dSYM/Contents/Resources/Relocations/ (stored 0%)
  adding: iOSDemo.app.dSYM/Contents/Resources/Relocations/aarch64/ (stored 0%)
  adding: iOSDemo.app.dSYM/Contents/Resources/Relocations/aarch64/iOSDemo.yml (deflated 89%)
  adding: iOSDemo.app.dSYM/Contents/Resources/DWARF/ (stored 0%)
  adding: iOSDemo.app.dSYM/Contents/Resources/DWARF/iOSDemo.txt (deflated 72%)
  adding: iOSDemo.app.dSYM/Contents/Resources/DWARF/iOSDemo (deflated 72%)
  adding: iOSDemo.app.dSYM/Contents/Info.plist (deflated 52%)

Upload the test.zip file to OSS.

Important

The OSS path must contain the version of the symbol table.

FAQ

Q: What do I do if the HTTP status code 403, the error code AccessDenied, and the error message "You have no right to access this object because of bucket acl." are returned?

A: Check whether the current Alibaba Cloud account has turned on Enable OSS batch upload in the ARMS console. The feature is available only to Alibaba Cloud accounts that turned on the switch. For more information, see the Prerequisites section.