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 Variable | Example Value | Description |
---|---|---|
MSR_URL | http://msr.127.0.0.1.nip.io | Base URL for MSR backend API endpoints |
IAMS_AAS_URL | http://iams-aas.127.0.0.1.nip.io | Authorization 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 Variable | Example Value | Description |
---|---|---|
LOG_LEVEL | info | Logging level: debug, info, warn, error |
APP_PORT | 8080 | Port for the backend server to listen on |
DATABASE_USER | msr_user | Database username |
DATABASE_PASSWORD | secret | Database password |
DATABASE_HOST | localhost | Database host address |
DATABASE_PORT | 5432 | Database port number |
DATABASE_NAME | msr_db | Name of the database |
DATABASE_SCHEMA | public | Database schema to use |
DATABASE_SSL_MODE | disable | Database connection ssl mode: disable, require, verify-ca, verify-full |
DATABASE_MAX_CONNS | 10 | Maximum number of open database connections |
DATABASE_MAX_IDLE_CONNS | 10 | Maximum number of idle database connections |
DATABASE_MAX_CONN_LIFETIME | 10m | Maximum lifetime of a database connection (e.g., 10m, 1h) |
IAMS_KEYCLOAK_URL | http://iams-keycloak.127.0.0.1.nip.io/realms/aoh | URL of the Keycloak realm for authentication |
Configuration Table
The following configuration is stored in the database for the MSR backend server.
Config key | Example value | Config type | Description |
---|---|---|---|
MAX_PLAYBACK_RANGE | 7 | INTEGER | The maximum number of previous days for which a session can be replayed. |
MAX_ACTIVE_SESSIONS | 5 | INTEGER | The 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. |