Custom page load transaction namesedit

A common pattern to name the transactions would be to use the current URL (window.location.href). However, it creates too many unique transactions (blog titles, query strings, etc.) and would be less useful when visualizing the traces in Kibana APM UI.

To overcome this problem, the agent groups the page load transactions based on the current URL. Let’s look at the below example

// Blog Posts - '/blog/:id'

// Documentation - '/guide/en/*'

The page load transaction names for the above URL’s would be inferred automatically and categorized as /blog/:id and /guide/en/* by the agent. The grouping logic in the agent works by recursively traversing the URL path tree until the depth of 2 and converting them to wildcard or slugged matches based on the number of digits, special characters, the mix of upper and lowercase characters in the path. The algorithm uses heuristics that are derived from common patterns in URL’s and therefore, it might not correctly identify matches in some cases.

If the inferred transaction names are not helpful, please set pageLoadTransactionName configuration to something meaningful that groups transactions under the same categories (blog, guide, etc.) and avoid using the full URL at all costs.

import {apm} from '@elastic/apm-rum'

    serviceName: "service-name",
    pageLoadTransactionName: '/homepage'