Set up Frontend supportedit

Frontend support is an experimental feature not intended for production usage at the moment.

At the moment the JavaScript Frontend Agent offers experimental frontend support by supporting real user monitoring (rum). Read more about specific features related to experimental real user monitoring.

Example config with frontent support enabled:

apm-server.frontend.enabled: true
apm-server.frontend.rate_limit: 10
apm-server.frontend.allow_origins: ['*']
apm-server.frontend.library_pattern: "node_modules|bower_components|~"
apm-server.frontend.exclude_from_grouping: "^/webpack"
apm-server.frontend.source_mapping.cache.expiration: 5m
apm-server.frontend.source_mapping.index_pattern: "apm-*-sourcemap*"

Configuration optionsedit

enablededit

For enabling frontend support, set the apm-server.frontend.enabled to true. By default this is disabled.

rate_limitedit

Rate limit per second and IP address for requests sent to the frontend endpoint. If the rate limit is hit the APM Server will return an HTTP status code 429. The rate limit cannot be disabled. Ensure to have it set to a number suiting your requirements. Default value is set to 10.

allow_originsedit

Comma separated list of permitted origins for frontend supprt. User-agents send an origin header that will be validated against this list. This is done by default by modern browsers as part of the CORS specification. An origin is made of a protocol scheme, host and port, without the url path. Default value is set to ['*'], which allows everything.

library_patternedit

Configure a regexp to be matched against a stacktrace frame’s file_name and abs_path attributes. If the regexp matches, the stacktrace frame is considered to be a library frame. When source mapping is applied the error.culprit is set to reflect the function and the filename of the first stacktrace frame not considered to be a library frame. This aims to provide an entry point for identifying issues. Default value is "node_modules|bower_components|~".

exclude_from_groupingedit

Configure a regexp to be matched against a stacktrace frame’s file_name. If the regexp matches, the stacktrace frame is excluded from being used for calculating error groups. The default pattern excludes stacktrace frames that have a filename starting with /webpack.

source_mapping.cache.expirationedit

If a source map has been uploaded to the APM Server, source mapping is automatically applied to documents sent to the frontend endpoint. Source maps are fetched from Elasticsearch and then kept in an in-memory cache for the configured time. Values configured without a time unit are treated as seconds. Default value is 5 minutes.

source_mapping.index_patternedit

Source maps are stored in a seperate index apm-%{[beat.version]}-sourcemap by default. If this default is changed, a matching index pattern needs to be specified here. Default value is apm-*-sourcemap*