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

Metrics and an application log: Your new best f...

Michael Heap
September 05, 2014

Metrics and an application log: Your new best friends

Do you remember the time you spent an afternoon putting print statements in your app trying to debug an issue and removed them before shipping the fix, only to add them back in a day later to work on another issue? Wouldn't it be great if those debug statements could just stay in your code forever? Like a little gift that keeps on giving, not just for you, but for everyone else on your team too.

That's what an application log is for! Logs aren't just for when things go wrong. They're for helping you to keep track of what's going on within your application.

We take a look at how you can add helpful messages throughout your codebase and leave them there, even in production! We'll cover common logging strategies, log aggregation and how to efficiently work with your logs to get the data back out again.

We'll also take a look at metrics solutions such as Graphite that can help augment your logs to help work out what was going on by correlating event logs with peaks/drops in other monitoring systems.

Michael Heap

September 05, 2014
Tweet

More Decks by Michael Heap

Other Decks in Technology

Transcript

  1. External API API API API API API API API API

    API API API API API API API Internal
  2. External API API API API API API API API API

    API API API API API API API API API API API API API API API Internal
  3. External API API API API API API API API API

    API API API API API API API API API API API API API API API API API API API Internal
  4. External API API API API API API API API API

    API API API API API API API API API API API API API API API API API API API API API API Internal
  5. Why do we need to log? How should we log

    it? What should we log? Logging considerations Searching logs Gathering metrics
  6. Why do we need to log? How should we log

    it? What should we log? Logging considerations Searching logs Gathering metrics
  7. Why do we need to log? How should we log

    it? What should we log? Logging considerations Searching logs Gathering metrics
  8. Why do we need to log? How should we log

    it? What should we log? Logging considerations Searching logs Gathering metrics
  9. Why do we need to log? How should we log

    it? What should we log? Logging considerations Searching logs Gathering metrics
  10. Why do we need to log? How should we log

    it? What should we log? Logging considerations Searching logs Gathering metrics
  11. Why do we need to log? How should we log

    it? What should we log? Logging considerations Searching logs Gathering metrics
  12. Why do we need to log? How should we log

    it? What should we log? Logging considerations Searching logs Gathering metrics
  13. Why do we need to log? How should we log

    it? What should we log? Logging considerations Searching logs Gathering metrics
  14. Why do we need to log? How should we log

    it? What should we log? Logging considerations Searching logs Gathering metrics
  15. Why do we need to log? How should we log

    it? What should we log? Logging considerations Searching logs Gathering metrics
  16. 222.46.83.112 - - [21/Jan/2013:16:41:38 -0800] "GET / HTTP/1.1" 200 935

    "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)"
  17. {"@source" "@tags" "@fields" => "file://example.com/var/httpd/access.log", => [], => { "clientip":

    [ "222.46.83.112" ], "ident": [ "-" ], "auth": [ "-" ], "timestamp": [ "21/Jan/2013:16:41:38 -0800" ], "verb": [ "GET" ], "request": [ "/" ], "httpversion": [ "1.1" ], "response": [ "200" ], "bytes": [ "935" ], "referrer": [ "\"-\"" ], "agent": [ "\"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)\"" ] }, "@timestamp" "@source_host" "@source_path" "@message" 935 - Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)", "@type" => "web"}
  18. Why do we need to log? How should we log

    it? What should we log? Logging considerations Searching logs Gathering metrics
  19. Why do we need to log? How should we log

    it? What should we log? Logging considerations Searching logs Gathering metrics