Browser RUM - Setup & Installation Docs | Middleware
Next.js
, skip to the Next.js section. Create New Application
and provide the application name, origin(s) and Trace Propogation Target(s) to whitelist. Multiple origins can be listed as a comma-separated list.
window.Middleware
attribute is set in the script from Step 2.
In the example below, env
and recording
are optional. recording: "1"
is the default value and records the entire user session. To track only browser traces and errors set recording: "0"
.
Middleware.setAttributes
method, as exemplified in the following example.
Step 1: Modify Middleware SDK
tracePropagationTargets
to your SDK from Step 3 of the RUM Installation. The tracePropagationTargets
value must be in regex format.b3
headers. You can change your headers by adding tracePropagationFormat
to change the headers to w3c
or all
. Step 2: Modify APM SDK
OTEL_PROPAGATORS=b3
environment variable. Those languages are called out in the table below. All other langugages will work with the standard APM install.Language | Supported | APM Version | Environment Variable |
Cloudflare | ✖️ | ✖️ | ✖️ |
Go | ✅ | >= 1.1.100 | ✖️ |
Java | ✅ | ✖️ | ✅ |
.NET | ✅ | ✖️ | ✅ |
Next.js | ✅ | ✖️ | ✖️ |
Node.js | ✅ | >= 1.2.5 | ✖️ |
PHP | ✖️ | ✖️ | ✖️ |
Python | ✅ | >= 0.3.2 | ✖️ |
Ruby | ✅ | >= 2.1.0 | ✅ |
Vercel | ✅ | ✖️ | ✖️ |
Function | Returns | Parameters |
---|---|---|
debug(log) | undefined | log (string): The debug message to be logged |
info(log) | undefined | log (string): The informational message to be logged |
warn(log) | undefined | log (string): The warning message to be logged |
error(log) | undefined | log (Object): An Error object |
track(config) | undefined | config (object): Configuration object |
setAttributes(config) | undefined | config (object): Configuration object used to set attributes after the initial configuration with .track() |
Property | Type | Required | Default | Description |
---|---|---|---|---|
projectName | string | ✅ | URL of the application | Main application identifier, encapsulating application instances like dev , staging , and prod |
serviceName | string | ✅ | Associates application instances with traces as a subcategory of the project | |
accountKey | string | ✅ | Generated from Installation -> JavaScript -> Create New Application | |
target | string | ✅ | Target URL for the application using RUM - Required http(s):// prepend | |
env | string | ✖️ | "prod" | Arbitrary string for filtering applications |
recording | string | ✖️ | "1" | Toggle used to enable/disable video recording - "1" enables video recording and "2" disables video recording |
tracePropagationTargets | Array\<RegExp\> | ✖️ | Targets for trace propagation - URL’s of back-end serve as array of regular expression literals (http(s):// must be omitted) | |
tracePropagationFormat | string | ✖️ | "b3" | Trace propogation format |
defaultAttributes | Object\<string, string> | ✖️ | Key value pairs used to filter sessions/traces - name and email filter RUM sessions, while all other keys are arbitrary strings for trace filtering | |
ignoreUrls | Array | ✖️ | URL’s that will be ignored |
Browser Cookies
Script Integration Issues
setTimeout
function:Unable to See Session Recording
Unhandled Promise Rejection: TypeError: Failed to fetch