Overview
Loom’s session analytics system tracks user engagement periods to enable release health metrics like crash-free rate and adoption tracking. Uses hybrid storage: individual sessions for recent data (30 days) and hourly aggregates for historical dashboards.Sessions integrate with crash tracking for crashed session detection and analytics for person identity.
Key Features
- Session tracking for web, Node.js, and Rust applications
- Release health metrics: crash-free rate, adoption percentage
- Hybrid storage: individual sessions (30 days) + hourly aggregates (forever)
- Sampling support for high-volume applications
- Real-time updates via SSE for release health changes
Core Concepts
Session
A single user engagement period:Platform Types
Release Health
Computed metrics for a release:Automatic Tracking
Sessions are automatically tracked by the crash SDK:- Rust
- TypeScript (Browser)
- Node.js
Session Lifecycle
Web (Browser)
1
Page Load
Session starts when SDK initializes
2
User Activity
Session remains active while user interacts
3
Tab/Window Close
Session ends via
beforeunload or pagehide event4
Visibility Timeout
If page hidden for 30+ minutes, session ends and new one starts when visible again
Node.js / Rust
1
Process Start
Session starts when crash client initializes
2
Process Exit
Session ends normally on clean shutdown
3
Uncaught Exception
Session marked as
Crashed on unhandled errorSampling
For high-traffic applications, reduce storage with sampling:Sampling Rules
- Base sample rate (e.g., 0.1 = 10%)
- Always store crashed (recommended: true)
- Metrics are automatically adjusted for sample rate
Release Health Metrics
Crash-Free Session Rate
Percentage of sessions without unhandled errors:- Total sessions: 10,000
- Crashed sessions: 50
- Crash-free rate: 99.5%
Crash-Free User Rate
Percentage of users who didn’t experience crashes:- Total users: 1,000
- Users with crashes: 25
- Crash-free user rate: 97.5%
User rate is typically lower than session rate because one user can have multiple sessions.
Adoption Rate
Percentage of traffic on this release:- Release 1.2.3 sessions: 7,500
- All sessions: 10,000
- Adoption rate: 75% (Adopted stage)
API Endpoints
Session Ingestion (SDK)
Start a sessionRequest:
End a sessionRequest:
Release Health (User Auth)
List releases with health metricsQuery Parameters:
environment- Filter by environmentstart_date- Start of time rangeend_date- End of time range
Get detailed health for specific releaseResponse:
Get health trend over timeQuery Parameters:
interval-hour,day,weekstart_date- Start timestampend_date- End timestamp
Session Queries
List recent sessionsQuery Parameters:
release- Filter by releasestatus- Filter by status (active, exited, crashed)limit- Max results (default: 100)
Get session detailResponse:
Real-time Updates (SSE)
Subscribe to release health changes:session.started- New session startedsession.ended- Session endedsession.crashed- Session marked as crashedrelease.health_changed- Release health metrics updated
Aggregation & Retention
Storage Strategy
Individual Sessions
Retention: 30 daysPurpose: Debugging, detailed analysisFull session data with all context
Hourly Aggregates
Retention: ForeverPurpose: Long-term dashboards, trendsRolled-up counts and statistics
Hourly Aggregation
Every hour, individual sessions are aggregated:Metric Definitions
Best Practices
Set Release Version
Always set
release to track health per versionUse semantic versioning or commit SHAUse Sampling
For high-traffic apps, sample normal sessionsCrashed sessions are always stored
Monitor Trends
Track crash-free rate trends over timeAlert on significant drops
Environment Separation
Separate production/staging environmentsMonitor both independently
See Also
Crash Tracking
Investigate crashed sessions
Analytics
Link sessions to person profiles