Skip to content
This repository was archived by the owner on Sep 2, 2025. It is now read-only.

Commit b20fb38

Browse files
authored
Merge pull request #2651 from splunk/adasplunk-O11YDOCS-6514
[O11YDOCS-6514] Browser, iOS, Android symbolication: CLI, Webpack, UI doc updates [May 28 release]
2 parents 899eab6 + 864e7d2 commit b20fb38

13 files changed

+780
-48
lines changed

_includes/requirements/ios.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Splunk RUM for Mobile supports the following versions:
22

33
* iOS 15 and higher
4-
* iPadOS 13 and higher
4+
* iPadOS 15 and higher
55

66
Splunk RUM supports Apple Silicon.
Lines changed: 249 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,249 @@
1+
.. _add-mapping-file:
2+
3+
*********************************************************************
4+
Add a mapping file
5+
*********************************************************************
6+
7+
8+
.. meta::
9+
:description: Your uploaded mapping file enables Splunk RUM to convert stack traces back into a human-readable form.
10+
11+
12+
When you set the ``minifyEnabled`` property to true in your Android application source code, your build process minifies, optimizes, and obfuscates the code and generates a single mapping file, ``mapping.txt``. This mapping file contains the information Splunk RUM needs to convert stack traces containing obfuscated classes and filenames back into a human readable form. This conversion is called deobfuscation in Android.
13+
14+
In order to associate a specific mapping file with a specific application build, Splunk RUM compares the ``applicationId`` and ``versionCode`` properties of the application to the parameters that you specify for the mapping file upload. You specify these parameters either as ``--app-id`` and ``--version-code`` in the ``splunk-rum android upload`` command or by including your application's merged or packaged manifest (``AndroidManifest.xml``), which includes these properties by default, in the ``splunk-rum android upload-with-manifest`` command.
15+
16+
17+
.. note::
18+
Splunk recommends that you follow the steps on this page to upload your mapping files to Splunk RUM before you distribute corresponding binaries. To ensure that the mapping files you upload to Splunk RUM match the binaries you deploy to production, the best practice is to integrate the ``splunk-rum`` commands below into your CI pipeline so that whenever you re-build your Android application, you automatically re-upload its mapping file. Alternatively, you can :ref:`upload source maps on demand<mobile-connect-source-files>`.
19+
20+
Splunk RUM stores your mapping files permanently. You cannot delete them from Splunk RUM at this time.
21+
22+
23+
Prerequisites
24+
=====================================================================
25+
26+
* To support de-obfuscation of your application's stack traces, ensure that your ``proguard-rule.pro`` has the following two lines enabled:
27+
28+
.. code-block::
29+
30+
-keepattributes LineNumberTable,SourceFile
31+
-renamesourcefileattribute SourceFile
32+
33+
* Upgrade the following Splunk components:
34+
35+
* :new-page:`splunk-otel-android<https://central.sonatype.com/artifact/com.splunk/splunk-otel-android>`: v1.10.0
36+
37+
* :ref:`Install the splunk-rum CLI<rum-gdi-install-cli>`.
38+
39+
40+
Uploads for production builds
41+
=====================================================================
42+
43+
#. Upload your application's mapping file and specify its ``applicationID`` and ``versionCode`` properties.
44+
45+
You can do this in either of these ways:
46+
47+
* Run the ``upload`` command with the ``--app-id`` and ``--version-code`` parameters:
48+
49+
.. note::
50+
If you didn't set the ``SPLUNK_REALM`` and ``SPLUNK_ACCESS_TOKEN`` environment variables, you must also add the ``--realm <value>`` and ``--token <your-splunk-org-access-token>`` parameters to this command.
51+
52+
.. code-block:: shell
53+
54+
splunk-rum android upload \
55+
--app-id=<applicationID> --version-code=<versionCode> \
56+
--path=<path-to-mapping-file> \
57+
[optional-parameters]
58+
59+
* Run the ``upload-with-manifest`` command with the path to the application's merged or packaged ``AndroidManifest.xml`` file, along with path to the mapping file. Be sure to include the correct manifest, which is the one that's created when your application is built, and is located in the build output directory:
60+
61+
.. note::
62+
If you didn't set the ``SPLUNK_REALM`` and ``SPLUNK_ACCESS_TOKEN`` environment variables, you must also add the ``--realm <value>`` and ``--token <your-splunk-org-access-token>`` parameters to this command.
63+
64+
.. code-block:: shell
65+
66+
splunk-rum android upload-with-manifest \
67+
--manifest <path-to-merged-manifest> \
68+
--path <path-to-mapping-file> \
69+
[optional-parameters]
70+
71+
72+
73+
#. (Optional) Verify that your upload succeeded:
74+
75+
.. code-block:: shell
76+
77+
splunk-rum android list --app-id=<applicationID>
78+
79+
80+
81+
Uploads for pre-production builds
82+
=====================================================================
83+
84+
If you're instrumenting pre-production builds where ``versionCode`` isn't updated for each build, add a unique identifier as metadata to the ``AndroidManifest.xml`` file in your source directory before building the application binary. This identifier must be named ``splunk.build_id``. To add this identifier, follow the steps below:
85+
86+
87+
#. Add this snippet to the ``<application>`` block of the ``AndroidManifest.xml`` file in your source directory:
88+
89+
.. code-block:: xml
90+
91+
<meta-data
92+
android:name="splunk.build_id"
93+
android:value="${splunkBuildId}" />
94+
95+
96+
#. Add the following code to the ``android {}`` block of the Gradle build script of your application. This code generates a new UUID for every application variant and adds it to the merged manifest file after the variant is assembled, where the Splunk RUM agent will retrieve it:
97+
98+
* If you use Kotlin add this to ``build.gradle.kts``:
99+
100+
.. code-block::
101+
102+
applicationVariants.configureEach {
103+
val uniqueBuildId = UUID.randomUUID().toString()
104+
this.mergedFlavor.manifestPlaceholders["splunkBuildId"] = uniqueBuildId
105+
106+
logger.lifecycle("Splunk: Variant $name assigned build ID: $uniqueBuildId")
107+
108+
val capitalizedVariantName = name.replaceFirstChar { it.uppercase() }
109+
tasks.named("process${capitalizedVariantName}Manifest").configure {
110+
outputs.upToDateWhen { false }
111+
}
112+
}
113+
114+
115+
* If you use Groovy add this to ``build.gradle``:
116+
117+
.. code-block::
118+
119+
applicationVariants.configureEach { variant ->
120+
def uniqueBuildId = UUID.randomUUID().toString()
121+
variant.mergedFlavor.manifestPlaceholders.put("splunkBuildId", uniqueBuildId)
122+
123+
project.logger.lifecycle("Splunk: Variant ${variant.name} assigned build ID: ${uniqueBuildId}")
124+
125+
def capitalizedVariantName = variant.name.capitalize()
126+
tasks.named("process${capitalizedVariantName}Manifest").configure {
127+
outputs.upToDateWhen { false }
128+
}
129+
}
130+
131+
132+
#. Upload your application's mapping file and specify its ``applicationID`` , ``versionCode``, and ``splunk.build_id`` properties. You can do this in either of these ways:
133+
134+
* Run the upload command with the ``--app-id``, ``--version-code``, and ``--splunk-build-id`` parameters. This option only works if you added ``splunk.build_id`` to your Gradle build script (in step 1). Get the build ID from the Gradle build output or from the merged manifest:
135+
136+
.. note::
137+
If you didn't set the ``SPLUNK_REALM`` and ``SPLUNK_ACCESS_TOKEN`` environment variables, you must also add the ``--realm <value>`` and ``--token <your-splunk-org-access-token>`` parameters to this command.
138+
139+
.. code-block:: shell
140+
141+
splunk-rum android upload \
142+
--app-id=<applicationID> --version-code=<versionCode> \
143+
--splunk-build-id <value> \
144+
--path=<path-to-mapping-file> \
145+
[optional-parameters]
146+
147+
148+
* Run the ``upload-with-manifest`` command with the path to the application's merged or packaged ``AndroidManifest.xml`` file, along with path to the mapping file. Be sure to include the correct manifest, which is the one that's created when your application is built, and is located in the build output directory:
149+
150+
.. note::
151+
If you didn't set the ``SPLUNK_REALM`` and ``SPLUNK_ACCESS_TOKEN`` environment variables, you must also add the ``--realm <value>`` and ``--token <your-splunk-org-access-token>`` parameters to this command.
152+
153+
.. code-block:: shell
154+
155+
splunk-rum android upload-with-manifest \
156+
--manifest <path-to-merged-manifest> \
157+
--path <path-to-mappping-file> \
158+
[optional-parameters]
159+
160+
161+
#. (Optional) Verify that your upload succeeded:
162+
163+
.. code-block:: shell
164+
165+
splunk-rum android list --app-id=<applicationID>
166+
167+
168+
169+
Syntax
170+
=====================================================================
171+
172+
.. code-block:: shell
173+
174+
splunk-rum android [command] [parameters]
175+
176+
177+
178+
Command descriptions
179+
=====================================================================
180+
181+
.. list-table::
182+
:header-rows: 1
183+
:widths: 20, 80
184+
185+
* - :strong:`Command`
186+
- :strong:`Description`
187+
188+
* - ``upload --path <path> --app-id <value> --version-code <int> [optional-parameters]``
189+
- Upload the mapping file ``mapping.txt`` with the application ID and version code that you specify.
190+
191+
Parameters:
192+
193+
* ``--path <path>`` Required. Path to the ``mapping.txt`` file.
194+
195+
* ``--app-id <applicationID>`` Required. The ``applicationId`` property in your application's ``build.gradle`` file.
196+
197+
* ``--version-code <int>`` Required. The ``versionCode`` property of your application.
198+
199+
* ``--splunk-build-id <value>`` Optional. Splunk build ID for the upload.
200+
201+
* ``--realm <value>`` Optional. Realm for your organization. For example, ``us0``. You can omit this parameter and set the environment variable ``SPLUNK_REALM`` instead.
202+
203+
* ``--token <your-splunk-org-access-token>`` Optional. API access token. You can omit this parameter and set the environment variable ``SPLUNK_ACCESS_TOKEN`` instead.
204+
205+
* ``--dry-run=[true|false]`` Perform a trial run with no changes made. Default: ``false``.
206+
207+
* ``--debug`` Enable debug logs.
208+
209+
* ``-h, --help`` Display help for this command.
210+
211+
212+
* - ``upload-with-manifest --manifest <path> --path <path> [optional-parameters]``
213+
- Upload the Android ``mapping.txt`` file with required metadata extracted from the ``AndroidManifest.xml`` file.
214+
215+
Parameters:
216+
217+
* ``--manifest <path>`` Required. Path to the merged or the packaged ``AndroidManifest.xml`` file that is generated when the application is built.
218+
219+
* ``--path <path>`` Required. Path to the ``mapping.txt`` file.
220+
221+
* ``--realm <value>`` Optional. Realm for your organization. For example, ``us0``. You can omit this parameter and set the environment variable ``SPLUNK_REALM`` instead.
222+
223+
* ``--token <your-splunk-org-access-token>`` Optional. API access token. You can omit this parameter and set the environment variable ``SPLUNK_ACCESS_TOKEN`` instead.
224+
225+
* ``--dry-run=[true|false]`` Preview the file that will be uploaded and the parameters that will be extracted from ``AndroidManifest.xml``.
226+
227+
* ``--debug`` Enable debug logs.
228+
229+
* ``-h, --help`` Display help for command.
230+
231+
232+
* - ``list --app-id <value> [optional-parameters]``
233+
- List the 100 most recently uploaded mapping files for the given application ID, sorted in reverse chronological order based on the upload timestamp.
234+
235+
Parameters:
236+
237+
* ``--app-id <applicationID>`` Required. The ``applicationId`` property in your app's ``build.gradle`` file.
238+
239+
* ``--realm <value>`` Optional. Realm for your organization. For example, ``us0``. You can omit this parameter and set the environment variable ``SPLUNK_REALM`` instead.
240+
241+
* ``--token <your-splunk-org-access-token>`` Optional. API access token. You can omit this parameter and set the environment variable ``SPLUNK_ACCESS_TOKEN`` instead.
242+
243+
* ``--dry-run=[true|false]`` Perform a trial run with no changes made. Default: ``false``.
244+
245+
* ``--debug`` Enable debug logs.
246+
247+
* ``-h, --help`` Display help for this subcommand.
248+
249+

