Skip to content

Instrumentation Guide

This guide helps you set up Real User Monitoring (RUM) with KloudMate for your websites.

Setting Up Real User Monitoring with KloudMate

Section titled “Setting Up Real User Monitoring with KloudMate”
  • Log in to your KloudMate account.
  • Navigate to the Real User Monitoring page.
  • Click Add New Website in the top-right corner of the RUM module.
  • Enter the URL of the website you want to integrate.
  • Click Continue.

image

  • Add an Application Name, Environment, and Version to identify the integration.
  • Enable or disable Session Recording using the toggle, enabling it records user sessions.
  • Set the Session Sample Rate to decide what percentage of total sessions get recorded.

image

  • Copy the generated script.
  • Paste it into the <head> section of your website.

image

  • To verify installation, click the Verify Installation button, which shows the integration status.
  • To capture the current user’s ID and email, if available, add the following code:
KloudMateRum.setGlobalAttributes({ userId: 'u_123', userEmail: 'john@example.com'})
  • To clear out the user details, for example on user logout, use the following code:
KloudMateRum.setGlobalAttributes({ userId: null, userEmail: null })

Initializes the RUM SDK.

options is an object that accepts the following properties:

PropertyTypeDescription
applicationNamestringThe application’s name.
endpointstring (required)KloudMate’s collector endpoint: https://otel.kloudmate.com:4318
rumAccessTokenstring (required)KloudMate workspace’s Public API key
deploymentEnvironmentstringThe application’s environment. Example: dev, prod, staging
versionstringThe applications’ version. Example: 0.0.1, 1
globalAttributesobjectKey value pairs. These attributes will be added to every span
sessionRecorderobject
{ enabled: boolean, options: RRWebRecordConfig }
Configure session recording. Set enabled to true to record the session. By default session recording is disabled.
ignoreUrls(string | RegExp)[]URLs to ignore
ParameterTypeDescription
attributesobjectKey value pairs.

Returns the global attributes.

Some of the important attributes collected by the RUM SDK

AttributesDescription
serviceNameThe RUM application name.
rumSessionIdThe RUM session’s id
originOrigin of the app instrumented. Eg., https://example.com
routePart of the app’s URL excluding origin and search
searchSearch params of the app’s URL
componentThe instrumentation name that produced the span
eventTypeThe type of user interaction. eg. click, submit etc
userIdUser’s synthetic id
userEmailUser’s email
browserUser’s browser name
browserVersionUser’s browser version
countryUser’s country
cityUser’s city
osUser’s operating system
osVersionUser’s operating system’s version
deviceUser’s device
deviceTypeUser’s device type