KloudMate - Real User Monitori...

Get Started With RUM

12min
this guide will help you set up real user monitoring (rum) in your applications or websites and integrate it with kloudmate to visualize your rum data the rum agent is compatible with all the supported versions of the following browsers google chrome microsoft edge mozilla firefox apple safari chromium based browsers setting up real user monitoring with kloudmate step 1 access api keys log into your kloudmate account, go to settings > workspaces select api keys next to the workspace you want to use note that only a public key can be used for rum step 2 add application origin under the public key , use add host to add the origin of the application/website that you want to instrument with rum step 3 copy public key copy the public key, it will be used to initialize the rum sdk step 4 instrument the application/website add the following code in the '\<head>' section of the application or the website \<script src="https //cdn kloudmate com/rum/js/v0 1 0/otel web js" crossorigin="anonymous">\</script> \<script> kloudmaterum init({ endpoint 'https //otel kloudmate com 4318', rumaccesstoken '\<your km public key>', applicationname 'my app', version '1', deploymentenvironment 'prod', sessionrecorder { enabled true, } }); \</script> while adding the above code to your application/website, ensure that you replace \<your km public key> in the rumaccesstoken field with the public key you copied earlier in step 3 modify the application name, version, and deployment environment fields as needed note that if the session recorder in the above code is set to false the session will not be recorded managing user details 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 }) sdk methods 1\ init(options) initializes the rum sdk options is an object that accepts the following properties property type description applicationname string the application's name endpoint string (required) kloudmate's collector endpoint https //otel kloudmate com 4318 rumaccesstoken string (required) kloudmate workspace's public api key deploymentenvironment string the application's environment example dev, prod, staging version string the applications' version example 0 0 1, 1 globalattributes object key value pairs these attributes will be added to every span sessionrecorder object { 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 2\ setglobalattributes(attributes) parameter type description attributes object key value pairs 3\ getglobalattributes() returns the global attributes related resources what is real user monitoring (rum)? https //docs kloudmate com/what is real user monitoring rum rum interface https //docs kloudmate com/rum interface