This page covers how to configure URL segments for resources. To configure page URLs, see Set Custom Page Names.

When the number of segments or the length of a segment exceeds the default maximum, the URL will appear truncated in the Controller UI. For example, the resources shown in the Resource Details tab or the Session Details dialog may display truncated because of the number of URL segments or the length of the segments in the URL.

You can set configurations for the JavaScript Agent that set the maximum number of segments and the maximum number of characters for each segment. This allows you to view more or even less of the resource URLs in the Controller UI.

Segment Definition

A segment is a fragment of a URL. The following constitute one segment:

  • <protocol>://<domain-name>:<port>
  • ?key=value&key=value (query string)
  • #someAnchor (anchor)
  • /file-path/ (file path specified between two forward slashes)

For example, this URL consists of five segments: http://example.com:8090/a/b.html#someAnchor?test=true&segments=5

Truncation Rules and Examples

The maximum number of segments determines how many segments will be displayed in the Controller UI. The last segment will always be shown, and then the first n number of segments until the maximum number is reached. 

For example, if the original URL is http://example.com:8090/a/b.html#someAnchor?test=true&segment=5 and the configured maximum number of segments is 3, then the Controller UI would display the following: http://example.com:8090/a/...?test=true&segment=5

The maximum length of segments determines how many characters of a segment will be displayed in the Controller UI. The truncation rules are slightly more complicated as they depend on the type of segment:

  • For the segment <protocol>://<domain-name>:<port>, the <protocol> and <port> are displayed, and if the remaining amount of the maximum length is greater than the length of <domain-name>, then the entire domain name is displayed. If the remaining amount of the maximum length is less than the length of <domain-name>, then the Controller UI would only display http...8090.
  • For query strings, anchors, and file paths, the first character (?, #, /) is displayed as well as the last n number of characters until the maximum length is reached. For example, for the segment ?test=true&segment=5, if the maximum length is 10, then the segment will be displayed as the following: ?...segment=5

Default Values for Segments

The variable for setting the maximum number of segments to display is maxResUrlSegmentNumber. The variable for setting the maximum length of segments is maxResUrlSegmentLength.

The following are the default values for the two variables:

  • maxResUrlSegmentNumber=10
  • maxResUrlSegmentLength=64

Set the Maximum Number of Segments

The code snippet below sets the maximum number of segments to display at 15.

<head>
    <script type='text/javascript' charset='UTF-8'>
        (function(config){
            config.maxResUrlSegmentNumber = 15;
        })(window['adrum-config'] || (window['adrum-config'] = {}));
    </script>
    <script src='//cdn.appdynamics.com/adrum/adrum-latest.js' type='text/javascript' charset='UTF-8'></script>
    ...
</head>
JS

Set the Maximum Length of Segments

The code snippet below sets the maximum number of characters of segments to display at 100.

<head>
    <script type='text/javascript' charset='UTF-8'>
        (function(config){
            config.maxResUrlSegmentLength = 100;
        })(window['adrum-config'] || (window['adrum-config'] = {}));
    </script>
    <script src='//cdn.appdynamics.com/adrum/adrum-latest.js' type='text/javascript' charset='UTF-8'></script>
    ...
</head>
JS