Skip to content
Hamid edited this page Apr 4, 2018 · 10 revisions

Welcome to the apm-agent-js-base wiki!

setInitialPageLoadName

Use window.elasticApm.setInitialPageLoadName('page name') to set the current page name. (Call this method before 'load' event fires)

What are the out of the box metrics tracked via RUM?

Currently we gather initial page load performance timings (latest version is called navigation timing by W3C) which includes different events in a page life cycle, events from navigation start, fetching the document, parsing the document to executing scripts and up until the load event is fired. MDN docs

How to sample clients?

Currently we suggest to activate the agent based on the sampling algorithm.

Here is an example of activating the agent in 10% of the clients:

var active = Math.random() < 0.1
import { init as initApm } from 'elastic-apm-js-base'
var apm = initApm({
  active:active,
  serviceName: '',
  serverUrl: ''
})
Clone this wiki locally