Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Designing For Disaster - Preparing Your Code For Emergencies

Designing For Disaster - Preparing Your Code For Emergencies

If there's a problem in production, would you know it had happened? How would you find out about it? How would you piece together what had happened? And how would you get the fix out the door?

In this talk, Stuart will look at how you can prepare your web app for when disaster strikes. He'll show you what information you need, and how to build that into your app as you go. He'll cover how to use that information to investigate and resolve problems, and give you some food for thought about releasing during an emergency.

Presented at the PHP North West user group in Manchester on 5th June, 2018.

Stuart Herbert

June 05, 2018
Tweet

More Decks by Stuart Herbert

Other Decks in Programming

Transcript

  1. Industry veteran: architect, engineer, leader, manager, mentor F/OSS contributor since

    1994 Talking and writing about PHP since 2004 Chief Software Archaeologist Building Quality @GanbaroDigital About Stuart
  2. @GanbaroDigital Three Desired Outcomes 1. Know That There Is A

    Problem 2. Know What The Problem is 3. Make Handling Disasters Normal
  3. @GanbaroDigital ?? ?? Do you use your website / app

    regularly enough to notice when things are down?
  4. @GanbaroDigital ?? ?? Will customers tell you there’s a problem

    ... ... or will they simply go elsewhere?
  5. @GanbaroDigital Who Talks To Customers? • ... different part of

    the building • ... different building • ... different timezone • ... different agenda
  6. @GanbaroDigital Who Talks To Customers? • ... different part of

    the building • ... different building • ... different timezone • ... different agenda
  7. @GanbaroDigital Who Talks To Customers? • ... different part of

    the building • ... different building • ... different timezone • ... different agenda
  8. @GanbaroDigital Who Talks To Customers? • ... different part of

    the building • ... different building • ... different timezone • ... different agenda
  9. @GanbaroDigital Common Metrics • Counters - how many times has

    an event happened? • Timers - how long is something taking to happen?
  10. @GanbaroDigital Web Server Metrics • Incoming requests • Response codes

    (HTTP 500 etc) • Response timings • Response sizes
  11. @GanbaroDigital PHP Fatal error: Uncaught Exception: Something went wrong in

    /tmp/ test.php:3 Stack trace: #0 {main} thrown in /tmp/test.php on line 3
  12. @GanbaroDigital 1. emerg 2. alert 3. crit 4. err 5.

    warning 6. notice 7. info 8. debug RFC 5424 Log Levels
  13. @GanbaroDigital Make this the params array used to build the

    ‘message’ field ... + any additional items you need.
  14. @GanbaroDigital Three Tracking Tokens 1. All log messages from a

    single business process 2. All log messages from a single request 3. All log messages from a single user