News for hackers. Stuff that matters.
Re:Think Prometheus, but for logs (not metrics). Simple, eff... by jedberg on Wednesday September 14, 2022 @12:25PM (#32839467)
I've been doing ops for a long time, and I can't remember the last time I looked at an historical log (edit: I'm referring to application logs specifically stored in a central location). When something is broken, I turn on logging and look at the logs in real-time. If something was broken in the past and no longer is, I turn on logging for that thing so that I have logs if it happens again.

The only use I can think of for historical logs is security auditing. In which case there is only a subset of logs you really need to trace a breach and they don't need to be searchable online -- you can pull them back from cold storage if you need to check for an incident.

Moving and storing logs and making them all instantly searchable is awfully expensive for little benefit.

Edit2: Disclaimer: This opinion does not apply to government regulated services like financial services.

Re:Think Prometheus, but for logs (not metrics). Simple, eff... by encoderer on Wednesday September 14, 2022 @12:32PM (#32839570)
Counter-point is that when a customer reports a problem I don’t want to have to say “can you try that again after I enable logging”.
Re:Think Prometheus, but for logs (not metrics). Simple, eff... by jedberg on Wednesday September 14, 2022 @12:34PM (#32839589)
When a customer reports a problem the first thing I try is to reproduce it (with logging on). If I can't reproduce it, does it matter? I can leave logging on and let them know I can't reproduce their problem but if it happens again to let me know.
Re:Think Prometheus, but for logs (not metrics). Simple, eff... by encoderer on Wednesday September 14, 2022 @12:36PM (#32839619)
In your background of consumer engineering, yes it probably does not matter. But it’s not the same in SaaS
Re:Think Prometheus, but for logs (not metrics). Simple, eff... by jedberg on Wednesday September 14, 2022 @12:42PM (#32839699)
I've worked in SaaS for years, and I don't have any examples in my history where that's the case. Do you have an example of a case where historical logging was the only way to track down a problem?
Re:Think Prometheus, but for logs (not metrics). Simple, eff... by encoderer on Wednesday September 14, 2022 @01:06PM (#32840066)
Yesterday I used logs to help a customer who had mis-configured their SAML SSO (the problem was on the IdP side). I use our database audit trail logs to understand the sequence of changes a customer makes that sometimes results in behavior that is surprising if you only look at the current state.

We put a big emphasis on the second S in SaaS and we want a magical 1-email support experience whenever possible. Audit logs help this.

Re:Think Prometheus, but for logs (not metrics). Simple, eff... by staticassertion on Wednesday September 14, 2022 @01:00PM (#32839980)
When do you turn the logs back off?
Re:Think Prometheus, but for logs (not metrics). Simple, eff... by jedberg on Wednesday September 14, 2022 @01:05PM (#32840043)
When the problem is verified solved.
Re:Think Prometheus, but for logs (not metrics). Simple, eff... by staticassertion on Wednesday September 14, 2022 @01:05PM (#32840059)
I can't imagine the logs are off very much of the time then
Re:Think Prometheus, but for logs (not metrics). Simple, eff... by jedberg on Wednesday September 14, 2022 @01:15PM (#32840185)
Well when you have microservices, hopefully only one or two of them need logging at a given time.
Re:Think Prometheus, but for logs (not metrics). Simple, eff... by carlmr on Wednesday September 14, 2022 @12:34PM (#32839601)
Exactly. Also sometimes you discover some issue and you want to see if this is never happened before, sometimes, often?

Depends really how long your customers can wait.

Re:Think Prometheus, but for logs (not metrics). Simple, eff... by jedberg on Wednesday September 14, 2022 @12:35PM (#32839612)
Logging is different than metrics. Metrics should tell you if a problem has happened in the past.
Re:Think Prometheus, but for logs (not metrics). Simple, eff... by macspoofing on Wednesday September 14, 2022 @12:36PM (#32839630)
You may have to. Debug logging can be very expensive to simply leave on in production.
Re:Think Prometheus, but for logs (not metrics). Simple, eff... by falcolas on Wednesday September 14, 2022 @12:53PM (#32839876)
You can also prune logs based on level at different time intervals.
Re:Think Prometheus, but for logs (not metrics). Simple, eff... by mjfisher on Wednesday September 14, 2022 @12:43PM (#32839719)
Really? We might be working in entirely different spheres and cultures, but I tend to look at (recently historical) logs pretty frequently for a bunch of reasons: helping to isolate infrequently encountered and hard to reproduce bugs, tracing individual resources/requests through a bunch of microservices to better understand some unique situation or behaviour, identifying whether a particular code path is actually in use and if so how heavily, etc etc.

They're particularly valuable for production issues. If something has gone wrong and alerts are pinging around, I appreciate the chance to figure out what it was from what the logs are telling me, rather than having to turn the logs on and try to trigger the same problem again deliberately in a production environment!

Edit: just realised who I was replying to. Netflix and Reddit might be very different environments with very different reliability requirements to a lot of other types of software.

Re:Think Prometheus, but for logs (not metrics). Simple, eff... by jedberg on Wednesday September 14, 2022 @12:50PM (#32839838)
> helping to isolate infrequently encountered and hard to reproduce bugs

As I mentioned in my post, that's the one case where I find value in temporary turning on logging, but having old logs around is awfully costly for the off chance that they help.

> tracing individual resources/requests through a bunch of microservices to better understand some unique situation or behaviour,

That's request tracing, which is different. Just storing a request trace is useful, but that's not what I mean by logging. I'm talking about server application logs.

> identifying whether a particular code path is actually in use and if so how heavily

Again that would be request tracing, not application logging.

> They're particularly valuable for production issues. If something has gone wrong and alerts are pinging around, I appreciate the chance to figure out what it was from what the logs are telling me, rather than having to turn the logs on and try to trigger the same problem again deliberately in a production environment!

If the problem doesn't happen again after you turn on logging, then the incident is over isn't it? The customer is no longer affected. If they are affected, then your logs will keep showing it.

Re:Think Prometheus, but for logs (not metrics). Simple, eff... by mjfisher on Wednesday September 14, 2022 @01:15PM (#32840187)
Gotcha. I think we're probably thinking about different kinds of environments - probably the key differentiation is the total volume of logs, the kinds of services we're monitoring, and how bad a given error is.

> Having old logs around is awfully costly for the off chance that they help.

Depends massively on the log volume. I've worked at places that generated terrabytes of logs over the course of a few days, and required very large ES clusters to try to keep on top of it. There was definitely value in having those logs, but it only made sense to retain them for a couple of weeks. It's much less costly for low volume services.

> ...request tracing, which is different...

Ye-es, until it's not. If your current setup isn't yet developed or grown enough to have full request tracing, you can get a long way filtering aggregated logs by a correlation ID. I know it's no substitute for a fully feature tracing system, but in situations where you have limited resourcing you need to prioritise it can get you a long way

> If the problem doesn't happen again after you turn on logging, then the incident is over isn't it? The customer is no longer affected.

That massively depends on the impact of the incident, I think. If it's a "There was a problem playing this title, please try again" kind of deal, it's no biggie.

If it's a "my broadcast TV channel is off air" or "my financial system has crashed in an unexpected way trying to reconcile this transaction" type situation, you might be a little more worried - and the customer is likely going to be very upset for quite a while, and some people with very serious faces might come to talk to you about very large fines.

Re:Think Prometheus, but for logs (not metrics). Simple, eff... by idunno246 on Wednesday September 14, 2022 @01:07PM (#32840070)
> Again that would be request tracing, not application logging.

from what ive seen people who rely on logs do not have proper request tracing and/or metrics. its much simpler to dump a bunch of unformatted junk to stdout and throw elasticsearch at it, but not a good experience.

i agree overall, i find logs to be a last resort with really bad signal to noise ratio.

Re:Think Prometheus, but for logs (not metrics). Simple, eff... by closeparen on Wednesday September 14, 2022 @01:02PM (#32840000)
As a software engineer responsible for building and operating various async and background workflows, I get a lot of inquiries like "I see cause X, why wasn't there side effect Y?" and I go and poke around the data to figure out what happened. Sometimes the cause didn't really happen, sometimes there are other criteria that the stakeholder wasn't thinking about that weren't met, sometimes the cause really happened but the data is missing or malformed upstream, and very occasionally my system errored out and dropped the ball. These are all deeply mysterious head-scratching issues if you don't have ready access to detailed logs.

More mundanely, if I get paged about an error rate, the first thing I'm going to do is look at the logs to see what the errors are.

Re:Think Prometheus, but for logs (not metrics). Simple, eff... by falcolas on Wednesday September 14, 2022 @01:02PM (#32840010)
I, and my peers, look at historical logs daily. Our customer response team is often looking at them on a minute-by-minute basis, and sets up alerts on them.

Our logs tell me the state of the application when the error occurred without having to reproduce it. They also tell me how many customers are having the issue, so we can set the severity of the incident at the appropriate level and reach out to those customers proactively if needed.

Sure, we might be able to do this with metrics or tracing instead, but that's often just duplicating information we're already logging. For example, by adding a correlation ID in my log metadata, I suddenly have end-to-end request tracing. It's not as pretty as what New Relic can produce, but it definitely works.

Re:Think Prometheus, but for logs (not metrics). Simple, eff... by AishwaryaVenkat on Friday September 23, 2022 @09:58AM (#32952036)
Ofcourse, If your business is growing, chances are, you are collecting more and more logs. Your log management process is ultimately slowing down your troubleshooting. Atatus provides you with hassle-free log management delivered as a fully managed cloud service. You don't have to set up and maintain it. This instantly cuts costs, reduces IT load and improves both the speed of troubleshooting and resolution of issues.
Re:Think Prometheus, but for logs (not metrics). Simple, eff... by Jugurtha on Wednesday September 14, 2022 @01:14PM (#32840183)
We used Sentry[0] and it saved us a lot of time digging into lots of logs to find out some exception that went unnoticed.

We still did rely on logs to troubleshoot and understand some issues.

- [0]: https://sentry.io