Skip to content
Hamid edited this page Sep 7, 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: ''
})

domComplete

domComplete is capture using PerformanceTiming API and basically it shows the time that all synchronous resources are loaded that were present in the initial html doc and all sync JS execution are finished and just before the load event is about to be fired. For example a SPA framework (such as Angular) that loads components separately and asynchronously, then the answer is that domComplete does not capture those separate components since a SPA framework usually controls page after the load event is fired.