Skip to content

v2.0.0

Choose a tag to compare

@srv-gh-o11y-rum srv-gh-o11y-rum released this 19 Jan 14:13
6390a2d

⚠️ Breaking Changes

  • @splunk/otel-web
    • Anonymous User Tracking Enabled by Default #1579
      • Changed the default value of user.trackingMode from noTracking to anonymousTracking
      • The agent now generates a persistent anonymous user ID (_splunk_rum_user_anonymousId) stored via the configured persistence method (default: cookie)
      • This enables:
        • User journey correlation across sessions
        • Issue diagnosis by tracking user behavior patterns
        • Digital experience analytics without identifying individual users
      • Migration: Users who do not want this behavior can explicitly set user.trackingMode: 'noTracking' in their configuration
      • Example:
        SplunkRum.init({
        	realm: 'us0',
        	rumAccessToken: '....',
        	user: {
        		trackingMode: 'noTracking', // Opt out of anonymous tracking
        	},
        })

New Features and Improvements

  • @splunk/otel-web-session-recorder

    • Added Session Replay Sampling #1577
      • Introduced SessionBasedSampler to control the percentage of sessions that get recorded by session recorder

      • SplunkRum takes a ratio of all possible sessions, e.g. 0.8 means 80% of all possible sessions will be sent to the backend

      • SplunkSessionRecorder also takes a ratio of all possible sessions, e.g. 0.02 means that replay will be recorded for the 2% of all possible sessions

      • Note that if you record 20% of the sessions, and you want the replay for 10% of recorded sessions then you need to multiply: 0.2 * 0.1 = 0.02, so the ratio for SplunkRum is 0.2 and the ratio for SplunkSessionRecorder is 0.02

      • We ensure that if the replay is recorded then the session itself is recorded and that the ratios are preserved

      • Example usage:

        // Example 1: Record 30% of all sessions (independent of agent sampling)
        SplunkSessionRecorder.init({
        	realm: 'us0',
        	rumAccessToken: '....',
        	sampler: new SplunkRum.SessionBasedSampler({ ratio: 0.3 }), // records 30% of sessions
        })
        
        // Example 2: If agent samples 80% and you want session recorder to record 20% of ALL sessions
        // (not 20% of the agent-sampled sessions), use:
        SplunkRum.init({
        	realm: 'us0',
        	rumAccessToken: '....',
        	sampler: new SplunkRum.SessionBasedSampler({ ratio: 0.8 }), // agent samples 80%
        })
        SplunkSessionRecorder.init({
        	realm: 'us0',
        	rumAccessToken: '....',
        	sampler: new SplunkRum.SessionBasedSampler({ ratio: 0.2 }), // records 20% of all sessions
        })
        // Result: 20% of all sessions will have session replay
        
        // Example 3: If agent samples 80% and you want session recorder to record 20% of of the agent-sampled sessions, use:
        SplunkRum.init({
        	realm: 'us0',
        	rumAccessToken: '....',
        	sampler: new SplunkRum.SessionBasedSampler({ ratio: 0.8 }), // agent samples 80%
        })
        SplunkSessionRecorder.init({
        	realm: 'us0',
        	rumAccessToken: '....',
        	sampler: new SplunkRum.SessionBasedSampler({ ratio: 0.16 }), // 0.8 * 0.2 = 0.16
        })
        • Bug fixes included:
          • Replay export is now scoped to the current session. This fixes a case where the last chunk from the previous session could be attached to a new session
          • Recording now re-checks sampling when a new session starts, not just on the first page load. This prevents sessions from being skipped when sampling changes across sessions
  • @splunk/otel-web

    • Added Experimental Data Attributes Capture #1537
      • Added __experimental_dataAttributesToCapture config option to capture custom data-* attributes from clicked elements
      • Captured attributes are attached to click and rage click spans
      • Supports both hyphenated and camelCase format for attribute names
      • Example:
        SplunkRum.init({
        	realm: 'us0',
        	rumAccessToken: 'YOUR_TOKEN',
        	applicationName: 'my-app',
        	__experimental_dataAttributesToCapture: [
        		'data-testid', // hyphenated format
        		'track', // camelCase format (looks up data-track)
        		'userName', // camelCase format (looks up data-user-name)
        	],
        })
      • When a button with these attributes is clicked, the span will include:
        • element.dataset.testid: "submit-btn"
        • element.dataset.track: "purchase"
        • element.dataset.userName: "john-doe"
    • Added Page Completion Time (PCT) Metric for SPAs #1536
      • Introduced a new SpaMetricsManager for measuring page load times in Single Page Applications (SPAs)

      • Unlike traditional page load metrics that rely on browser navigation events, this monitors actual resource loading activity to determine when a page has finished loading

      • When enabled, PCT is automatically recorded as the duration of every routeChange span in your application

      • How PCT is calculated:

        • When a user navigates within your SPA (clicking links, tabs, or menu items), the timer starts
        • Monitors all resource loading activity (API calls, images, stylesheets, etc.)
        • Uses a quiet period detection algorithm - waits for a configurable period (default: 5 seconds) with no new resource activity
        • The total time is recorded as the duration of the routeChange span
      • Disabled by default - must be explicitly enabled in configuration

      • How to enable:

        // Option 1: Enable with defaults
        SplunkOtelWeb.init({
        	realm: 'us0',
        	rumAccessToken: 'your-token',
        	applicationName: 'my-spa-app',
        	_experimental_spaMetrics: true,
        })
        
        // Option 2: Enable with custom configuration
        SplunkOtelWeb.init({
        	realm: 'us0',
        	rumAccessToken: 'your-token',
        	applicationName: 'my-spa-app',
        	_experimental_spaMetrics: {
        		quietTime: 3000, // 3 seconds quiet period (default: 5000ms)
        		maxResourcesToWatch: 50, // Limit tracked resources (default: 100)
        		ignoreUrls: [/analytics/], // Additional URLs to ignore
        	},
        })

