Keeping up with new mobile-app features has traditionally been a real challenge when relying on manual instrumentation. Automatic instrumentation has proven to be extremely efficient at quickly instrumenting mobile apps—without requiring manual configuration of source code. With auto-instrumentation, you’re guaranteed of instrumenting all of your mobile-app’s new features as they come online. One downside of automatic instrumentation is that, in some cases, automatic detection and naming of user actions and grouping of web requests has been less than optimal. This issue is addressed in the latest release of Dynatrace. Extraction rules that automatically group and aggregate web-request metrics can also now be defined using regular expressions.

Set up user-action naming rules

The mobile application page below shows a typical user action captured by Dynatrace OneAgent. The highlighted AppStart user action represents the startup of the app. The name of the app (easyTravel) is included in parentheses.

user actions

To create naming rules for mobile user actions

  1. Select Applications from the navigation menu.
  2. Select your mobile application.
  3. Click the Browse (…) button.
  4. Click Edit.
  5. Select User actions.
  6. Click the Add naming rule button.

Three types of naming rules are available to clean or extract specific information from your auto-detected mobile user actions and web requests:
Cleanup rules, naming rules, and extraction rules.

user actions

User-action naming example

In this first example, we’ll use a naming rule to rename the auto-generated AppStart (easyTravel) user action to Startup.

The naming rule shown below states that all user action names beginning with the string AppStart are to be renamed and grouped under the name Startup. By clicking the Preview button, the actual incoming stream of user actions is retrieved and the effects of the new rule are displayed for you in a preview further down the page.

user actions

Extraction rule example

Another useful approach to automated user-action naming involves setting up extraction rules via regular expressions. Extraction rules are used to replace variable web-request URL elements (for example, session data, product IDs, or GUIDs) with fixed strings. With variable elements replaced with fixed strings, the resulting web requests can be grouped correctly. In the process, all web request response-time and error-rate metrics can also be aggregated correctly.

To group web requests that have variable elements, and therefore to correctly aggregate all their response time and error rate metrics, it’s necessary to define specific extraction rules, as below. An extraction rule can be defined using a regular expression that selects and replaces the variable part of a URL with a fixed string. In the example below, the variable GUID values following the /feed/ subpath will be replaced with the fixed path /feed/*/. The asterisk symbol (*) is a wildcard that represents all available GUIDs.

As a result of this rule, all calls to the API endpoint /feeds/ will be grouped into a single group.

Variable API endpoints:




Resulting fixed API endpoint:


You can see the results in the Preview this rule section in the example below.