Record browser sessions
Set up session recording for a browser target.
You must have an enterprise subscription.
You must use Splunk RUM browser agent version 0.23.1 or higher.
- Splunk recorder parameters
Here are the optional parameters that you can set in
SplunkSessionRecorder.init:Parameter Type Description maskAllInputsboolean Show or hide values of input elements in the replay. If set to true, user interaction with inputs is replaced by animation. Default: true.maskAllTextboolean Show or hide text in the replay. If text is hidden, it is replaced by black bars. Default: true.maxExportIntervalMsnumber Time in milliseconds after which you will always get a segment if there is any data. This does not ensure you will always get a segment after that time; at the beginning of the replay, segments are created at a faster pace to ensure they can be sent reliably. Default: 5000.sensitivityRulesarray of SensitivityRuleobjectsSpecific handling of sensitivity rules to mask, unmask, or exclude parts of the page being recorded. Default: [].featuresobject Features to toggle on or off. For default settings, see below. - Splunk recorder's
sensitivityRulesarray The
sensitivityRulesarray gives you fine-grained control over what is recorded. You can mask, unmask, or exclude specific elements on the page from being recorded. Put general rules at the beginning of the array, and more specific rules at the end of the array.Available rule types:
mask: Replace the content of the element with black bars.unmask: Show the content of a masked element.exclude: Exclude the element from the recording. We do not record any interaction with this element; instead, in the replay, we show a DIV element with the same size and position
Parameter Type Description rulestring Type of sensitivity. Valid values: 'mask','unmask','exclude'.selectorstring CSS selector for sensitive elements.
For example:
p.sensitiveselects allpelements withclass="sensitive".ul ~ tableselects all table elements that are siblings of aulelement.
Example:
{ sensitivityRules: [ { rule: 'mask', selector: '.mask-example' }, { rule: 'unmask', selector: '.unmask-example' }, { rule: 'exclude', selector: '.exclude-example' }, ] }- Splunk recorder's
featuresobject The
featuresobject provides a way for you to toggle the following features on or off:Parameter Type Description backgroundServiceSrcstring Link to the published background-service.html. This helps to avoid blocking the main thread during data processing. Default: undefined.canvasboolean When set to true, the canvas is recorded. Default:false.videoboolean When set to true, the video is recorded. Default:false.iframesboolean When set to true, same-origin iframes are recorded. Default:false.packAssetsboolean | object When set to true, includes assets like images, CSS, and fonts in the recording. Otherwise, you will need to use a service like an assets proxy to serve the files from a remote location during playback. You can also specify which type of assets you want to pack by providing a config object. Default:{ styles: true }.cacheAssetsboolean When set to true, any asset (such as images, CSS files, and so on) found on the page will have its URL stored in the local storage cache. This ensures that the asset is not processed multiple times, even after the page is reloaded. Default:false.Example:
{ features: { backgroundServiceSrc: 'https://example.xyz/background-service.html', canvas: true, video: true, iframes: true, packAssets: { fonts: true, images: true, styles: true, }, cacheAssets: true, } }- rr-web migration guide
The Splunk RUM browser agent version 1.0.0 removed
rrweband introduced thesplunkbuilt-in recorder. We've mapped some rr-web parameters to their Splunk recorder alternative, as shown in the table below. This mapping will make your migration from therrwebrecorder toSplunkas seamless as possible.Name Migrated to Migration support Note blockClasssensitivityRulesPartial Cannot migrate regular expressions. blockSelectorsensitivityRulesFull ignoreClasssensitivityRulesPartial Cannot migrate regular expressions maskTextClasssensitivityRulesPartial Cannot migrate regular expressions maskTextSelectorsensitivityRulesFull maskAllInputsmaskAllInputsFull maskInputOptionsNone For security reasons, you must manually migrate this parameter. maskInputFnNone For security reasons, you must manually migrate this parameter. maskTextFnNone For security reasons, you must manually migrate this parameter. inlineStylesheetfeatures.packAssets.stylesFull inlineImagesfeatures.packAssets.imagesFull collectFontsfeatures.packAssets.fontsFull recordCanvas features.canvasFull
<script src="https://cdn.signalfx.com/o11y-gdi-rum/<version>/splunk-otel-web.js" crossOrigin="anonymous"></script>
<script src="https://cdn.signalfx.com/o11y-gdi-rum/<version>/splunk-otel-web-session-recorder.js" crossOrigin="anonymous"></script>
<script>
SplunkRum.init({
realm: 'your-realm',
rumAccessToken: 'your-splunk-rum-token',
applicationName: 'your-app-name',
version: 'your-app-version',
deploymentEnvironment: 'your-environment-name'
});
</script>
<script>
SplunkSessionRecorder.init({
realm: 'your-realm',
rumAccessToken: 'your-splunk-rum-token',
recorder: 'splunk'
});
</script>