Every conversation about observability cost ends up in the same place: drop the unnecessary logs.
It's good advice. It's also incomplete. Nobody disagrees that unnecessary logs should go. The hard part is knowing which ones they are.
The Problem With "Unnecessary"
Look at any log line in isolation and it seems useful. Someone added it for a reason. Maybe it helped debug an issue two years ago. Maybe it will help debug one next week. Nobody wants to be the person who deleted the one line that would have explained the outage.
So the cleanup usually goes one of two ways. Either the team cuts conservatively, removes a few obvious debug lines, saves 5%, and moves on. Or someone sets a hard budget, drops whole services to WARN, and the next incident is investigated in the dark.
Both happen for the same reason: there's no shared definition of what makes a log necessary.
Here's the shift that makes the decision easier: necessary isn't a property of the log line. It's a property of how the log is used. The same line can be essential at ten per minute and pure waste of resources and become expensive at ten thousand per second. The question isn't "is this log useful?" It's "is this log worth what it costs, in this form, at this volume?"
Start With Where the Volume Is
Before judging individual lines, find out where the bytes go.
Group your logs by message template, not by exact message. User 4821 logged in and User 9310 logged in are the same pattern. Most log backends can do this for you, and if yours can't, stripping numbers and IDs with a regex gets you most of the way.
Then sort by volume. In almost every system, a handful of patterns account for most of the bill. The top twenty patterns are often 70-80% of total volume. That's where your effort goes. The long tail of rare lines costs almost nothing, and arguing over them is time you won't get back.
Five Questions for Every Log Pattern
Take each high-volume pattern and run it through these questions in order.
1. Who reads it, and when?
Every log needs a reader. That reader can be a person during an incident, an alert rule, a dashboard, an audit, or a downstream pipeline.
Check your query history. Most backends record which queries ran and what they matched. If a pattern hasn't appeared in a search, alert or dashboard in the last 90 days, it's a candidate. Not an automatic delete, a candidate.
If you can't name a reader, the log is being written for no one.
2. Does it say something nothing else says?
A lot of log volume is just duplicate signals.
- Request started / request completed lines repeat what your traces already record, with less structure.
- "Processed 500 records" every few seconds is a counter pretending to be a log. That's a metric.
- Logs that make up for a thin error log. Either the same error gets logged at every layer it passes through, giving you five lines for one failure, or every step of every request gets logged as a breadcrumb in case something fails later. The second is the expensive one, because you pay for it on every successful request too. Let the trace show the path, and log the error once, with full context, where it's handled.
If the information already exists in a span, a metric or another log, this copy is the one to drop.
3. What decision does it support?
A useful log changes what you do next. An error with the order ID, the downstream service and the response code tells you where to look. Something went wrong tells you what you already inferred, that something went wrong.
If reading the line doesn't help you decide anything, it isn't earning its place, no matter how often it fires.
4. What happens if it's gone during an incident?
This is the question that protects you from cutting too deep.
Some logs are rarely read because they're only needed when things break. Query history says nobody looked at them. The next outage says otherwise. Before dropping a pattern, imagine the worst incident in that service and ask whether this line would be part of the investigation.
If the answer is yes, keep it. You might change its form, but don't lose it.
5. Is it required regardless?
Audit trails, security events, access logs and anything under compliance retention aren't yours to optimise away. They don't need a reader this quarter. They need to exist when someone asks.
These go in their own bucket with their own retention, and they stay out of the cost discussion.
Keep, Transform or Drop
The questions don't give you a yes or no. They give you one of three outcomes, and the middle one is where most of the savings are.
Keep as is. Errors with context. State changes: a payment captured, a job failed, a config reloaded. Decisions the system made: a request was rate limited, a fallback kicked in, a feature flag routed a user. Audit and security events. These are low volume and high value. They're rarely the problem.
Transform. The log is answering a real question, just in an expensive way.
- Turn counts into metrics. If you only ever look at how many, you don't need every line.
- Move request context onto spans. Attributes on a trace are cheaper than a parallel log stream saying the same thing.
- Sample the success path. Keep every error, keep 1% of successful requests. You still see what normal looks like.
- Lower the level, not the line. Move it to
DEBUGand turn it on per service when you need it. - Tier the retention. Seven days hot, the rest in cheap storage. Most logs are only searched in the first few days.
Drop. No reader, no decision, no incident value, no compliance need. Health check logs. Heartbeats. Entering function traces left from a debugging session. Library chatter logged at INFO by default. Full payload dumps. Stack traces repeated on every retry.
Most of these are safe to drop because something else already does their job. A health check log can go once the orchestrator restarts failing instances and an alert fires when checks keep failing. Before you drop a pattern, make sure the alert or handler that replaces it actually exists. Then you can delete it with confidence, because you've checked.
When a Log Should Be a Metric
Think about how a developer actually uses a log like User logged in. They open the observability backend, search for the pattern, pick a time range, and look at the histogram. Did logins drop after the deploy? Is checkout slower than yesterday? Are orders following the usual daily curve?
In most cases, they're not reading the lines. They're looking at the shape. And every time they do, the backend scans and counts millions of lines to draw a chart a metric would have drawn instantly.
Of all the transforms, this one usually saves the most, and it's the easiest to miss.
Look at lines like these:
User 4821 logged in
User 9310 logged in
Order 77120 placed
Order 77121 placed
Payment succeeded for order 77121Now ask what you actually do with them. Almost always, the answer is a count. How many logins per minute. How many orders were placed today. Whether payments dropped after the last deploy. Nobody reads the millionth User logged in line. They count them.
If the question is "how many" or "how fast", the answer is a metric. Instead of writing a line for every login, increment a counter:
user_logins_total{method="password", result="success"}
orders_placed_total{region="eu"}
payment_duration_seconds{provider="stripe"}A counter costs the same whether it's incremented ten times or ten million times. A log costs more with every event. At low traffic the difference is invisible. At scale, the log version of a business event can quietly become one of your biggest patterns.
You also get a better answer. A metric is already aggregated, so dashboards and alerts on it are fast and cheap. The log version has to be scanned and counted every time someone asks the question.
Two cases where the log still earns its place:
- You need the individual event. Failed logins for security, or a specific order a customer is asking about. Keep the failures and the exceptions as logs. Count the successes.
- You need to drill into one occurrence. That's what traces are for. The span for that request carries the IDs, so you don't need a log line to find it.
Keep labels on the metric low-cardinality: method, region, result. User IDs and order IDs don't belong on a metric. They belong on the span or the log that's kept for the exceptions.
A simple test: if the only thing you ever do with a log pattern is put it in a count() query, it was a metric all along.
Make It a Habit, Not a Project
A one-time cleanup decays. Six months later, new services have added new noise, and the bill is back where it started.
Two small habits keep it in check:
- Review the top patterns monthly. Ten minutes on the biggest movers. A new pattern in the top twenty is either a bug or a decision someone should have made on purpose.
- Ask the questions at write time. When a log line goes into a pull request, ask who reads it and what it costs at production volume. It's much cheaper to not add a log than to find it and remove it later.
Cut With Confidence
Removing unnecessary logs is the right first step for reducing observability cost. But "unnecessary" is a decision, not a feeling, and it should be made against how logs are actually used.
When you know which logs have a reader, which duplicate other signals, which only matter during an incident and which are required no matter what, the cut stops being a gamble. You spend less, and you still see everything you need when it matters.
Put together, it looks something like this. The patterns worth keeping are rarely the ones driving the bill.


