What is a Metrics Layer?

Metrics layer is a type of software that allows you to access data from multiple sources, transform the data, and send it to another system. The main advantage of a metrics layer is that it simplifies your reporting. Relative to the data stack, the metrics layer sits between your application and your monitoring tool to keep track of usage and performance data.

With a metrics layer, you can connect all your data sources (databases, sales systems, marketing platforms) and use them for analysis. There's no need to write specific SQL scripts for every tool or database. Istead of scripting, you can use a metrics layer like Metabase or Mode Analytics. You create reports on top of the metrics layer and then share them with your colleagues using dashboards or widgets.

Components of a Metrics Layer

Metrics layers can be broken down into two main components:

  • A metrics collector, which is a library you add to your codebase. This library collects information about the health of your application from within the application like response times, error rates, queue lengths, etc.
  • A metrics API, which is an API endpoint that you send this collected data to. The API aggregates it and makes it accessible by your monitoring tools.
Courtesy of metabase.com

The value of a metrics layer is that it enables you to collect and analyze performance data without having to build or maintain infrastructure. It decouples the collection of telemetry data from the collection of business data.

Since developers are often responsible for both building features and maintaining observability infrastructure, this decoupling helps teams ship features faster by reducing the time lost to observability-related tasks (like configuring monitors, writing alert rules, scheduling downtime windows). It also reduces risk because it allows teams to adopt new monitoring tools without needing to change their application code.