Session Replay for Mobile RUM (Beta)

Session Replay allows you to monitor user activity within mobile applications by recording interactions such as clicks, scrolls, and navigation. It captures these interactions as dynamic, video-like journeys, along with detailed session metadata. This provides teams with clear insight into the user experience, especially when issues arise. You can watch the session replay to:
  • Optimize the user experience.

  • Debug the errors for application crashes.

  • Diagnose the reasons for application slowness.

Note: Disclaimer:

This documentation mentions a product that is currently only available as an early preview ("Beta"). Splunk AppDynamics reserves the right to change the Beta and its documentation including the content herein, at any time, for any reason, and without notice or compensation to you before making it generally available as well as never making it generally available. This documentation is not a guarantee of future product features and should not be relied upon in making any purchasing decisions. Actual product results may vary from forward-looking statements due to factors including but not limited to: changes in Splunk AppDynamics and third-party technologies, factors related to the economy and target markets, acquisitions of other companies, the hiring and termination of personnel, and other factors. Please refer to the full terms at https://www.splunk.com/en_us/legal/appdynamics-limited-license-agreement.html for details.

Prerequisites

Ensure that the following conditions are met to use Session Replay:
  • Controller >= 25.1

  • EUM Server >= 25.4

  • iOS Agent >= 25.2

  • Android Agent >= 25.2

Log in to the administration console and add the following property to use Session Replay:
  1. Go to Account Settings.

  2. Click Add Property and add session.replay.enabled. Set the value of this property to true.

考慮すべき点:

ベータ段階では、各アカウントは 1 ヵ月あたり最大 20,000 件のセッションリプレイを記録できます。ベータ版が終了したら、アカウントマネージャに問い合わせて、完全な機能をご購入ください。

ストレージはデフォルトで 8 日間に設定されており、ベータ版では延長することはできません。ベータ版が終了したら、拡張ストレージ SKU を購入してストレージを追加できます。

Prerequisites

Ensure that the following conditions are met to use Session Replay:
  • Controller >= 25.1

  • EUM Server >= 25.4

  • iOS Agent >= 25.2

  • Android Agent >= 25.2

Log in to the administration console and add the following property to use Session Replay:
  1. Go to Account Settings.

  2. Click Add Property and add session.replay.enabled. Set the value of this property to true.

Configure the iOS Agent to Report Session Replay

