1. Home
  2. Blog
  3. DevOps

DevOps

Monitoring vs Observability: The Real Difference, With Logs, Metrics and Traces

Monitoring tells you that something is wrong. Observability helps you work out why, even when the failure is one you never predicted. Follow a checkout incident to see how the two work together.

9 min read
Monitoring vs observability: the real difference, with logs, metrics and traces

Key takeaways

  • Monitoring watches for known problems, using predefined metrics and alerts.
  • Observability is how well you can understand a system’s internal state from its outputs.
  • Logs, metrics and traces are common signals, but collecting them does not guarantee insight.
  • They work together: monitoring raises the alarm, and observability helps you find the cause.

The dashboard is green, and yet customers are complaining that checkout is broken. If you have been in this position, you already understand the difference between monitoring vs observability. Your monitoring only checked what you thought to check, and this failure is something new.

This guide explains both ideas without the marketing language, and follows one fictional incident from alert to root cause. The logs, trace and numbers are invented to illustrate the process. You should also know that vendors and practitioners draw this line differently, and some consider it partly a marketing distinction. We focus on the practical part.

The short answer

Monitoring is an activity. You decide in advance what to watch, such as CPU, error rate or disk space, and you set thresholds that trigger alerts. It answers: “Is the thing I was worried about happening?”

Observability is a property of your system. The term comes from control theory, where it describes how well you can infer a system’s internal state from its external outputs. In practice, it answers: “What is happening and why, including for problems I never anticipated?”

Think of a car. The warning lights on the dashboard are monitoring. They cover a set of known problems. A mechanic’s full diagnostic port, which lets someone ask new questions about any part of the engine, is closer to observability.

Monitoring vs observability side by side

Aspect Monitoring Observability
Main question Is something wrong? Why is it wrong?
Best for Known failure modes Unknown and novel failures
Approach Predefined checks and dashboards Open exploration of rich data
Typical output Alerts and status graphs Answers to new questions
Data detail Often aggregated Detailed, per request where possible
Setup Configure checks from outside Requires instrumenting your code
Used by Operations, on-call staff Developers and on-call staff

This is not a choice between the two. You still need alerts to tell you when to look.

Why monitoring alone is not enough

With one application on one server, the list of things that can go wrong is fairly short, so you can watch them all. A modern system may have dozens of services, queues and third-party APIs, plus containers that come and go. Failures become combinations that nobody predicted: one region, one customer type, a specific app version and a single slow dependency.

You cannot write a dashboard in advance for a question you have not thought of. You need data that lets you ask it afterwards.

Logs, metrics and traces

These three types of telemetry are often called the pillars of observability. Each one answers a different question:

Signal What it is Answers Weakness
Metrics Numbers over time How much? Is it getting worse? Little detail on single events
Logs Records of individual events What exactly happened? Can be costly and noisy
Traces A request’s path through services Where did the time go? Require instrumentation and are often sampled

Metrics

http_requests_total{service="checkout", status="500"} 1832
http_request_duration_seconds{service="checkout", quantile="0.95"} 2.4

Metrics are cheap to store and fast to query, which makes them ideal for dashboards and alerts. Be wary of high-cardinality labels, such as a user ID, in many metric systems, because they can sharply increase cost.

Traces

A trace follows one request across services. Each step is a span with a start time and a duration:

POST /checkout                      2410 ms
├─ auth-service: verify token         18 ms
├─ cart-service: load cart            42 ms
├─ pricing-service: calculate       2290 ms   <-- slow
│  └─ SELECT coupons ...            2265 ms
└─ payment-service: not reached

A trace makes a slow step obvious, which is very hard to see in separate logs from separate services.

Logs

Logs provide the detail of what happened at one moment. We look at how to make them useful in a moment.

An incident walkthrough

Here is how the pieces fit together, in a fictional example.

Step Signal What we learn
1. Alert fires Metric Checkout p95 latency passed its 1-second target
2. Break it down Metric Only the mobile app is affected, not web
3. Inspect a request Trace The time is in pricing-service, on a coupon query
4. Read the details Logs Slow requests all use a coupon from today’s campaign
5. Confirm the cause Query plan Coupon lookup has no suitable index
6. Fix it Deployment Add the index, and watch latency recover

Monitoring handled step 1. Everything after that was observability. Note how each question came from the previous answer. Nobody could have built a dashboard ahead of time for “mobile app coupon query from today’s campaign”. For the fix itself, our guide to SQL query optimization shows how to read that kind of plan.

Better logs

