Path segment rules

Raygun Real User Monitoring and APM collects URL path information for all requests that are made as users navigate around your website and perform actions.

Due to the use of REST routes and other schemes, it is common for duplicate pages to be created by default when they are the same view or endpoint. Path segment rules are a way to group these duplicate URLs together using wildcards.

Alternatively, if you find Raygun is automatically grouping two different views or endpoints together you can also setup ungrouping rules that will ungroup URLs based on the specified wildcard.

Example

A common web forum will have multiple URLs. One being http://foo.com/thread/1 and another like http://foo.com/thread/2. These two urls can show up as two seperate Pages inside Real User Monitoring when really they are two instances of the same thread.

note: Path segment rules currently only apply to our Real User Monitoring and APM products and Page URLs cannot be changed once they have been ingested.


By default our products will replace both integer path segments and DateTime strings with the wildcard character *. Meaning the following urls would be grouped as http://foo.com/thread/*

  • http://foo.com/thread/10
  • http://foo.com/thread/28
  • http://foo.com/thread/34

To create a new path segment grouping or ungrouping rule or to remove ones no longer needed, head over to the "General" section inside the "Application settings" area.

Here you will find the path segment module:

Path segment settings module

note: Rule changes can take up to 10 minutes to be reflected by new pages sent to Raygun.


Grouping rules enable you to add your own path segment wildcards (the * symbol) to match your routing scheme. You can have as many grouping rules as you need.

tip: Rules are saved whenever the 'Add URL' or the delete button is clicked.

A grouping rule of https://foo.com/forum/* will group any of the following page visits:

  • /forum/foo
  • /forum/bar
  • /forum/foo/bar

A more specific rule of https://foo.com/forum/*/delete will group any of the following:

  • /forum/foo/delete
  • /forum/bar/delete

A grouping rule of *://cdn.foo.*/js/* will group any of the following requested assets:

  • http://cdn.foo.io/js/123/bundle.min.js
  • https://cdn.foo.com/js/123/legacy-bundle.min.js
  • http://cdn.foo.io/js/456/bundle.min.js
  • https://cdn.foo.com/js/456/legacy-bundle.min.js
  • https://cdn.foo.com/js/lodash.min.js

as *://cdn.foo.*/js/*.js; note how the file extension is appended to the wildcard.

If you would like to ignore file extensions, simply add another asterisk to the end of the wildcard.
Eg. *://cdn.foo.*/js/**

A more specific rule of https://cdn.foo.com/js/123/* will group any of the following requested assets:

  • https://cdn.foo.com/js/123/bundle.min.js
  • https://cdn.foo.com/js/123/legacy-bundle.min.js

Use the < symbol to reduce the length of a URL.

A grouping rule of https://foo.com/forum/< will reduce the following:

  • https://foo.com/forum/foo/123/bar/delete
  • https://foo.com/forum/bar/456/foo/add
  • https://foo.com/forum/foo/789/bar/

This can be helpful when trying to group particularly large URLs.

Execution order

Requests are tested against rules which are at the top of the list first. The first rule which matches a given page is applied.

In the page requests example, if the rule https://foo.com/forum/* was added before https://foo.com/forum/*/delete, all pages would appear under /forum/* instead of forum/*/delete.

This also applies to the URL reducer symbol (<).


Ungrouping rules allow you to prevent pages from being grouped. These rules will also disable the default integer and datetime wildcarding as well.

Specific routes which you want to appear unwildcarded can be added. For example, adding the following ungrouping rules will result in those pages appearing separately in Raygun:

  • http://foo.com/thread/1
  • http://foo.com/thread/2

Whilst a visit to http://foo.com/thread/3 would show up under /thread/*.

Wildcards can also be applied to ungrouping rules allowing you to mass-ungroup pages. For example, with a rule of http://foo.com/thread/*, the following pages will appear individually inside Raygun:

  • /thread/1
  • /thread/2

Subdomains can also be grouped or ungrouped in the same way as the segments above.

A rule of https://*.foo.com would group all of the following subdomains:

  • https://subdomain.foo.com
  • https://example.foo.com

Whilst visits to the following pages would appear as https://*.foo.com/bar:

  • https://subdomain.foo.com/bar
  • https://example.foo.com/bar

Ungrouping rules coexist alongside grouping rules. Ungrouping rules take precedence over (AKA override) any grouping rules. For example, take the following combination:

  • The ungrouping rule: https://www.example.com/route/*
  • The grouping rule: https://www.example.com/route/*/*

Will cause the following two pages to appear as https://www.example.com/route/1/* inside Raygun:

  • https://www.example.com/route/1/ff000
  • https://www.example.com/route/1/ee00ff