APM Integration Settings
You can link HTTP requests generated in the browser to backend transactions.
When linked, you can view frontend indicators together with backend and infrastructure performance information, which helps you quickly identify and understand the causes of delays and errors that real users experience.
Requirements
-
An application with WhaTap APM installed is required.
-
You must configure the AJAX request URLs to be linked in the browser monitoring agent.
-
The server providing the HTTP API may need to configure and allow Access-Control-Allow-Headers for the headers below(Important).
Table. Access-Control-Allow-Headers configuration and settings
Info Description x-wtap-po Project information used for MTID tracking x-wtap-mst Transaction information used for MTID tracking x-wtap-sp1 Page URL-related information configuration
Browser Agent Settings
Specify the HTTP request URLs to be traced.
Configure them in the config section of the browser monitoring agent installation script.
-
Register target AJAX URLs as a string array in the installation script option
tracingAjaxUrls. -
You can configure the ratio of multi-transaction generation using
traceSampleRate.<script>
(function (w, h, _a, t, a, b) {
w = w[a] = w[a] || {
config: {
projectAccessKey: "xxxxxxxxxxxxx-xxxxxxxxxxxxx-xxxxxxxxxxxxx",
pcode: 1,
sampleRate: 100,
proxyBaseUrl: "{proxy_base_url}",
traceSampleRate: 50,
tracingAjaxUrls: ['http://dev.whatap.io/yard/api/flush', 'http://devote.whatap.io/', /^https?:\/\/localhost(:\d+)?(\/.*)?$/]
},
};
a = h.createElement(_a);
a.async = 1;
a.src = t;
t = h.getElementsByTagName(_a)[0];
t.parentNode.insertBefore(a, t);
})(window, document, 'script', '${front_rum_url}', 'WhatapBrowserAgent', '');
</script>
Passing the user ID header
If you set traceUserID to true, the agent adds a user ID header to requests that match tracingAjaxUrls and are selected for tracing by traceSampleRate. The default header name is userID. Change it with the traceUserIdHeaderKeyName option. If you change the header name, add the same name to Access-Control-Allow-Headers on the API server.
| Option | Type | Default | Description |
|---|---|---|---|
traceUserID | boolean | false | Adds a user ID header to traced requests |
traceUserIdHeaderKeyName | string | 'userID' | Name of the request header that carries the user ID |
A user ID containing characters that cannot be placed in an HTTP header as is, such as Korean characters or emoji, is encoded with encodeURIComponent before transmission. Decode it on the server with decodeURIComponent to get the same value as the user ID collected by browser monitoring. Browser agent 3.3.1 and later use this method. In earlier versions, requests could fail when a Korean user ID was put in the header.
In the following cases, the agent omits only the user ID header and sends the request as is.
- The encoded value exceeds 200 characters. An ID consisting only of Korean characters reaches this limit at 23 characters.
- The value contains characters that cannot be encoded.
traceUserIdHeaderKeyNameis set to a value that cannot be used as a header name, such as one containing spaces or Korean characters.
-
In the AJAX Hitmap where real-time and historical data can be viewed, check the HTTP requests occurring at the client level.

-
Drag the hitmap to select the analysis range and review the table.

-
You can check AJAX requests generated on the client side by user ID, page URL, AJAX URL, and more, and you can link them to the backend transactions processed in APM.

-
When clicking a node, you can view detailed information about the APM transaction on that screen.

-