+

Search Tips   |   Advanced Search

Data capture

When the MPF Operational Analytics is deployed and the MobileFirst Server is properly configured, data begins to flow from the MobileFirst Server to the MPF Operational Analytics. Some types of data are captured automatically without extra client or server configurations. Some types of data require changes to be made in the client application to capture or forward the data to the MobileFirst Server.


Analytics event types

The following image shows the analytics data flow:

All data that is sent from the MobileFirst Server to the MPF Operational Analytics is categorized by its type. This section briefly describes the different types of analytics data that is captured and analyzed.

App Activities

All IBM MobileFirst Platform Foundation client/server network communication is considered to be an app activity. An app activity is sent to the MPF Operational Analytics when:

  • A client device begins a new session with the MobileFirst Server.

  • A client device makes an adapter request.

When the client communicates with the MobileFirst Server through one of the previously mentioned events, it also sends metadata about the device, including:

  • Device environment (Android, , Windows Phone, and so on).

  • Device model (Nexus, and so on).

  • Device OS version (6.2, 4.2.2, and so on).

Extra information that is captured during a client/network communication includes:

  • Response times for adapter calls.

  • Response payload sizes for adapter calls.

Server Logs

Normal MobileFirst Server activity produces log messages that are saved to the disk. These messages are also forwarded to the MPF Operational Analytics and can be searched.

Client Logs

Client devices can be configured to capture log data and crash events to be forwarded to the MobileFirst Server. See Manually captured data.

Notification Activities

Upon a successful push notification, a notification activity is automatically sent to the MPF Operational Analytics.

No data is sent to the MobileFirst Server until the application is connected to the server. A connection to the server can be achieved by calling WL.Client.connect(). A connection to the server is also done automatically on the first successful call to an adapter in the MobileFirst Server.


Manually captured data

The following data must be captured manually by changing the client application.

Client Logs

The following examples show how to create client logs to be sent to the MPF Operational Analytics.

Hybrid applications (JavaScript):

// Set logging level (default level is FATAL).
WL.Logger.config({level: "DEBUG"});
// Log the message.
WL.Logger.debug("This message is persisted locally until it is sent to the server");
// Call the 'send' method explicitly to send the logs to the MobileFirst Server.
WL.Logger.send();

Native Android applications:

import com.worklight.common.Logger;
 
// Set logging level (default level is FATAL).
Logger.setLevel(LEVEL.DEBUG);
// Create a new instance of the logger and log the message.
Logger logger = Logger.getInstance("MyPackage");
logger.debug("This message is persisted locally until it is sent to the server");
        
// Call the 'send' method explicitly to send the logs to the MobileFirst Server Logger.send();

For more information about capturing client-side logs, see Client-side log capture configuration from the operations console.

All persisted client-side logs are sent automatically upon a successful initialization (successful session start) with the MobileFirst Server. An explicit API is provided to send the logs more frequently.

Client Network Activities

Network activities for client devices are captured and persisted on the device automatically. However, they are only sent when the client successfully initializes with the MobileFirst Server (successful session start).

Analytics Logging

The client-logging feature enables developers to create logs to help debug problems and capture errors. A separate API exists for creating logs not meant for problem detection and capture:

    WL.Analytics.log( object, message );

For example:

    WL.Analytics.log( { "hello": "world" } , "This is an analytics log" );

Logs created by the client-side logger are only captured based on the logging level set. For example, DEBUG logs are not captured when the logging level is set to FATAL. However, logs that are produced by WL.Analytics.log are always captured, despite the current logging level.

The metadata object that is passed into this method is searchable. However the Analytics console does not make further use of the object beyond the custom activities that are shown next. The primary purpose of the metadata object is to allow developers to log custom JSON objects if they wish to export analytics data into their own custom tool.

Custom Activities

The operational analytics console provides a page to view analytics for custom activities. These activities can be created on the client-side by the WL.Analytics API. Using the _activity key in the object for the WL.Analytics call creates a new activity on the server. For example:

    WL.Analytics.log( { "_activity" : "myCustomActivity" } );

creates a new activity in the MPF Operational Analytics that can be searched on the Activities page of the analytics console.

JSONStore Analytics

For more information about configuring the client to send analytics data for JSONStore, see JSONStore analytics.


Client configurations

No additional client configurations are needed for client devices to forward analytics data to the MobileFirst Server.

The Analytics Optional Feature is not required to be enabled on the client for analytics in IBM MobileFirst Platform Foundation v6.3.0.

The analyticsEnabled flag in the initOptions.js file is not required to be enabled on the client for analytics in IBM MobileFirst Platform Foundation v6.3.0.

These configurations are only necessary if you are using the previous analytics platform (IBM SmartCloud Analytics Embedded). If we are using the new IBM MobileFirst Platform Operational Analytics in IBM MobileFirst Platform Foundation v6.3.0, then these properties can be ignored.


Parent topic: Operational analytics