Monitoring Android and iOS mobile apps requires a comprehensive approach to provide the best overall visibility of the user experience and quality of the provided service.
- Synthetic monitoring – Use scripted HTTP calls in synthetic tests to monitor the performance and availability of the service that the mobile app depends on.
- Real user monitoring – Use Dynatrace AppMon's Mobile Agent to monitor all user activity in the mobile app.
To collect Synthetic Classic data for a mobile app:
- Identify the API calls and HTTP requests from the mobile app that represent key user activities.
- Create scripts using these APIs and HTTP requests.
- Provision tests to monitor primary user locations.
- Monitor the tests with custom dashboard charts or interactive charts in the Synthetic Classic Portal and with AppMon Web.
Identify APIs and HTTP requests to monitor
Consult with the app developers to identify the API calls and HTTP requests that represent key user activities.
Review the Scripting best practices as you plan the tests for monitoring the key user activities. For example, create a separate test for each user activity so you can more easily identify the specific activity associated with any performance issues.
In the Windows Recorder, use the File > New Script command to manually create scripts. See Using the New Script command for details.
Configure the script profile
Best Practice is to select a Mobile Device profile for monitoring your mobile application.
- Select Mobile Device.
- Click Select device to open the Device Manager.
- Expand the device brand and select the device from the list, then click OK to save the selection and close the Device Manager.
- Click the add button to the right of the Parameters field to add a row for each parameter.
- Type the Name and Default Value for the parameter in the fields.
- The parameters are saved automatically.
Add actions to the script
To add an action to the script timeline:
- Hover over the separator line until it becomes a plus sign .
- Click the plus sign to display the actions list.
- Click the action to add it to the timeline.
For more information, see Editing script actions.
You will typically use these actions to construct a mobile app script:
- HTTP action for the API call or HTTP request.
- Wait action, as needed, for the time needed to complete network activity before executing the next action.
- Validate action as needed to confirm that the user activity was performed successfully.
See the example script, below, for details of defining these actions in your script.
Organize the actions into logical steps with descriptive names. For example, create a new step for each HTTP request, as shown in the example script.
Test the script
Play back the script to make sure the tests you provision will run successfully.
When the script is complete, upload the script to the Synthetic Classic Portal.
This example script consists of two steps: It authenticates the user, and then displays a user-specific dashboard.
The parameters used in the actions are defined in the Parameters tab.
Each HTTP action is configured with the HTTP request.
Note the syntax of the POST statement in the first figure:
- The parameters are identified by the prefix
- Multiple statements can be combined, with a plus sign ( + ) between them.
The Wait actions ensure that network activity is completed before the next action is executed.
In the second step, the Validate action confirms that the dashboard is correctly loaded by checking that the Match Text appears in the page.
After uploading your scripts for the mobile app's key activities, provision tests in the Synthetic Classic Portal. See Adding Performance tests for details.Real user monitoring in Dynatrace AppMon can identify your users' primary locations. Use this information to select the monitoring locations for your synthetic tests.
Configure alerts for effective monitoring
When you provision the tests, configure alerts to support your monitoring goals, for example maintaining consistent performance, meeting SLA targets, ensuring that web pages are correctly displayed, and monitoring the impact of third-party content. For more information, see Getting started with alerting and Types of Performance test alerts.
Monitor and analyze
In the Synthetic Classic Portal, use interactive charts to monitor the synthetic tests.
Use Synthetic test integration for Application Monitoring to view real user data and synthetic data side-by-side in AppMon Web.
Create custom dashboards that combine synthetic and real user data into a total picture of your mobile app's performance and your users' experience.