Skip to content
Hamid edited this page May 25, 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)

groupSimilarSpans

By default the agent tries to group small and similar spans together in order to reduce storage and show most relevant information on the dashboards. Using groupSimilarSpans you can turn off this feature. However we highly recommend to keep this feature enabled, since disabling it might result in too many spans being sent to the server.

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