liveBook · Manning

Metric

As explained in gRPC Microservices in Go

A metric is a numerical measurement of a system or application property collected over time.

A metric is a numerical value used to describe service behavior over time. In Prometheus, a metric has a name, value, label, and timestamp. Timestamps reveal changes; labels let you group measurements. section 9.1.2

Metrics help make a distributed application visible. Service-level measurements and overall latency can expose trouble even when a request succeeds. Use dashboards to inspect trends, then add alerts for conditions that need attention when nobody is watching. section 1.4.4

From measurement to action

Prometheus can collect system and application metrics. An alert might notify the team when a service’s memory usage exceeds 80%. For customer-facing quality, request latency, error rate, and throughput can serve as service-level indicators. Check how latency is summarized: an average can obscure a small number of very slow responses. section 1.4.4 section 9.1.2

Metrics are one part of observability, alongside traces and logs. When a metric shows an anomaly, related traces can identify the request flow and logs can provide context from the same period. OpenTelemetry instrumentation can ship metrics to a collector for monitoring. section 9.4 section 9.0

How gRPC Microservices in Go covers it

How deep it goes
Defines Prometheus metric fields and grouping, then examines quality indicators and the limitations of average latency.
Examples
Uses a service memory-usage alert and contrasting request latencies to show alerting and reporting pitfalls.
What it assumes
Assumes an existing microservice application while introducing the observability concepts used to inspect it.
What you can do after
Apply it via OpenTelemetry instrumentation and Prometheus collection to monitor services and configure metric-based alerts.
How it connects
Connects metrics to logs, distributed tracing, service-level indicators, service-level objectives, and service-level agreements.

Also explained in

Compare how 16 books explain metric →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of gRPC Microservices in Go. The section links point to the parts of the book it draws on.