Live data from Hacker News

Logging sucks

loggingsucks.com

151–160 of 232 posts

Re: Logging sucks

#151
"Today, a single user request might touch 15 services, 3 databases, 2 caches, and a message queue."

This right here is the fundamental problem because the way it's done is highly inefficient, complex and I believe only exists so cloud providers can sell their expensive offerings.

A monolith is fine 90% of the time.

Re: Logging sucks

#152
Logging is one tool of many, you need logs, metrics and distributed tracing at the very least for any significant piece of modern infra.

If you really want to get serious, you also want some kind of continuous profiling (like pyroscope) or at the very least some periodic thread dump collector (for serious degradation diagnostics once every couple of minutes is enough).

But logging is still a great tool.

Re: Logging sucks

#153
post #151

"Today, a single user request might touch 15 services, 3 databases, 2 caches, and a message queue." This right here is the fundamental problem because the way it's done is highly inefficient, complex and I believe only exists so cloud providers can sell their expensive offerings. A monolith is fine 90% of the time.

That, and everyone thinks they have to do things this way, so it’s a terrible cycle.

So many problems would be solved if service calls were IPC instead of network calls.

Re: Logging sucks

#154

> Here's the mental model shift that changes everything: Instead of logging what your code is doing, log what happened to this request. Yeah that doesn't magically fix everything. Logging is still an arbitrary, clunky, unintuitive process that requires intentional design and extra systems to be useful. The "Wide Event log" example is 949 bytes, which isn't unmanageably large, but it is 3x larger than most log message…

ClickHouse is a tiny component - a single binary that runs on a laptop.

Re: Logging sucks

#155
post #126

I hope registering an entire domain name for a blog post doesn't become a trend. I like linking to things that are likely to last a long time - a personal blog is one thing, but expecting people to keep paying the renewal fee every year for a single article feels less likely to me. A good alternative here is subdomains, since those don't have an additional annual fee. https://logging-sucks.boristane.com/ could work w…

I kind of agree, but the message in this particular post does border on https://simonwillison.net/2024/Jul/13/give-people-something-...

Re: Logging sucks

#157
post #136
post #109

Earlier quoted context omitted.

> These do not have to be separate services, but they are separate enough to warrant it. All of this arises from your failure to question this basic assumption though, doesn't it?

> All of this arises from your failure to question this basic assumption though, doesn't it? Haha, no. "All of this" is a scenario I consider quite realistic in terms of what needs to happen. The question is, how should you split this up, if at all? Mind that these concerns will be involved in other ways with other requests, serving customers and internal users. There are enough different concerns at different levels…

I don't think I was rude. You're overcomplicating the architecture here for no good reason. It might be common to do so, but that doesn't make it good practice. And ultimately I think it's your job as a professional to question it, which makes not doing so a form of 'failure'. Sorry if that seems harsh; I'm sharing what I believe to be genuine and valuable wisdom.

Happy to discuss why you think this is all necessary. Open to questioning assumptions of my own too, if you have specifics.

As it is, you're just quoting microservices dogma. Your auth service doesn't need a different programming language from your invoicing system. Nor does it need to be scaled independently. Why would it?

Re: Logging sucks

#158
Google solved most of these problems around 2005, with tools like LOG_EVERY_N (now part of absl [1]), Dapper [2], and several other tools that aren't public yet. You can trace an individual request through every internal system, view the request/response protobufs, every log that the server emitted, timing details, etc. More to the point, you can share this trace, which means that it's possible for one person to discover the bug, reproduce it, and then have another person in a completely different office/timezone/country debug it, even if the latter cannot reproduce the bug themselves. This has proved hugely useful; just last week I was tasked with reproducing a bug on sparsely-available prerelease hardware so that a distant team could diagnose what went wrong.

The key insight that this article hints at but doesn't quite get too: you should treat your logs as a product whose customers are the rest of the devs in your company. The way you log things is intimately connected with what you want to do with them, and you need to build systems to generate useful insights from the log statements. In some cases it literally is part of the product: many of the machine learning systems that generate recommendations, search results, spam filtering, abuse detection, traffic direction, etc. are all based on the logs for the product, and you need to consider them as first-class citizens that you absolutely cannot break while adding new features. Logs are not just for debugging.

[1] https://absl.readthedocs.io/en/latest/absl.logging.html

[2] https://research.google/pubs/dapper-a-large-scale-distribute...

Re: Logging sucks

#159
post #83
post #72

Earlier quoted context omitted.

On the other hand, investing in better tracing tools unlocks a whole nother level of logging and debugging capabilities that aren't feasible with just request logs. It's kind of like you mentioned with using the user id as a "trace" in your first message but on steroids.

These tools tend to be very expensive in my experience unless you are running your own monitoring cloud. Either you end up sampling traces at low rates to save on costs, or your observability bill is more than your infrastructure bill.

We self host Grafana Tempo and whilst the cost isn’t negligible (at 50k spans per second), the money saved in developer time when debugging an error, compared to having to sift through and connect logs, is easily an order of magnitude higher.

Re: Logging sucks

#160

While I agree with some of it, I feel like there's a big gotcha here that isn't addressed. Having 1 single wide event, at the end of a request, means that if something unexpected happens in the middle (stack overflow, some bug that throws an error that bypasses your logging system, lambda times out etc...) you don't get any visibility into what happens. You also most likely lose out on a lot of logging frameworks you…

Having logs in the format "connection X:Y accepted at Z ns for http request XXX" and then a "connection X:Y closed at Z ns for http response XXX" is rather nice when debugging issues on slow systems.
Post reply on HN