gdi/get-data-in/rum/android/get-android-data-in.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Instrument Android applications for Splunk RUM
1414
Configure the instrumentation <configure-rum-android-instrumentation>
1515
Manually instrument applications <manual-rum-android-instrumentation>
1616
Android RUM data model <rum-android-data-model>
17+
Add a mapping file <add-mapping-file>
1718
Troubleshooting <troubleshooting>
1819

1920
Instrument your Android applications to get Real User Monitoring (RUM) data into Splunk Observability Cloud. With Splunk RUM for Mobile, you can gain insight about the performance and health of your mobile apps.

gdi/get-data-in/rum/android/rum-android-data-model.rst

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,9 +228,16 @@ The Android RUM agent adds the following crash reporting attributes to spans tha
228228
* - ``component``
229229
- String
230230
- Always ``crash``.
231-
* - ``status``
231+
* - ``service.application_id``
232+
- String
233+
- Application ID of the app: Refer to definition of ``applicationId`` in the :new-page:`Android Studio developer documentation <https://developer.android.com/build/configure-app-module#set-application-id>`.
234+
* - ``service.version_code``
232235
- String
233-
- Always ``Error``.
236+
- Version code of the application: Refer to definition of ``versionCode`` in the :new-page:`Android Studio developer documentation <https://developer.android.com/studio/publish/versioning#versioningsettings>`.
237+
* - ``splunk.build_id``
238+
- String
239+
- This is an optional attribute. This is added when minification is enabled for pre-production builds where version code is not updated across app builds, in which case this attribute is used to uniquely identify each build.
240+
234241

