News for hackers. Stuff that matters.
Re:What I Learned Managing Site Reliability for Some of the ... by zwischenzug on Tuesday April 04, 2017 @12:43PM (#14034656)
'Documentation is generally a waste of time unless you have a very static infrastructure'

I definitely agree with that, and it's partly a corollary of 'documentation is expensive and requires costly maintenance'.

Run books/checklists are mostly implemented really really badly.

Automation is the ideal, but is costly, and itself requires maintenance.

Most of the steps we had to perform did not lend themselves to automation, also.

Re:What I Learned Managing Site Reliability for Some of the ... by jedberg on Tuesday April 04, 2017 @12:57PM (#14034810)
> Automation is the ideal, but is costly, and itself requires maintenance.

I would contend that the cost of automation is about the same as the cost of documentation plus the cost of having to manually do the work over an over. It's just a cost borne up front instead of over time. But to your point in the article, you have to have a culture that supports bearing that up front cost.

> Most of the steps we had to perform did not lend themselves to automation, also.

I don't understand how that is possible? Could you give an example of a task that can't be automated?

Re:What I Learned Managing Site Reliability for Some of the ... by zwischenzug on Tuesday April 04, 2017 @01:09PM (#14034967)
Your arguments contradict themselves - if the infrastructure is changing then there's little point spending the time automating your response to its failure.

Most attempts I've seen to automate tasks flounder for this reason.

Also, there's no point automating something that happens once a year - the cost will exceed the benefit. Hence the comments about decided which tasks to automate with a backlog and metrics.

Most anything _could_ be automated, eg 'Phone the customer and ask them to engage their network team', 'look for similar-looking strings', 'tcpdump the port, and see if the output is irregular', but is it really worth the effort to? That's where the backlog came in.

BTW I wrote a whole framework for automation

ianmiell.github.io/shutit/

and it's taught me a lot about the hidden costs of automation...

Re:What I Learned Managing Site Reliability for Some of the ... by jedberg on Tuesday April 04, 2017 @01:28PM (#14035175)
> Your arguments contradict themselves - if the infrastructure is changing then there's little point spending the time automating your response to its failure. Most attempts I've seen to automate tasks flounder for this reason.

If everything in your infrastructure is deployed with code, then automation is simply the act of making sure the infrastructure matches the deployment described in the code. It's true that automation is just as difficult if deployments are manual. Then remediation becomes changing the deployment code to fix a previously unknown problem, instead of manually fixing a problem. This then gains you the advantage of the problem being fixed in perpetuity.

So they aren't in contradiction if your remediation and deployment are the same process, because then it by definition is always up to date.

I guess I should add the caveat that deployment should be quick enough to solve problems via redeployment.

Re:What I Learned Managing Site Reliability for Some of the ... by eropple on Tuesday April 04, 2017 @06:15PM (#14037741)
FWIW, I agree with your overall notion of where one should go, but it's worth noting that you're describing an extremely optimistic world for probably 90% to 95% of shops. Which is not to say that it's a bad idea at all to get there, but incremental steps are important and they're what I feel are being described in this article (setting aside that that kind of pervasive automation wasn't really a thing outside of bleeding-edge shops at the time he was describing).

Shameless plug for people who are feeling inferior while reading this thread: as it happens, my consulting gigs revolve pretty heavily around doing exactly what 'jedberg has described, and it's super worth getting to that point. ;) Email's in the profile if you're looking to get there.

Re:What I Learned Managing Site Reliability for Some of the ... by geofft on Tuesday April 04, 2017 @02:05PM (#14035570)
Most of the environments I've worked at have been so far from being deployable with code that it would take you significant time and expense to get there, and in the meantime, you need to keep everything working. You need a reliability engineering team that knows how to triage problems and keep the existing system working while they automate what is feasible to automate. I'd probably agree that this is a separate mindset and skillset from keeping an infrastructure-as-code deployment running, and it's unfortunate that we don't have good terms to differentiate them. A lot of the SRE mindset applies, but not all of it.

For instance, if you've got machines at customer sites where you manage the software, commercial filers or appliances where you don't really have a shell and you certainly can't spin up a VM, etc., your machines aren't fungible. You can't just redeploy a machine, and just about every problem on the machine is going to be a new one. You want the runbook so that it enumerates how to stop and start things around a human intervention (and yeah, as much of that as possible should be automated), but you can't automate the whole thing without changing your architecture.

If you have the option of starting with an architecture where you don't have these problems, by all means take that option! Maybe do cloud-hosted SaaS instead of maintaining on-prem software for customers, or use some fancy cloud storage API instead of a physical old-school filer. But people who have the old-school architectures need to keep things running smoothly, too.

Re:What I Learned Managing Site Reliability for Some of the ... by munro on Tuesday April 04, 2017 @01:59PM (#14035504)
> Your arguments contradict themselves - if the infrastructure is changing then there's little point spending the time automating your response to its failure.

OP said automating runbooks, and any fixes to production--so the code becomes the documentation of how to deploy, and what exactly was done to remedy an error. OP did not say automating failure responses.

Which brings up OP's proposed question...

>> I don't understand how that is possible? Could you give an example of a task that can't be automated?

Could you give a concrete example? There's a vague reference in the article about automating responses for encoding errors which sounds interesting. It sounds like the system generates lots of server errors, and it's easier/cheaper to communicate them to customers directly instead of making code fixes.

Re:What I Learned Managing Site Reliability for Some of the ... by ekimekim on Tuesday April 04, 2017 @01:11PM (#14034985)
> I don't understand how that is possible? Could you give an example of a task that can't be automated?

"Check the logs for service X (they're here <link>) and look for anything related to the issue"

"If the user impact is high, write an update to the status page detailing the impact and an estimated time to recovery"

The value of a runbook is that it can make use of human intelligence in its steps. No-one is arguing that you shouldn't be automating things like "if the CPU usage is > 90%, spin up another instance and configure it".

Re:What I Learned Managing Site Reliability for Some of the ... by jedberg on Tuesday April 04, 2017 @01:31PM (#14035199)
> "Check the logs for service X (they're here <link>) and look for anything related to the issue"

I have a long missive about how logs are useless and shouldn't be kept, but that's for another time. I'll summarize by saying that if you have to look at logs, then your monitoring has failed you.

> If the user impact is high, write an update to the status page detailing the impact and an estimated time to recovery"

I guess technically that would be a step in a runbook, that's fair. Although in my case that was left to PR to do based on updates to the trouble tickets. :)

> The value of a runbook is that it can make use of human intelligence in its steps

I'd rather human intelligence be spent on triage by reading the results of automated diagnosis and coding up remediation software than on repeating steps in a checklist.

Sure, there are uses for checklists of things to check, but even that should be automated through the ticket system at the very least, which I no longer consider a runbook, but I guess some might still consider that a runbook.

Re:What I Learned Managing Site Reliability for Some of the ... by always_good on Tuesday April 04, 2017 @02:40PM (#14035914)

    > I have a long missive about how logs are useless
    > and shouldn't be kept, but that's for another time.
    > I'll summarize by saying that if you have to look 
    > at logs, then your monitoring has failed you.
Eh, I'm extremely wary of people who think they have a silver bullet to everything and can speak in absolutes like this.

I have to say, you have a tendency on HN to chime in from the peanut gallery and be a bit unrelenting and even combative because jedberg does things differently.

Re:What I Learned Managing Site Reliability for Some of the ... by jedberg on Tuesday April 04, 2017 @02:52PM (#14036009)
> I have to say, you have a tendency on HN to chime in from the peanut gallery and be a bit unrelenting and even combative because jedberg does things differently.

That's a fair critique, and thank you for pointing it out. I try to always back up what I say with the reasons for what I say, but sometimes I get lazy or don't have time to write it all out. I too worry about folks who speak in absolutes, although in this case I happen to actually believe it.

The medium isn't always the best way to have a deep technical discussion unfortunately.

Re:What I Learned Managing Site Reliability for Some of the ... by icebraining on Tuesday April 04, 2017 @01:52PM (#14035418)
I have a long missive about how logs are useless and shouldn't be kept, but that's for another time. I'll summarize by saying that if you have to look at logs, then your monitoring has failed you.

How does that work?

Re:What I Learned Managing Site Reliability for Some of the ... by jedberg on Tuesday April 04, 2017 @02:07PM (#14035594)
First we have to make the distinction between logs and metrics. Logs are unstructured or loosely structured text, whereas metrics are discrete items that can be put into a time series database.

If you emit metrics as necessary to a time series database, then you should be able to build alerting based on the time series metrics. Your monitoring systems should be good at building alerts based on a stream of metrics and visualizing the time series data.

Sometimes you might have to look at the visualizations to find something, but ideally you then set up an alert on the thing you looked at so you have the alert for the next time it happens. A great monitoring system lets you turn graphs into alerts right in the interface, so if you're looking at a useful graph you can make an alert out of it.

Sometimes logs can be useful, but only after your monitoring system has told you which system is not behaving, and then you can turn on logs for that system until you've solved the problem, but you shouldn't need access to old logs, because if the problem was only in the past, then it's not really a problem anymore, right? If you have an ongoing problem, then maybe have the logs on for that service while you're investing that problem, but then turn them off again.

But having a ton of logs always generating and being stored tend to be fairly useless in practice with a good time series database at hand.

Re:What I Learned Managing Site Reliability for Some of the ... by vacri on Tuesday April 04, 2017 @05:55PM (#14037591)
Logs have a much, much, much lower barrier to entry than a fully-complete time-series monitoring system that covers everything.

Likewise, turning logs on only after you've seen a problem means you miss out on troubleshooting the root cause of it - if there was a spike of badness this morning but you don't have logs for it, you're missing out on diagnostic information that may have protected you from repeats of that spike in future.

I've also had business guys want to analyse things like access logs in ways that they didn't know previously. Logs provide a datastore of historical activity, which in smaller shops is a cheap data lake.

Perhaps the 'no logs' thing works for your setup, but I think it's bad general advice. And your position is not that logs are useless ("turn on logs for that system until you've solved the problem"), but that retaining logs are useless - quite a significant difference between the two.

Re:What I Learned Managing Site Reliability for Some of the ... by jedberg on Tuesday April 04, 2017 @07:45PM (#14038348)
> And your position is not that logs are useless ("turn on logs for that system until you've solved the problem"), but that retaining logs are useless - quite a significant difference between the two.

That's an important distinction, one that I agree with, and I should make clearer.

Logs do have a purpose, but I'm not sure that retaining them does.

Sure, for a very small shop, throw them on a disk, use awk, sed, grep, and perl to look through them, and call it a day. But once you get to the point of "spinning up a cluster of log servers" or something like it, I'd say you're probably better off investing in monitoring instead.

Re:What I Learned Managing Site Reliability for Some of the ... by jsmthrowaway on Tuesday April 04, 2017 @07:54PM (#14038404)
Having a corpus of live "test" requests for rebuilding an API is a compelling enough use case to justify infinite retention, in my opinion. Perhaps relevantly to your prior gig: "did we handle that weird Sony Bravia API call from five years ago in this redesign? Yes we did." I'm implying a little more structure to logging, though, because it sounds like you're thinking about random strings emitted from binaries (which I think are also approachable, to an extent). This overlaps with PII and such, though, and there is no one-size-fits-all answer.

More than once I've run the entire corpus of requests to a system, ever, through a dummy rebuild as a pretty great integration test. It's a powerful SRE tool. Spelunking through all historical data is just icing on that cake, honestly. As the author says, SRE is basically just an information factory; I'd be haaaaaard pressed to agree with you on throwing away a lot of information -- you don't know what you don't know until you want to know it -- and betting all-in on monitoring. Retaining logs is not the hardest problem SRE deals with, either, but SREs turn around and force unrealistic latency requirements on the query side (I see a lot of ELK deploys running into this).

You have to look at it as an Oracle. Oh, great Oracle of a pile of meaningless logs, cook off this map/reduce and tell me an interesting number that I can put in a Keynote for executives. Definitely not dashboarding from logs data. That's an impedance mismatch that Google gets away with because of the nature of their logging.

Re:What I Learned Managing Site Reliability for Some of the ... by user5994461 on Tuesday April 04, 2017 @08:20PM (#14038570)
Splunking is cool.

Nonetheless, splunk is the most expensive software license on the planet. More than Oracle, yes.

Re:What I Learned Managing Site Reliability for Some of the ... by jsmthrowaway on Tuesday April 04, 2017 @08:24PM (#14038589)
I meant spelunking, where they got their name. But yes, you're not wrong. (I've heard of $millions.)
Re:What I Learned Managing Site Reliability for Some of the ... by zwischenzug on Wednesday April 05, 2017 @04:10AM (#14040544)
Some envs require logs to be kept for regulatory purposes.

Interestingly, we never used a cluster of log servers. I was always skeptical of their utility. It was grep, plus some hand-rolled utility scripts to interrogate. One was a thing of beauty I spent years on, which saved us a ton of time.

Re:What I Learned Managing Site Reliability for Some of the ... by user5994461 on Tuesday April 04, 2017 @08:16PM (#14038552)
> Logs have a much, much, much lower barrier to entry than a fully-complete time-series monitoring system that covers everything.

A monitoring system has a lower barrier to entry.

http://datadoghq.com/ => will do ALL of that and much more. You can deploy it in a few hours to thousands of hosts, no problem.

Direct competitor: http://signalfx.com/

Have no money to pay for high quality tool? graphite + statsd will do the trick for basic infrastructure. However it's single host, doesn't scale and only basic ugly graphs are supported.

Re:What I Learned Managing Site Reliability for Some of the ... by qohen on Wednesday April 05, 2017 @06:32PM (#14046275)
only basic ugly graphs are supported.

That's what Grafana [0][1] is for -- i.e. creating nicer displays for Graphite.

However it's single host, doesn't scale

It may take some effort, but it can be done, and much of the heavy-lifting seems to have been done and been made available as open-source.

Here's a blog post from Jan. 2017 [2] from a gambling site about scaling Graphite.

And here's a talk [3] from Vladimir Smirnov at Booking.com from Feb. 2017 about scaling Graphite -- their solution is open-source (links in the talk and slides available at the link):

This is our story of the challenges we’ve faced at Booking.com and how we made our Graphite system handle millions of metrics per second.

(And this [4] is an older, but more comprehensive, look at various approaches to scaling Graphite from the Wikimedia people with the pros and cons listed).

[0] https://grafana.com/

[1] https://github.com/grafana/grafana

[2] http://engineering.skybettingandgaming.com/2017/01/13/graphi...

[3] https://fosdem.org/2017/schedule/event/graphite_at_scale/

[4] https://wikitech.wikimedia.org/wiki/Graphite/Scaling

Re:What I Learned Managing Site Reliability for Some of the ... by user5994461 on Wednesday April 05, 2017 @07:37PM (#14046685)
Funny. Quoting companies from my home town.

It can be done but at what costs? Better get a tool that gets the job done out of the box and does it well.

For starters, if you're operating in the cloud, you cannot get servers with FusionIO drives and top notch SSD. That limits your ability to scale vertically.

Re:What I Learned Managing Site Reliability for Some of the ... by vacri on Tuesday April 04, 2017 @09:41PM (#14038970)
Datadog for thousands of hosts costs tens of thousands of dollars per month. That is not a low barrier. But if you're arguing for external vendors, then Papertrail is to logs what Datadog is to metrics. And having tried both Papertrail is easier and quicker to set up (though Datadog isn't difficult).

Similarly, basic infrastructure health is not giving you the same sort of information (what the software is actually doing) that logging does. In order to do time-series monitoring of your software rather than your system, you need to spend time thinking about what metrics you need to track and how you're going to obtain them.

I run both an ELK stack and a Prometheus stack, and I find they're good for different things.

Re:What I Learned Managing Site Reliability for Some of the ... by otisg on Wednesday April 05, 2017 @10:14PM (#14047395)
Any modern monitoring service will provide you with volume discounts if you have hundreds or thousands of servers.

Since you mention Papertrail specifically in the context of costs - Papertrail is actually a bit pricey relative to the competition. For example, compare https://papertrailapp.com/plans to https://sematext.com/logsene/#plans-and-pricing . I think Sematext Logsene is 2-3 times cheaper than Papertrail.

Lastly, I was at a Cloud Native Conference in Berlin last week. A lot of people have the same setup as you - ELK for logs + Prometheus for metrics. We're running Sematext Cloud where we ship both our metrics and our logs, so we can easily switch between metrics and logs much more easily, correlate, and troubleshoot faster. Seems a bit simpler than ELK+Prometheus...

Re:What I Learned Managing Site Reliability for Some of the ... by user5994461 on Wednesday April 05, 2017 @08:27AM (#14041561)
thousands of hosts costs hundreds of thousands of dollars. a few thousands more is a low barrier.

Sumologic, papertrail, logentries (and many more) for cloud logs. Graylog or ELK or Splunk for self hosted logs.

However, logs should never be send to the cloud, they are too sensitive information to outsource. Server metrics + stats are more reasonable.

Agree, stats and logs cover different things. Need both.

Re:What I Learned Managing Site Reliability for Some of the ... by otisg on Wednesday April 05, 2017 @10:07PM (#14047372)
Both metrics and logs are needed for the full picture (plus alerts and a few other things, like RUM and error/exception capture, both on front-end and backend).

Saying that logs should never be sent to the cloud is overly absolute. Some logs should indeed stay behind firewall, but lots of organizations have logs that can be shipped out to services whose features derive all kinds of interesting insights from logs.

Re:What I Learned Managing Site Reliability for Some of the ... by jakozaur on Thursday April 06, 2017 @04:46PM (#14054432)
Sumo Logic does both logs and metrics at reasonable cost. The log part is state of the art, the metric is recent addition.

Discalimer: I work at Sumo Logic and enjoy it.

Re:What I Learned Managing Site Reliability for Some of the ... by spyrosg on Tuesday April 04, 2017 @03:26PM (#14036305)
Given the low cost of long-term storage, if you have any auditing requirement, it's worth it to store lots of logs.
Re:What I Learned Managing Site Reliability for Some of the ... by jedberg on Tuesday April 04, 2017 @03:51PM (#14036532)
What about the cost of moving the logs to storage, and the infrastructure required to move them around and put them in storage? Especially if you have a micro services architecture.

Also the cost of the infrastructure to search the logs and view the logs.

Re:What I Learned Managing Site Reliability for Some of the ... by Zalastax on Tuesday April 04, 2017 @04:17PM (#14036776)
Remember that there are different sizes of deployments. For sites like Reddit or Netflix, logs becomes a burden since there's so much data. For smaller deployments it's possible that all logs can be aggregated on a single machine quite easily, and aggregating the logs is far more enjoyable than SSH:ing to each separate machine.

> Sometimes logs can be useful, but only after your monitoring system has told you which system is not behaving, and then you can turn on logs for that system until you've solved the problem, but you shouldn't need access to old logs, because if the problem was only in the past, then it's not really a problem anymore, right?

Some things happen rarely, but can still have large impact. E.g. Imagine a once a day job of moving files which fails twice a month, rendering those files inaccessible.

Re:What I Learned Managing Site Reliability for Some of the ... by otterley on Wednesday April 05, 2017 @01:12AM (#14039838)
Many shops don't keep logs around because we want to. We keep them because we have to. You might see things differently someday if you host data for customers and have to follow SOC2 and HIPAA requirements...
Re:What I Learned Managing Site Reliability for Some of the ... by deskamess on Tuesday April 04, 2017 @02:00PM (#14035515)
Automated diagnosis sounds like a time saver... What is your source material for automated diagnosis? i.e., how was it trained? Are there cases where an automated diagnosis could not be made for an incident and if so was manual recourse possible? How would you retrain the 'diagnosing app' to handle the new case?
Re:What I Learned Managing Site Reliability for Some of the ... by jedberg on Tuesday April 04, 2017 @02:16PM (#14035689)
> What is your source material for automated diagnosis? i.e., how was it trained?

Incident reviews. If something happened that wasn't covered, then it is added as an outcome of the incident review.

> Are there cases where an automated diagnosis could not be made for an incident and if so was manual recourse possible?

For sure. Manual recourse was to dig in and figure it out either with the command line or the monitoring system or whatever else.

> How would you retrain the 'diagnosing app' to handle the new case?

In most cases the "diagnosing app" was a dashboard on the monitoring system, with a set of relevant graphs, so you would add a new graph. There was also a tool that correlated graphs, so you could add a new graph and correlation.