5 ms·
Writing Runbook Documentation When You’re an SRE
- williamDafoe 7y agoThis is not a very good article. Here are some improvements. 1. Runbooks go out of date faster than anything. Therefore it is absolutely crucial to have the whole book on a single page and alerts vector to the proper subsection. Also pepper each section with a good set of keywords. This will allow users and newbies to easily search for procedures or related alerts when links invariably break. 2. Group related alerts ("host xyz down") in a single section with many section titles. One for each possible xyz. 3. Go ahead and put commandline commands in the runbook, in shell-command or code highlighted boxes (NEVER inside sentences). User defined fields should be delineated with $HOST etc (never <host>) and sample values for the vars given beforehand with sample output afterward. Never use a copyable $ to delineate shell commands. This creates the best possible user experience for people reusing your commands by cut and paste so they can more easily change values and so they know what to expect. 4. Link all relevant consoles in very small links (CPU usage in clusters: ym qf ij) including historical links to console views for past problems and how they look. 5. Section templates might look like this: 1.8. Too many cacheservers are down 1.8.1 Definition. This means that 25% of the hosts (on average) have been down over the past 10 minutes 1.8.2 Severity. Our load balancer will route all requests to surviving hosts and clients will retry on timeout so normally this is not severe (there is only a performance impact). However it could cascade due to RAM exhaustion or a query-of-death or due to a config push of broken software so assess the service right away for these problems. 1.8.2 Remediation ... Rollback or resource scaling or bypassing the cache service on the command line ... - Google search SRE
- mooreds 7y agoAgree 100% on clearly delineating the commands. Do you have any suggestions for keeping commands up to date? I don't understand your comment #4: "CPU usage in clusters: ym qf ij" Thanks for the great suggestions for improvement (disclosure, I work with the author and posted the link).
- joshuamorton 7y agoThey're being google-jargon-y. Replace "ym qf ij" with "us-east-1 us-west-1 eu-2" and each links to the monitoring console for aggregate cpu usage for the job in that region.
- phrotoma 7y agoThe value of $HOST vs <host> isn't jumping out at me. Can you elaborate?
- LukeShu 7y agoIt's about copy/paste-ability. If you're copy/pasting in to a terminal, with $HOST you can type HOST=myhost.tld first, then just paste, and everything will work. With <host>, if you paste the command without editing it, then it will do something different and write some files to disk (unless quoted).
- epicgiga 7y agoRunbooks are more of an anti-pattern than anything. A list of commands you should run to accomplish X -> that's a script. Or it should be. If accomplishing a task takes more than a single step, it means there's insufficient automation or programmability, and that's the problem you should fix, not teaching devs how to be better writers of prose. Code can be tested quickly and relatively easily. Docs can't. Docs should be as minimal as possible: "# Server ## Rebooting - ./scripts/server/reboot.sh". Any docs written by a dev should be run by an editor, who should strip them down to the bare minimum. Your typical readme is inundated with waffle, and the actual meat in it is wrong well over half the time. Automate everything.
- mooreds 7y ago> Automate everything. Whenever I see someone say something like this, I'm always curious about where human judgement and/or investigation comes in. Don't get me wrong, I'm happy to automate what can be automated if it makes sense (that is, the action can be easily turned into a script and the cost to create and maintain the automation is not higher than the value created) but aren't there plenty of areas where some level of human judgement is needed and you can't just automate everything? Isn't that kinda what SREs do? Develop intuition for what can be automated, automate what they can, set up process for what they can't?
- epicgiga 7y agoIn the context of docs/"runbooks", my point is you're not saving anything by doing that instead of scripting. You're going to pay for it in the long run when the docs quickly drift out of date and then people stop trusting them, and the docs have limited value anyway because they're just going to ask for your help in person instead 90% of the time (because that's 10x more effective). Scripts can have similar problems, but they're rapid and testable, so far easier to maintain their integrity. Where judgment is needed, i.e. unique cases, the runbooks won't help much anyway, and its up to the tech lead to work out why that problem happened once they've fixed it, and then either modify the system, or add a new script to fix that particular new problem if it arises again.
- 7y ago
- acvny 7y agoSRE is a scam
- andybak 7y agoSRE = Site Reliability Engineering apparently... Sigh...
- kureikain 7y agoI have been using this at work internally. Basically I write an app that parse a directory of markdown file. However, the code block is runnable. The code block is organize like this: ``` input: - name: description: - othervar: description: --- real shell code here ``` It adds a run button under the code block, when run, it parse the inputs to generate UI for input these parameter. Then it spin up a pod in kubernetes and run the script. We are already using Vault, so the script can access vault to get the secret it wants. It feels awesome because we put the link to runbook in pagerduty alert. It keeps the document and code in-sync. However, it's a kind of like a backdoor :-(. It essentially give shell access to entire infrastructure(Since it has Vault access). I tried hard to protect this tool but still feel uneasy about it. But without it I don't know how hard it is to keep code and document in-sync.