235242
Network monitoring
236243
----------------------------------------------------

gdi/get-data-in/rum/browser/get-browser-data-in.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Instrument browser-based web applications for Splunk RUM
1616
Migrate manual instrumentation <migrate-manual-instrumentation>
1717
Data collected <rum-browser-data-model>
1818
Instrumentation-specific data <browser-rum-instrumentations>
19+
Set up JavaScript source mapping <set-up-javascript-source-mapping>
1920
Errors collected <browser-rum-errors>
2021
API reference <browser-rum-api-reference>
2122
Troubleshooting <troubleshooting>

gdi/get-data-in/rum/browser/rum-browser-data-model.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,17 @@ The browser agent sends the IP addresses of all beacon connections to Splunk Obs
229229

230230
.. note:: Splunk Observability Cloud calculates only geographical metadata from the IPs, and drops IP addresses within 6 hours.
231231

232+
233+
Additions to the RUM browser model by splunk-rum
234+
========================================================
235+
If you're using the ``splunk-rum`` CLI or the Webpack build plugin to upload your source map, those tools will add a new attribute named ``error.sourceMapIds`` to your RUM browser data model. This attribute contains a mapping of file URL and ``sourceMapId`` pairs, where:
236+
237+
* You must have already injected the ``sourceMapId`` attribute into your source map (using the ``splunk-rum`` CLI or the Webpack build plugin). See :ref:`set-up-javascript-source-mapping`.
238+
* Only files mentioned in the error's ``error.stack`` appear in ``error.sourceMapIds``.
239+
240+
This attribute is only in your RUM browser data model if you're using the ``splunk-rum`` CLI or the Webpack build plugin.
241+
242+
232243
Instrumentation-specific data
233244
==============================================
234245

0 commit comments

Comments
 (0)