पाठ 1 / 25

Metrics, Logs and Traces

Three complementary signals.

What each signal answers

Metrics are numbers sampled over time (requests per second, error ratio, memory used): cheap to store, fast to query and ideal for dashboards and alerts. Logs are detailed event records that explain what happened in a specific case. Traces follow one request across services to show where time was spent. Prometheus focuses on metrics; Grafana can display all three when connected to tools such as Loki (logs) and Tempo (traces).

Numbers over time

Prometheus pulls numeric measurements from your services and stores them as labelled time series.

Three ideas: observability signals, architecture, the data model.
Figure 1.1 — Signals, architecture and data model.

A car dashboard, a logbook and a GPS track

The speedometer (metrics) tells you something is wrong at a glance, the logbook (logs) records each event in detail, and the GPS track (traces) shows the exact route a single trip took.

Alert on metrics, debug with logs and traces

Metrics detect problems cheaply; logs and traces explain them.

त्वरित जाँच: Which signal is best for cheap, fast alerting on error rates?

  • Traces only
  • Logs only
  • Metrics
  • Screenshots
Answer

Metrics — Aggregated numbers are cheap to evaluate.