Skip to content
Go back

Log Handling at Scale

Edit page

80/20 Of The Week … Log Handling at Scale

We know logs already. You have probably opened them because an ORM relationship was doing something silly, a JavaScript WebSocket decided it had enough of reconnecting, or a request returned 500 with zero useful explanation. PTSD for me basically.

In that situation, a log is just the breadcrumb trail… a timestamped line saying what happened and where. A user logged in, a payment failed, a pod restarted, a query took 8 seconds, an exception happened somewhere it definitely should not have happened.

But then I started thinking how this looks in production. One application is manageable. A Kubernetes cluster with hundreds or thousands of pods is another thing. Every service, container, database, proxy and network component keeps producing lines all day.

At WAD 2026, Aliaksandr Valialkin from VictoriaMetrics gave a talk on handling logs in large Kubernetes clusters. He compared Elasticsearch, Grafana Loki and VictoriaLogs, which got me back into this question, how do you make all this text useful without turning logging into its own disaster?

You obviously do not open one massive .txt file and Ctrl+F your way through a few terabytes.

The usual flow is that the application writes logs, then an agent such as Fluent Bit, Vector or the OpenTelemetry Collector picks them up. It batches them, parses structured JSON, attaches Kubernetes metadata such as pod and namespace, and can remove or sample noisy stuff. Then the logs go to a backend built for searching time-based data.

That backend might be Elasticsearch, Loki, ClickHouse or VictoriaLogs. They approach storage and indexing differently, so the “best” one depends on what you query, how much you ingest and how much infrastructure you want to run. They still need to compress data, split it across machines or partitions, and find the lines around checkout-service, ERROR, a time range or a request ID.

Scale is not only a disk problem. A badly chosen field can be expensive to index. Debug logs can flood the pipeline. The same stack trace repeated 50,000 times is rarely 50,000 times more useful. So teams batch and compress data, and choose carefully which fields should be easy to filter on.

At the end… it is important to say that logs are meant to disappear. A retention policy decides what stays for days, weeks, months or longer. Security and audit logs may need a long archive. Debug logs usually do not deserve premium storage for eternity. Recent data can sit on faster storage while older data moves somewhere cheaper or gets deleted.

The goal is not to keep every line forever. The goal is to keep enough useful evidence to answer what happened, where, when and hopefully why.

TLDR

Logs start as debugging breadcrumbs. At scale, they become a distributed data pipeline: collect, clean up, store, search and retain only what earns its place.


Edit page
Share this post on:

Previous Post
How Do You Actually Use a GPU Fully?
Next Post
How Instagram's Algorithm Uses Ragebait to Predict User Behavior