Skip to main content
Version: 2.2.0

Configuration

This document outlines the configuration options for the MSR (Multi-Session Replay) module. These settings allow you to customize the behavior of the frontend modlet, backend server, and integration components.

Frontend Modlet Configuration

Environment Variables

Configure the MSR modlet through environment variables in your web-base project's .env file:

Environment VariableExample ValueDescription
MSR_URLhttp://msr.127.0.0.1.nip.ioBase URL for MSR backend API endpoints
IAMS_AAS_URLhttp://iams-aas.127.0.0.1.nip.ioAuthorization service endpoint for MSR authentication

Component Configuration

MultiSessionReplay Component Props

The main replay component accepts the following configuration props:

interface MultiSessionReplayProps {
lobbyTitle: string; // Title shown in lobby screen
lobbyDescription: string; // Description text in lobby
lobbyButtonText: string; // Text for lobby start button
playbackWindowMinutes?: number; // Default playback window (default: 120)
performanceOptions?: MsrPerformanceOptions; // Performance tuning options
blurTargetElement?: HTMLElement; // Element to blur during modals
}

Performance Options Configuration

Fine-tune replay performance for your specific use case:

interface MsrPerformanceOptions {
pollWindowMs?: number; // Time window for fetching CDC data (default: 3000)
frameRate?: number; // Rendering rate in FPS (default: 30)
maxBufferSize?: number; // Max buffered changes (default: 1,000,000)
minPollingInterval?: number; // Min interval between requests (default: 100)
}

Configuration Examples

Basic Component Usage

src/routes/my-replay/+page.svelte
<script>
import { MultiSessionReplay } from '$lib/aoh/msr/components/MultiSessionReplay';
</script>

<MultiSessionReplay
lobbyTitle="System Replay"
lobbyDescription="Review historical system state changes"
lobbyButtonText="Start Replay Session"
playbackWindowMinutes={480}
/>

Performance Optimized Configuration

src/routes/my-replay/+page.svelte
<script>
import { MultiSessionReplay } from '$lib/aoh/msr/components/MultiSessionReplay';

const highPerformanceOptions = {
pollWindowMs: 1000, // Faster polling for high-frequency data
frameRate: 60, // Smooth animation
maxBufferSize: 2000000, // Larger buffer for bursty data
minPollingInterval: 50 // Reduced minimum interval
};
</script>

<MultiSessionReplay
lobbyTitle="Real-time Analysis"
lobbyDescription="High-frequency data replay"
lobbyButtonText="Begin Analysis"
playbackWindowMinutes={60}
performanceOptions={highPerformanceOptions}
/>

Low Resource Configuration

src/routes/my-replay/+page.svelte
<script>
const lowResourceOptions = {
pollWindowMs: 5000, // Slower polling to reduce load
frameRate: 15, // Lower frame rate
maxBufferSize: 500000, // Smaller buffer
minPollingInterval: 200 // Higher minimum interval
};
</script>

<MultiSessionReplay
lobbyTitle="Lightweight Replay"
lobbyDescription="Resource-efficient replay mode"
lobbyButtonText="Start Session"
playbackWindowMinutes={120}
performanceOptions={lowResourceOptions}
/>

Backend Server Environment Variables

Environment Variable

The following environment variables are available for configuring the MSR backend server.

Environment VariableExample ValueDescription
LOG_LEVELinfoLogging level: debug, info, warn, error
APP_PORT8080Port for the backend server to listen on
DATABASE_USERmsr_userDatabase username
DATABASE_PASSWORDsecretDatabase password
DATABASE_HOSTlocalhostDatabase host address
DATABASE_PORT5432Database port number
DATABASE_NAMEmsr_dbName of the database
DATABASE_SCHEMApublicDatabase schema to use
DATABASE_SSL_MODEdisableDatabase connection ssl mode: disable, require, verify-ca, verify-full
DATABASE_MAX_CONNS10Maximum number of open database connections
DATABASE_MAX_IDLE_CONNS10Maximum number of idle database connections
DATABASE_MAX_CONN_LIFETIME10mMaximum lifetime of a database connection (e.g., 10m, 1h)
IAMS_KEYCLOAK_URLhttp://iams-keycloak.127.0.0.1.nip.io/realms/aohURL of the Keycloak realm for authentication

Configuration Table

The following configuration is stored in the database for the MSR backend server.

Config keyExample valueConfig typeDescription
MAX_PLAYBACK_RANGE7INTEGERThe maximum number of previous days for which a session can be replayed.
MAX_ACTIVE_SESSIONS5INTEGERThe maximum number of active sessions allowed at the same time. If the limit is reached, new sessions must wait for a slot to become available.