Operations | Monitoring | ITSM | DevOps | Cloud

May 2020

Breaking Out of Webpack Based Build Chains

Javascript build chains have gotten outrageously complicated. Let's create one that isn't. Request Metrics monitors how real users experience the performance of your production websites. We need a JavaScript agent to pull performance data out of the browser. Watch as I calmly Bob Ross my way to a Webpack-free Typescript build pipeline with just a few NPM packages.

Using the Beacon API

Users are so annoying! There they go, leaving the page before we can save the data to the API. Back in the old days, we would attach a `window.unload` handler and try to send an AJAX request, but this was slow and unreliable. Enter the Beacon API to give us a better way. The Beacon provides a reliable way to send a small amount of data *after* the page has been unloaded. It's not bound to the lifetime of the page and it doesn't slow down the user.

Using NGINX as a Queue for JSON Payloads

Request Metrics is a performance analytics tool. As such, we need to build a data ingestion pipeline that will consume performance data and process it. One common approach to ingest is to shove incoming data into a queue. We like simple things, and figuring out fancy distributed queues is anything but. So we're going to eschew best practices and use NGINX as our queue!