DEV Community

Benjamin Cane
Benjamin Cane

Posted on • Originally published at itnext.io on

Do you use Metrics or did you implement Logging and call it a day?


Cover image generated by AI

Are metrics an essential pillar of your Observability strategy? Or did you implement logging and call it a day?

The Value of Metrics 💵

Many underestimate metrics (OTEL, StatsD, or Prometheus), but metrics add tremendous value by providing insights into your platform’s health and operation.

With metrics, you can view the system as a whole or drill down to a single instance; that kind of visibility is empowering.

Being thoughtful about your collected metrics is the key to unlocking their value.

What Metrics to Collect 🕵️‍♂️

📊 Application Metrics

These metrics provide insights into how your application is performing. Examples might be thread usage, garbage collection time, or heap space utilization.

With application metrics, you can see low-level performance details.

💻 System Metrics

Infrastructure performance visibility is just as important as application metrics. It is imperative to be able to answer questions about your I/O wait time, CPU utilization, number of network connections, etc., at any time, historically, and live.

Applications only run well if the underlying infrastructure runs well; system metrics provide insights into your infrastructure.

⚙️ Application Events

The events within your application are probably the second most valuable metrics to collect. These include the number of HTTP requests, database calls, scheduled task executions, etc.

Seeing application events across an entire platform can provide some fantastic operational insights. But it’s essential to collect these metrics in the right way.

Track the number of these events and their execution time, and categorize them using labels.

With the right metrics, you should be able to see how long each database call took and what its purpose was.

You should be able to see how many HTTP requests a specific endpoint received, how long it took to respond, and what response code was provided.

All application events are essential and should be tracked.

💼 Business Events

While you might be able to derive business events from application events, it is better to create specific metrics to track business events.

When you create these metrics, ask yourself:

What is the purpose of this application, and why do clients use it?

What background events does my application perform that could impact business operations?

What are the crucial aspects of my business events? Is it speed, number of requests, or success rate?

Like application events, it’s essential to categorize business events appropriately. Use labels with your metrics to build more granularity in events.

Know what clients are doing, what activities are being performed, why, and how.

Combining them all 🧩

While many of these metrics could be derived from logging or tracing, metrics give you real-time and historical perspectives with less overhead.

Implementing metrics can provide unique insights into your platforms and products.


Top comments (0)