To able to do distributed tracing using RUM and Java Agent?

Initially, I have used nodejs and Java APM for distributed tracing and this is working fine.
Now I want to add front-end RUM to capture real-time data.
I install RUM using the following command:
npm install @elastic/apm-rum --save
And added configuration in index.js file as:
import { init as initApm } from '@elastic/apm-rum'
const apm = initApm({
serviceName: 'test_rum',
serverUrl: 'http://localhost:8200',

Now, when i start my node code, i get an error message "APM: Platform is not supported!"

Node version: v8.10.0

Hi Praveen,

RUM agent code should be run in the browser and not through Node.js since we don't support that environment. If you can bundle the index.js file and use it run it inside the web page, It will work as expected.

You can try out with script tag if you do not want to build and create bundles for your application.

Let us know if you need help.


But is this article, they show to use RUM as dependency: