Information on how to automatically upload your source maps using the RUM Integration Package can be found here.
Source map files are files commonly used in web development to facilitate the debugging process of minified or transpiled code. When JavaScript or CSS code is minified or transformed into a more compact form for production, it becomes challenging to trace errors back to the original source code due to the loss of meaningful variable names, line numbers, and structure. Source map files address this issue by providing a mapping between the minified code and its original, human-readable source code. This enables developers to debug efficiently by allowing browsers and debugging tools to display accurate error messages and stack traces based on the original code, aiding in the identification and resolution of issues in the development process.
Take advantage of our RUM CLI to easily upload the source maps for your applications to the Coralogix RUM service.
NOTE
The source map folder size limit is 100MB. Please ensure that it does not exceed this limit.
STEP 1. Open a terminal or command prompt.
STEP 2. Run the following command to install the CLI globally:
npm i @coralogix/rum-cli
STEP 3. Once the installation is complete, you can use the CLI by running the coralogix-rum-cli
command in your terminal.
Here are some example commands for using the Coralogix RUM CLI:
coralogix-rum-cli upload-source-maps -k <privateKey> -a <application> -v <version> -f <folderPath> -e <env> -c <commitHash> -n <repoName> -o <orgName>
coralogix-rum-cli upload-source-maps --help
Three options exist for uploading source maps.
When uploading source maps using the RUM CLI, use the following options:
Option | Description |
---|---|
k, --private-key <privateKey> | Your Send-Your-Data API key to authenticate with the Coralogix API. |
a, --application <application> | Name of the application. |
-v, --version <version> | The application version. Must match the version used by the RUM SDK. |
f, --folder-path <folderPath> | Path to the folder containing the source maps. |
e, --env <env> | Your environment. |
c, --commit-hash <commitHash> | GitHub commit hash (optional). |
n, --repo-name <repoName> | GitHub repository name (optional). |
o, --org-name <orgName> | GitHub organization name (optional). |
h, --help | Display help. |
To simplify the process of uploading source maps using the Coralogix RUM CLI, you can create a bash script that automates the task. Follow these steps to set up the script for CI and non-CI integrations.
STEP 1. Create a new file named upload-source-maps.sh
and open it for editing.
STEP 2. Copy and paste the following script into the file, replacing the placeholder values with your actual information:
#! /usr/bin/env bash # Replace these values with your actual information REPO_NAME="your-repo-name" ORG_NAME="your-github-username" APPLICATION="your-application-name" ENV="your-environment" SOURCE_MAPS_PATH="your-source-maps-path" PRIVATE_KEY="your-coralogix-private-key" VERSION="your-application-version" # Get the commit hash using git rev-parse COMMIT_HASH=$(git rev-parse HEAD) # Run Coralogix RUM CLI to upload source maps coralogix-rum-cli upload-source-maps -k "$PRIVATE_KEY" -a "$APPLICATION" -v "$VERSION" -f "$SOURCE_MAPS_PATH" -e "$ENV" -c "$COMMIT_HASH" -n "$REPO_NAME" -o "$ORG_NAME"
IMPORTANT: The $RELEASE_ID
must align with the content of the version field in your CoralogixRum.init()
configuration in Coralogix SDK for Browsers.
STEP 1. Open a terminal window.
STEP 2. Run the following command:
coralogix-rum-cli upload-source-maps -k "$PRIVATE_KEY" -a "$APPLICATION" -v "$VERSION" -f "$SOURCE_MAPS_PATH" -e "$ENV" -c "$COMMIT_HASH" -n "$REPO_NAME" -o "$ORG_NAME"
IMPORTANT: The $VERSION
must align with the content of the version field in your CoralogixRum.init()
configuration in Coralogix SDK for Browsers.
The Coralogix RUM CLI supports the following environments:
Please use the appropriate environment value when specifying the -e, --env option
.
The following options are optional and relate to GitHub information, providing context for source maps:
Option | Description |
---|---|
c, --commit-hash <commitHash> | This option allows you to provide the GitHub commit hash associated with the source maps. Including this hash can help in tracking down issues specific to a particular commit. |
n, --repo-name <repoName> | By specifying the GitHub repository name, you’re indicating the repository where the source code is hosted. This information aids in correlating source maps with the correct repository. |
o, --org-name <orgName> | This option enables you to input your GitHub organization user, helping to attribute the source maps to the appropriate organization user. Providing these GitHub-related options can enhance the accuracy of source map management and issue tracking within Coralogix RUM. However, they are not mandatory and can be omitted if not applicable. |
Documentation | Coralogix Real User Monitoring Coralogix SDK for Browsers |
External Links | Coralogix RUM CLI Library |
Need help?
Our world-class customer success team is available 24/7 to walk you through your setup and answer any questions that may come up.
Feel free to reach out to us via our in-app chat or by sending us an email at [email protected].