Request Metrics Documentation

Request Metrics is quickly evolving and rapidly adding new features. If something is unclear or you have questions please email us.

Sloth building a rocket.

Table of Contents

Installation

You'll need to install our JavaScript agent to begin collecting performance data. The agent is only 3.4 kb and should have a neglible impact on your page size. Additionally, the script can be loaded with the async attribute to prevent render blocking.

Installing From the CDN

The easiest way to get started is by including the script from our hosted CDN. We use the same CDN service that hosts jQuery, so it should be reliable and fast. However, you may also feel free to pull the agent script and host/bundle it yourself if you're extra paranoid (we don't blame you).

<script async
        src="https://cdn.requestmetrics.com/agent/current/rm.js"
        data-rm-token="YOUR_APPLICATION_TOKEN"></script>
Note: Be sure to include your application's token in a data-rm-token attribute. When the agent initializes itself it will find the token and you're off to the races.

Manually Initializing

If for some reason you'd prefer to tell Request Metrics when to initialize, you can do that too.

<script src="https://cdn.requestmetrics.com/agent/current/rm.js"></script>
<script>
    // Once you are *sure* the Request Metrics agent script has been loaded
    RM.install({
        token: "YOUR_APPLICATION_TOKEN"
    });
</script>

Installing from NPM

To keep things simple while we're adding new features we're only offering the JavaScript agent hosted on the CDN. We will be releasing an NPM package in the near future, once feature development slows a bit.

URL Grouping

It's common to have URLs with ID numbers or GUIDs in the segments. Consider:

https://example.com/product/12345/overview https://example.com/product/67890/overview
It would be nice if those two URLs were grouped together inside of Request Metrics so that we could aggregate the performance across them. They are almost certainly running the same code, so we've devised a few options to help roll them up.

Automatic Segment Grouping

If we encounter a URL path segment that "looks" like an ID, we will automatically group all urls with that segment together. From our example above, those two URLs would both be grouped as:

https://example.com/product/${product}/overview
We run a number of regular expressions against each URL segment to determine whether we think it's an ID. Anything with 2 or more numbers, or that looks like any common form of UUID, will automatically be grouped. We use the preceding segment to determine the grouping name. This mostly works for simple URL schemes but of course the real world is more complicated!

Manual URL Grouping Rules

It's impossible for us to automatically group every possible URL in a way that meaningfully reflects the application. So we've built out a suite of tools to create "URL grouping rules". Consider:

https://us-east1.example.com/api/v1.0/products/1a2b3c/overview https://us-east2.example.com/api/v1.2/products/6f7g8h/overview
In these URLs there are multiple subdomains involved, multiple API versions, and the product IDs are custom to the application. We would still like to group the subdomains together, the API versions (they are all 1.x) and the product IDs. With our URL grouping rules you can group these like so:

https://${us-east}.example.com/api/${v1.x}/products/${productId}/overview
You can also create conditional groupings. This way the rule will only apply if the subdomain or path segment matches certain criteria (subdomain contains "us-east" for example).

How can I Make My Own Rules?

We are still figuring out how best to expose the URL grouping rules UI to our customers. If you have URLs you'd like grouped, please send an email to hello@requestmetrics.com and let us know! We're very responsive and will be able to walk through your options. Once we've refined the UI based on customer use cases we'll release it for everyone to use.

Ignoring Noise

Browser extensions, antivirus software and third party ad networks can all contribute noise to your Request Metrics dashboard. Anything that makes requests in the context of your page's JavaScript will show up. We have a global ignore list of common noise producers - Kaspersky antivirus, Google Translate etc.

If you have additional URLs you want ignored, please reach out to us and let us know. Over time we will fine-tune the global ignore list and allow custom ignore rules that you can create yourself.

FAQ

Do You Store Any User Identifying Information?

Nope. We believe in end-user privacy. We do not track or store any personally indentifiable information. In addition, we do not sell your information to anyone, ever.

How Do You Calculate Distinct User Counts Then?

We create a hash of the user agent string and IP address and apply it to a HyperLogLog data structure. At no time is the user agent or IP address persisted. Due to the way HyperLogLog works, larger user counts are close estimates as opposed to exact.

Can Request Metrics Monitor Service Workers Too?

Yes! The agent will work inside a service worker context and monitor performance of AJAX endpoints.

// Inside your service worker
importScripts("https://cdn.requestmetrics.com/agent/current/rm.js");

RM.install({
  token: "YOUR_APPLICATION_TOKEN"
});

I Have Other Questions, How Can You Be Contacted?

Please email us at hello@requestmetrics.com for any questions, comments, complaints or philosophical software development discussions. Our entire engineering team monitors that inbox so you will get a reply sooner than later.

Future Roadmap

Request metrics is rapidly iterating on new features. Here's some of the things we're working on. We also take customer feedback in to account. If there's a feature you want sooner, or something not on this list, let us know!

Custom URL Grouping Rules

We have an internal-only admin UI to build custom URL grouping rules right now. It works well for the use-cases we've seen so far. We will be releasing it to end-users once we're confident it's understandable and solves the majority of URL grouping scenarios.

Custom Ignore Rules

Much like URL grouping rules, we want to get a sense of the URLs customers want to ignore before we expose a UI. The capabilities exist in the system but are currently "admin only" at the moment. Contact us if you need custom ignore rules!

Better Time Range Comparisons

Tracking performance over time is important. We want to offer some better comparison tools and a weekly summary that shows this week's traffic compared to last week's.

User Geographic Location

We plan to start capturing the rough geographic location of users. This will most likely be based on IP lookup. As with distinct user counting we will only store the anonymized data set.

Browser Statistics

Most modern browsers are fast, but knowing whether it's Firefox or Chrome or Edge can still be an interesting signal. We plan to start capturing macro browser statistics.

Better Alerts

We want to add new kinds of alerts (maybe when a page goes from "OK" to "Slow", for example) and perhaps offer some kind of uptime checking.

NPM Package

An NPM package will be coming sooner than later so you can integrate the Request Metrics agent into your front-end build process.