Plain text logs are made for human eyes, and hard to query. Structured logs use fields that a machine can filter on:

# Hard to search
ERROR Payment failed for user 42 after 3 tries

# Easy to search
{"level":"error","event":"payment_failed","user_id":"42",
 "attempts":3,"provider":"acme","trace_id":"a1b2c3","duration_ms":2410}

With the second form, you can immediately ask “how many failures per provider in the past hour?” The trace_id field is especially valuable, since it links a log line to the whole request, across every service it touched.

Never log passwords, tokens or card numbers, and take care with personal data. As our guide explains, JWTs can be reused by anyone who reads them from a log.

Tip: Add context that you would want during an incident, such as version, region, customer tier and feature flag state. Being able to say “only version 2.14 in one region” often solves the problem on its own.

The golden signals

Not sure what to monitor? Google’s Site Reliability Engineering book suggests four signals for user-facing systems:

Signal Question Example
Latency How long do requests take? p95 and p99 response time
Traffic How much demand is there? Requests per second
Errors How many requests fail? Rate of 5xx responses
Saturation How full is the system? CPU, memory, connection pool use

Use percentiles for latency, since averages hide slow requests, as we showed in load testing vs stress testing.

Alerts people trust

If alerts fire all the time, people stop reading them. Good ones follow a few rules:

  • Alert on symptoms users feel. “Checkout errors above 2%” beats “CPU at 85%”. High CPU that harms nobody should not wake anybody up.
  • Make every alert actionable. If nobody needs to do anything, make it a dashboard item or remove it.
  • Link to a runbook. Tell the responder where to look and what to try.
  • Review them regularly. Delete or fix any alert that was ignored last month.

Service level objectives

An SLO turns “the site should be fast and reliable” into a measurable target, like “99.9% of checkout requests succeed over 30 days”. That allows for about 0.1% of failures, known as an error budget. If you have plenty left, you can ship faster, and if it is almost used up, you can prioritize reliability. It is a helpful way to settle arguments between delivery speed and stability.

OpenTelemetry and tools

OpenTelemetry is an open-source, vendor-neutral standard for generating and exporting telemetry. It is a project of the Cloud Native Computing Foundation. Instrumenting with it means you can change your backend later without rewriting your code. It is not a storage or dashboard product itself, so you pair it with one:

Purpose Open-source examples Commercial examples
Metrics Prometheus Datadog, New Relic
Dashboards Grafana Datadog, Dynatrace
Logs Loki, OpenSearch Splunk, Elastic
Traces Jaeger, Tempo Honeycomb, Datadog

Check current features and pricing yourself, as these products change often. Costs can grow quickly with data volume, so use sampling and set retention limits.

How to get started

  1. Begin with the golden signals for your most important service.
  2. Add one or two alerts on symptoms that users notice.
  3. Switch to structured logs, with a request ID in each line.
  4. Add tracing to your main user journey with OpenTelemetry, as auto-instrumentation can cover many common frameworks.
  5. Link deployments to your graphs, so that you can see whether a release from your CI/CD pipeline caused a change.
  6. Learn from each incident. After each one, ask what data would have made it quicker to solve, and add that.

A small team with one service does not need a huge platform. Basic metrics, good logs and a few alerts may be plenty. Tracing earns its keep as the number of services grows.

Common mistakes

  • Buying a tool and calling it observability. The value comes from good instrumentation and how you use the data.
  • Treating three pillars as a checklist. Separate data with no way to link it leaves you hunting through tabs. Shared IDs matter.
  • Collecting everything. Unfiltered telemetry gets expensive, and it adds noise.
  • Too many dashboards. A few trusted views beat a hundred that nobody opens.
  • Thinking it replaces testing. You still need tests before release. Canary releases pair well with these signals, though.

Final thoughts

Monitoring tells you that something has gone wrong, and observability gives you the means to find out why. The practical test is simple: when an unfamiliar problem appears, can you find the cause without shipping new code? Next time you are in an incident, write down every question you could not answer. That list is your roadmap.

Frequently asked questions

What is the difference between monitoring and observability?

Monitoring tracks predefined metrics and alerts on known problems. Observability is the ability to understand a system’s state from its outputs, including for unexpected problems.

What are the three pillars of observability?

They are logs, metrics and traces. Logs record events, metrics measure values over time, and traces follow a single request across services.

Do I need observability if I have monitoring?

For a small, simple system, good monitoring and logs may be enough. As systems become distributed and failures less predictable, observability becomes more valuable.

What is OpenTelemetry?

It is an open-source standard and set of tools for producing and exporting logs, metrics and traces, so you are not tied to a single vendor’s agent.

What are the four golden signals?

They are latency, traffic, errors and saturation. Google’s SRE guidance recommends these as a starting point for monitoring user-facing systems.

Keep learning

Work with Stack Quora

Need help with testing, WordPress or SEO?

We help teams ship better software and grow their sites. Tell us what you are working on and we will suggest a clear next step.

Keep reading

More guides on testing, AI & modern development

Enjoyed this article? Pick a topic and jump straight into our newest tutorials.

Artificial Intelligence

LLM Structured Output Explained: Getting Reliable JSON From AI Models

LLM structured output explained with validation we ran in Pydantic: JSON mode and schemas, constrained decoding, the ways model output…

Read article →
DevOps

SSH Keys Explained: How They Work, ssh-keygen, Ed25519 and Safe Habits

SSH keys explained with keys we generated: public vs private keys, ssh-keygen, Ed25519 vs RSA, fingerprints, passphrases, ssh-agent, authorized_keys, config…

Read article →
DevOps

HTTP Caching Explained: Cache-Control, ETag and 304 Responses, With a Live Test

HTTP caching explained with a small server we ran: Cache-Control directives, max-age, no-cache vs no-store, ETag revalidation and 304 responses,…

Read article →
Test Automation

API Contract Testing Explained: Catch Breaking Changes Before They Ship

API contract testing explained with a schema check we ran: what a contract is, consumer-driven contracts, Pact, OpenAPI, which changes…

Read article →
Software Testing

Risk-Based Testing Explained: Score Risks, Build a Matrix and Test What Matters

Risk-based testing explained step by step: identifying risks, scoring likelihood and impact, building a risk matrix, mapping risk to test…

Read article →
Databases & SQL

SQL Constraints Explained: NOT NULL, UNIQUE, CHECK and FOREIGN KEY, Tested

SQL constraints explained with tests we ran: NOT NULL, UNIQUE, CHECK, DEFAULT, PRIMARY and FOREIGN KEY, the NULL loopholes, SQLite's…

Read article →
Databases & SQL

SQL Date Functions Explained: Adding, Comparing and Grouping Dates Without Bugs

SQL date functions explained with queries we ran: adding intervals, month-end surprises, date differences, the BETWEEN trap, grouping by day,…

Read article →
Software Development

Python asyncio Explained: async, await, gather and TaskGroup With Real Timings

Python asyncio explained with code we timed: coroutines, await, gather, TaskGroup, error handling, timeouts, limiting concurrency and the blocking-call mistake…

Read article →
Software Development

Debounce vs Throttle in JavaScript: How They Work, When to Use Each, Tested

Debounce vs throttle in JavaScript explained with timings we measured in Node.js: how each works, simple implementations, leading and trailing…

Read article →
Software Development

Python Context Managers Explained: The with Statement, contextlib and Real Uses

Python context managers explained with code we ran: how with works, __enter__ and __exit__, contextlib.contextmanager, suppress, ExitStack, database transactions and…

Read article →
Artificial Intelligence

LLM Temperature and Top-p Explained: How AI Models Choose Their Next Word

LLM temperature and top-p explained with a simulation we ran: how probabilities are reshaped, what top-p keeps, recommended settings by…

Read article →
DevOps

YAML Explained: Syntax, the Norway Problem and Other Traps We Tested

YAML explained with a parser test: basic syntax, lists and maps, the Norway problem, versions turning into floats, octal zip…

Read article →
DevOps

Cron Jobs Explained: Syntax, Real Schedules and the Mistakes That Break Them

Cron jobs explained with schedules we verified: the five fields, operators, real examples, the day-of-month OR day-of-week trap, environment problems,…

Read article →
Software Testing

Bug Life Cycle in Software Testing: Every Status, Who Owns It and Common Mistakes

The bug life cycle explained: every defect status from New to Closed, who owns each step, rejected, deferred and reopened…

Read article →
Test Automation

Property-Based Testing in Python: Hypothesis Finds the Bugs Your Examples Miss

Property-based testing explained with Hypothesis tests we ran: properties vs examples, strategies, shrinking, the real bugs it found in our…

Read article →
Databases & SQL

SQL Pagination Explained: OFFSET vs Keyset, With a Million-Row Test

SQL pagination explained with a million-row test we ran: LIMIT and OFFSET, why deep pages get slow, keyset (cursor) pagination,…

Read article →
Databases & SQL

SQL EXISTS vs IN: Differences, the NOT IN NULL Trap and Performance

SQL EXISTS vs IN explained with queries we ran: how each works, why NOT IN returns no rows when a…

Read article →
Software Development

Python Logging Explained: Levels, Handlers, Formatters and Mistakes to Avoid

Python logging explained with code we ran: levels, basicConfig quirks, named loggers, handlers and formatters, logger.exception, lazy formatting, duplicate logs…

Read article →
Software Development

JavaScript Map vs Object: Key Differences, Pitfalls and a Benchmark

JavaScript Map vs Object explained with code we ran in Node.js: key types, ordering, the prototype trap, JSON, size, WeakMap…

Read article →
Software Development

Python Type Hints Explained: Annotations, mypy and the Errors It Catches

Python type hints explained with a real mypy run: basic annotations, Optional and unions, TypedDict, Literal, Protocol, generics, Callable, strict…

Read article →
Artificial Intelligence

LLM Tokens Explained: How AI Models Read Text, Count Costs and Fill Context Windows

LLM tokens explained with a tokenizer we ran: how text is split, why counts differ by language and tokenizer, context…

Read article →
DevOps

Semantic Versioning Explained: MAJOR.MINOR.PATCH, Ranges and Release Rules

Semantic versioning explained with code we ran: MAJOR.MINOR.PATCH rules, pre-releases, correct version sorting, caret and tilde ranges, 0.x versions, lockfiles…

Read article →
DevOps

Git Reset vs Revert: How to Undo Commits Safely, With a Tested Example

Git reset vs revert explained with a repository we built: soft, mixed and hard reset, revert commits, reverting merges, recovering…

Read article →
Software Testing

The Test Pyramid Explained: Layers, Ratios and When to Break the Shape

The test pyramid explained: unit, integration and end-to-end layers, sensible ratios, the ice cream cone anti-pattern, the testing trophy and…

Read article →
Test Automation

pytest Fixtures Explained: Scope, yield Teardown, conftest.py and Factories

pytest fixtures explained with a suite we ran: how fixtures work, scopes, yield teardown, conftest.py, factory fixtures, parametrized fixtures, built-ins…

Read article →
Databases & SQL

SQL Upsert Explained: INSERT ON CONFLICT, MERGE and the REPLACE Trap

SQL upsert explained with queries we ran: INSERT ON CONFLICT DO UPDATE and DO NOTHING, the excluded row, conditional updates,…

Read article →
Databases & SQL

SQL LIKE Operator Explained: Wildcards, Case Sensitivity and Performance

The SQL LIKE operator explained with queries we ran: % and _ wildcards, escaping, NOT LIKE and NULL, case sensitivity…

Read article →
Artificial Intelligence

AI Hallucinations Explained: Why Language Models Make Things Up and How to Reduce It

AI hallucinations explained: what they are, why language models produce them, common types, how to reduce them with grounding and…

Read article →
Test Automation

Mocking in Python: unittest.mock, patch and the Mistakes That Make Tests Lie

Mocking in Python with unittest.mock, tested: Mock and return_value, side_effect, patching where a name is used, spec and autospec, mocking…

Read article →
Software Testing

Code Coverage Explained: Line vs Branch Coverage and What 100% Really Means

Code coverage explained with a real coverage.py run: line, branch and condition coverage, reading a report, why 100% coverage can…

Read article →
Artificial Intelligence

What Are AI Agents? How They Work, With a Simple Agent Loop You Can Run

What are AI agents? A plain guide to the agent loop, tools, memory and guardrails, with a small Python loop…

Read article →
Test Automation

TDD vs BDD: Key Differences, One Feature Built Both Ways and When to Use Each

TDD vs BDD explained with one discount feature built both ways: red-green-refactor with code we ran, Given-When-Then scenarios, tools, trade-offs…

Read article →
Software Testing

User Acceptance Testing (UAT): Process, Checklist and Real Examples

User acceptance testing explained: who runs it, how it differs from QA, a seven-step process, a UAT test case template,…

Read article →
Artificial Intelligence

What Are Embeddings? Vectors and Cosine Similarity Explained Simply

What are embeddings? A plain-language guide to vectors, cosine similarity and semantic search, with a small example we ran, common…

Read article →
Test Automation

Flaky Tests: What Causes Them and How to Fix Them for Good

Flaky tests explained with demos we ran: the main causes, how to confirm and diagnose one, proper fixes for timing,…

Read article →
Software Testing

Load Testing vs Stress Testing: Differences, Metrics and k6 Examples

Load testing vs stress testing explained: what each proves, spike and soak tests, the metrics that matter, why averages mislead,…

Read article →