Skip to content

Instantly share code, notes, and snippets.

@MaxGabriel
MaxGabriel / ekg-yesod.md
Last active August 6, 2020 09:46
Monitoring a Yesod app with EKG

Monitoring a Yesod app with EKG

Monitoring is critical to a well-functioning production system. OS-level metrics like CPU load and RAM usage are a good start, but you'll eventually want to record application-level metrics like how long it's taking you to service each HTTP request, or how much time is spent in garbage collection. Once tracked, this data can be used by humans and machines (like monitoring systems) to gain insight into how your app is running.

In this post I'll show how you can use EKG, a popular Haskell metrics library, to add application-level metrics to your Yesod app.

A Brief Overview of EKG Metric Types

EKG allows reporting four different types of metrics from your app: