We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Metrics

If logging is the foundation of an observable system, and alerting is an enhancement, where do metrics fit in?

Would it surprise you that, in a mature system, metrics are often a near-complete replacement for logging?

Good metrics and metric visualizations can give you the insight you need into your application's behavior to pinpoint problem areas, often without even looking at logs.

But we're getting ahead of ourselves.

First...

What Are Metrics?

Metrics measure certain aspects of our application or its environment (memory and CPU usage, available disk space, etc.). Metrics come in different types:

  • Counters – How many times did a thing happen?
  • Gauges – How much or what percent of a resource is being consumed?
  • Histograms – How do disparate events or numbers, such as response times, compare?

We'll focus primarily on counters, but with that foundation, you can easily expand to the others as needed in future applications.