To report Session Replay for your mobile application, you must configure the iOS Agent as follows:
Objective C
PYTHON
#import <ADEumInstrumentation/ADEumInstrumentation.h>
#import "AppDelegate.h"
  
    // ...
    -(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
        ADEumAgentConfiguration *config = [[ADEumAgentConfiguration alloc] initWithAppKey:<#EUM_APP_KEY#>];
        //The default SaaS EUM Server and Screenshot Service are in the Americas,
        // so you can omit the following settings if you are in the Americas.
        config.collectorURL = @"https://<your_region>-col.eum-appdynamics.com";
        config.screenshotURL = @"https://<your_region>-image.eum-appdynamics.com";
        config.sessionReplayURL = @"http(s)://<domain-name>:7001";
        [ADEumInstrumentation initWithConfiguration: config];
        // other tasks
        return YES;
     }
Swift
JAVASCRIPT
#import <ADEumInstrumentation/ADEumInstrumentation.h>
#import "AppDelegate.h"
  
    // ...
     func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        let config = ADEumAgentConfiguration(appKey: <#EUM_APP_KEY#>)
        config.collectorURL = "https://<your_region>.eum-appdynamics.com"
        config.screenshotURL = "https://<your_region>-image.eum-appdynamics.com"
        config.sessionReplayURL = "http(s)://<domain-name>:7001"
        ADEumInstrumentation.initWith(config)
        // other tasks
        return true
    }
// ...

セッションリプレイをレポートするための Android エージェントの設定

モバイルアプリケーションのセッションリプレイをレポートするには、次のように Android エージェントを設定する必要があります。
  1. 以下の方法でエージェントを初期化します。
    • .withSessionReplayEnabled(true)

    • .withBlobServiceURL(configHelper.getSessionReplayUrl())

    PYTHON
    import com.appdynamics.eumagent.runtime.Instrumentation;
    ...
    @Override public void onCreate(Bundle savedInstanceState) {
      Instrumentation.start(AgentConfiguration.builder()
        .withAppKey("<EUM_APP_KEY>")
        .withContext(getApplicationContext())
        // The default SaaS EUM Server and Screenshot Service are in the Americas,
        // so you can omit the following settings if you are in the Americas.
        .withSessionReplayEnabled(true)
        .withBlobServiceURL(configHelper.getSessionReplayUrl()) 
        .build());
      ...
    }
  2. アプリケーション モジュール レベルの build.gradle ファイルで、セッションリプレイ SDK を追加します。
    JSON
    ...
    ...
    repositories {
            maven {
                url = "https://sdk.smartlook.com/android/release"
            }
        }
    ...
    ...
    dependencies {
            implementation 'com.cisco.android:sr-instrumentation-session-recording-core:1.0.12' 
    }

セッションリプレイの有効化

管理者はセッションリプレイのみを有効にできます。選択したモバイルアプリケーションのセッションリプレイを有効にするには、以下のオプションを実行します。
  1. コントローラ UI にログインします。
  2. 対象のモバイルアプリケーションを開きます。
  3. 左のナビゲーションメニューで、[Configuration] を選択します。
  4. [Mobile App Group Configuration.] をクリックします。
  5. [Session Replay] タブで、[Enable Session Replay] を選択します。
    注: Xcode's Main Thread Checker

    デバッグモードで iOS アプリを起動すると、数秒間停止することがあります。セッションリプレイを有効にすると、セッションリプレイが開始し警告が表示されます。この問題は、Xcode のメインスレッドチェッカーの診断によって引き起こされます。

    CODE
    Main Thread Checker: UI API called on a background thread: -[UIView drawViewHierarchyInRect:afterScreenUpdates:]

    この警告は無害であり、iOS エージェントがバックグラウンドで画面をキャプチャしていることが原因で発生します。別の方法(メインスレッドでスクリーンショットをキャプチャする)は、アプリケーション UI の不具合を引き起こす可能性があります。そのため、この方法で実装し、この警告を表示することは、シームレスな記録機能を有効にするために必要なトレードオフです。

    この警告は、デバッグ中にアプリケーションが短時間フリーズする場合にも表示されます。このフリーズは実稼働環境ビルドでは発生せず、メインスレッドチェッカーの Xcode 診断オプションが原因で発生します。

    このオプションは、それぞれの実行スキームの診断オプションでオフにすることができます。詳細については、「メモリ、スレッド、クラッシュの問題の早期診断」の「バックグラウンドセクションの不適切な UI 更新の検出」セクションを参照してください。

セッションリプレイの表示

セッションリプレイでは、複数の録音とユーザーインタラクションが組み合わされています。セッションリプレイを表示するには、以下の手順を実行します。
  1. ユーザー Experience > Mobile Apps に移動します。記録が可能な場合、[セッションリプレイ(Session Replay)] に再生アイコンが表示されます。[セッションリプレイ(Session Replay)] タブを展開します。
  2. セッションリプレイを有効にしたアプリケーションを選択します。
  3. Sessions を選択します。
    記録が可能な場合、Session Replay に再生アイコンが表示されます。
  4. [Session Replay] タブを展開します。
Session Replay は、セッションのアクティブなセグメントを強調表示します。録画またはユーザー アクティビティがない場合は、空白の画面が表示されます。
セッションリプレイの表示中に、以下のアクションを実行できます。
  • 再生速度を調整する。

  • Video モードと Wireframe モードを切り替える。Wireframe モードでは、セッションリプレイは UI レイアウトだけを表示し、テキストはマスクされます。