Loading...

Skip to content
MemonaIQ
ToolsLearnCompany
Sign in
ToolsLearnCompanyBrowse all tools
Knowledge Center
In this topic
Monitoring & Reliability
Uptime monitoring: what it measures and how checks workLogs, metrics and traces: what each one tells youSLIs, SLOs and SLAs explained, with error budgetsIncident management: roles, updates and blameless reviewsHow to monitor website uptime, step by step
A-Z glossary
HomeKnowledgeMonitoring & Reliability
Monitoring & Reliability•4 min read•intermediate

Logs, metrics and traces: what each one tells you

Logs, metrics and traces answer different questions about a running system. How each works, how trace IDs connect them, and what each costs to collect and keep.

What logs, metrics and traces each answer

Metrics tell you that something is wrong and how much: numbers such as request rate, error rate and latency, aggregated over time. Traces show where, by following one request through your services and timing each step. Logs explain why, with the detail of single events such as an error message and the input that caused it.

Observability is how well you can explain a system's behavior from the data it emits. The three signals overlap, but each is the cheapest way to answer one kind of question.

Metrics: numbers over time

A metric is a named numeric measurement recorded at regular intervals, usually with labels such as service, route or status code. Counters only go up, like total requests served. Gauges go up and down, like memory in use. Histograms count values in buckets, from which you can compute latency percentiles.

Because a metric stores aggregates instead of individual events, it is cheap to keep for months and fast to query. That makes metrics the usual basis for dashboards and alerts. The cost is detail: a metric can show that errors rose but not which request failed.

Google's SRE book suggests starting with four signals for a user-facing system: latency, traffic, errors and saturation.

Traces: one request across services

A trace records one request as a tree of spans. Each span is one unit of work, such as an HTTP handler, a database query or a call to another service. Every span has a start time, a duration and attributes.

All spans in a trace share a trace ID, and each span records its parent. Services pass this trace context along with every outgoing call, commonly in the W3C traceparent header, so the next service adds its spans to the same trace.

A trace shows where the time went and which downstream call failed. Traces are most useful in systems where one request touches several services or queues.

Logs: the detail behind each event

A log is a timestamped record of one event. Structured logs write each event as named fields, often JSON, instead of free text, so you can filter by route, user or error code without regular expressions.

Logs carry the most detail per event: error messages, stack traces and the values that failed validation. Keep passwords, tokens and personal data out of them, since logs are copied, shipped and kept for long periods.

log-event.json
json
{
  "timestamp": "2026-10-25T09:14:03.512Z",
  "level": "error",
  "service": "checkout",
  "route": "/api/orders",
  "message": "Payment provider timed out after 10000 ms",
  "trace_id": "4bf92f3577b34da6a3ce929d0e0e4736",
  "span_id": "00f067aa0ba902b7"
}

Connecting the three with trace IDs

The signals are most useful when you can move from one to the next. Write the current trace ID and span ID into every log line, as in the example above, so a slow span leads straight to the logs it produced.

Use the same service and route names in metric labels, span attributes and log fields. Some metric systems also store exemplars, which attach a sample trace ID to a histogram bucket and link a latency spike to a real request. OpenTelemetry provides one set of APIs and naming conventions for all three signals.

A typical investigation follows that path. An alert fires on the error-rate metric, traces from that window show which service failed, and that span's logs give the error message.

What each signal costs

Each signal grows expensive in a different way, so each needs its own controls.

  • Log volume rises with every event and every field. Drop debug logs in production, sample high-volume success logs, shorten retention and avoid logging full request bodies.
  • Metric cardinality is the number of unique label combinations, and each one is a separate time series. A label with unbounded values, such as user ID or full URL, can create millions of series. Keep labels to small fixed sets like route templates and status class.
  • Recording every span of every request is costly at high traffic. Head-based sampling decides when a request starts, for example keeping 1 in 100, which is cheap but can miss a rare failing request.
  • Tail-based sampling decides after a trace finishes, so it can keep every error and slow request. It has to buffer all spans until that decision, which costs memory and adds a collection step.
Previous guide
Uptime monitoring: what it measures and how checks work
Next guide
SLIs, SLOs and SLAs explained, with error budgets

References

  • W3C Trace Context
  • Google SRE book: Monitoring Distributed Systems

On this page

What logs, metrics and traces each answerMetrics: numbers over timeTraces: one request across servicesLogs: the detail behind each eventConnecting the three with trace IDsWhat each signal costs
Updated:2026-10-25
Format:Technical Guide
MemonaIQ

Focused tools for everyday digital work.

  • 18 focused tools
  • 9 run in your browser
Browse all tools Get help

Featured tools

URL Intelligence PlatformImage CompressorInvoice StudioDNS LookupAI Token Counter

Explore

All toolsKnowledge CenterGuidesResourcesCompany

Support

HelpContactSecurity

Legal

PrivacyTermsCookies

© 2026 MemonaIQ. Made in Colombo.

Back to top

MemonaIQ