-
Notifications
You must be signed in to change notification settings - Fork 135
Home
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)
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.
There's also similarSpanThreshold
which sets the threshold to consider a span small enough to be grouped, it is set to 0.05
by default.
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 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: ''
})