JavaScript errors can be reported to the backend (see documentation). To enable this feature, add a custom error handler to the Angular module. See app.module.ts for an implementation. This approach will catch all errors ineum has access to. See the documentation on how to exclude errors and how to integrate errors from third party libraries.
By default, ineum will only catch the first page loading event. For a single page application, subsequent page changes must be reported manually by running
ineum('page', pageName);The easiest way to implement this, is to use NavigationEvents of the Angular router (see instana.service.ts for an implementation for an implementation). Make sure that you do not report secrets to the Instana backend. You can redact secrets from query parameters or exclude entire URLs by using regular expressions.
Page loads have an ID which can be used to correlate activities in the backend manually. Use const pageLoadId = ineum('getPageLoadId'); to get the id (see documentation). Also, see this article on backend correlation for further details.
It is your responsibility to make sure that user tracking is compliant with applicable rules (i.e. GDPR).
There are two ways to track user specific information with Instana EUM:
- track sessions: sessions are started when calling
ineum('trackSessions')and are stopped after a given timeout. In addition they can be stopped manually by runningineum('terminateSession'). See the documentation for details. Sessions do not include user specific information. - set users: users can be individually identified by running
ineum('setUser', ...). You can setuserId,userNameanduserEmail(all optional).
See instana.service.ts for an implementation.
Metadata can be used to annotate page loads and ajax calls. Note that they are added to all subsequent requests (see documentation). Metadata can be set by running ineum('metadata', <key>, <value>) (both, key and value of type string). See instana.service.ts for an implementation.
Events can be reported to the Instana backend by running ineum('reportEvent', <event name>, <event data>). The following data can be associated to the event:
timestamp: defaults to nowduration: in millisecondsbackendTraceId: provide this if the event is related to a trace in the backend (see documentation on how to get this trace id)error: JavaScript error object related to the event (see also error reporting)componentStack: string representing component hierarchymeta: metadata sent along with this event. In contrast to Set Metadata this is only used for this event. The object can only takestringas values.
See Dockerfile
- example on custom backend correlation
- integration of User-Timing API