CDN

Version v2.0.0

background-service.html:
<script src="https://cdn.signalfx.com/o11y-gdi-rum/v2.0.0/background-service.html" integrity="sha384-AggP7sVqXrY0GDAvuN48/FFQQXi88Scvi8I5Xz8RpHHR90ioC4IisE/qJMZhXk2h" crossorigin="anonymous"></script>
splunk-otel-web-session-recorder.js:
<script src="https://cdn.signalfx.com/o11y-gdi-rum/v2.0.0/splunk-otel-web-session-recorder.js" integrity="sha384-tYHVKx02d+Ft+HjVMw07H6R8rT+azHH47m7IR//Tg25B2FHTU4uHe64SDhDodAF2" crossorigin="anonymous"></script>
splunk-otel-web.js:
<script src="https://cdn.signalfx.com/o11y-gdi-rum/v2.0.0/splunk-otel-web.js" integrity="sha384-e2igRFzjYOqVycVNCStQz8ca4wF5qXSPg6kf/wt3HmzrOyl5O4St/UX8VNjZT4j2" crossorigin="anonymous"></script>
Version v2.0

WARNING: Content behind this URL might be updated when we release a new version.
For this reason we do not provide integrity attribute.

background-service.html:
<script src="https://cdn.signalfx.com/o11y-gdi-rum/v2.0/background-service.html" crossorigin="anonymous"></script>
splunk-otel-web-session-recorder.js:
<script src="https://cdn.signalfx.com/o11y-gdi-rum/v2.0/splunk-otel-web-session-recorder.js" crossorigin="anonymous"></script>
splunk-otel-web.js:
<script src="https://cdn.signalfx.com/o11y-gdi-rum/v2.0/splunk-otel-web.js" crossorigin="anonymous"></script>
Version v2

WARNING: Content behind this URL might be updated when we release a new version.
For this reason we do not provide integrity attribute.

background-service.html:
<script src="https://cdn.signalfx.com/o11y-gdi-rum/v2/background-service.html" crossorigin="anonymous"></script>
splunk-otel-web-session-recorder.js:
<script src="https://cdn.signalfx.com/o11y-gdi-rum/v2/splunk-otel-web-session-recorder.js" crossorigin="anonymous"></script>
splunk-otel-web.js:
<script src="https://cdn.signalfx.com/o11y-gdi-rum/v2/splunk-otel-web.js" crossorigin="anonymous"></script>

Version latest

WARNING: Content behind this URL might be updated when we release a new version.
For this reason we do not provide integrity attribute.

background-service.html:
<script src="https://cdn.signalfx.com/o11y-gdi-rum/latest/background-service.html" crossorigin="anonymous"></script>
splunk-otel-web-session-recorder.js:
<script src="https://cdn.signalfx.com/o11y-gdi-rum/latest/splunk-otel-web-session-recorder.js" crossorigin="anonymous"></script>
splunk-otel-web.js:
<script src="https://cdn.signalfx.com/o11y-gdi-rum/latest/splunk-otel-web.js" crossorigin="anonymous"></script>