-
Notifications
You must be signed in to change notification settings - Fork 135
Home
Hamid edited this page Apr 4, 2018
·
10 revisions
Welcome to the apm-agent-js-base wiki!
Use window.elasticApm.setInitialPageLoadName('page name')
to set the current page name. (Call this method before 'load' event fires)
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
Currently we suggest to activate the agent base on the sampling algorithm, here is an example of sampling 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: ''
})