5 manas gupta - achieving common ground via logging

20
Achieving Common Ground via Logging

Upload: ngrepq

Post on 29-Jun-2015

1.587 views

Category:

Technology


0 download

DESCRIPTION

Achieving Common Ground via Logging Slides from - http://devopsdays.org/events/2013-newyork/proposals/Achieving%20common%20ground%20via%20Logging/

TRANSCRIPT

Page 1: 5   manas gupta - achieving common ground via logging

AchievingCommon Ground via

Logging

Page 2: 5   manas gupta - achieving common ground via logging

Second Class Citizens

Page 3: 5   manas gupta - achieving common ground via logging

Why?

Page 4: 5   manas gupta - achieving common ground via logging

Why?(?:(?:(?:\b(?:Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)?|May|Jun(?:e)?|Jul(?:y)?|Aug(?:ust)?|Sep(?:tember)?|Oct(?:ober)?|Nov(?:ember)?|Dec(?:ember)?)\b) +(?:(?:(?:0[1-9])|(?:[12][0-9])|(?:3[01])|[1-9])) (?:(?![0-9])(?:(?:2[0123]|[01][0-9])):(?:(?:[0-5][0-9]))(?::(?:(?:(?:[0-5][0-9]|60)(?:[.,][0-9]+)?)))(?![0-9]))) (?:(?:(?:\b(?:[0-9A-Za-z][0-9A-Za-z-]{0,62})(?:\.(?:[0-9A-Za-z][0-9A-Za-z-]{0,62}))*(\.?|\b))|(?(?![0-9])(?:(?:25[0-5]|2[0-4][0-9]|[0-1]?[0-9]{1,2})[.](?:25[0-5]|2[0-4][0-9]|[0-1]?[0-9]{1,2})[.](?:25[0-5]|2[0-4][0-9]|[0-1]?[0-9]{1,2})[.](?:25[0-5]|2[0-4][0-9]|[0-1]?[0-9]{1,2}))(?![0-9])))) (?(?(?:[\w._/%-]+))(?:\[(?\b(?:[1-9][0-9]*)\b)\])?): (?(?![0-9])(?:(?:25[0-5]|2[0-4][0-9]|[0-1]?[0-9]{1,2})[.](?:25[0-5]|2[0-4][0-9]|[0-1]?[0-9]{1,2})[.](?:25[0-5]|2[0-4][0-9]|[0-1]?[0-9]{1,2})[.](?:25[0-5]|2[0-4][0-9]|[0-1]?[0-9]{1,2}))(?![0-9])):(?(?:[+-]?(?:[0-9]+))) \[(?(?(?:(?:0[1-9])|(?:[12][0-9])|(?:3[01])|[1-9]))/(?\b(?:Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)?|May|Jun(?:e)?|Jul(?:y)?|Aug(?:ust)?|Sep(?:tember)?|Oct(?:ober)?|Nov(?:ember)?|Dec(?:ember)?)\b)/(?[0-9]+):(?(?![0-9])(?(?:2[0123]|[01][0-9])):(?(?:[0-5][0-9]))(?::(?(?:(?:[0-5][0-9]|60)(?:[.,][0-9]+)?)))(?![0-9])).(?(?:[+-]?(?:[0-9]+))))\] (?\S+) (?\S+)/(?\S+) (?(?:[+-]?(?:[0-9]+)))/(?(?:[+-]?(?:[0-9]+)))/(?\S+) (?\S+) (?\S+) (?(?:[+-]?(?:[0-9]+)))/(?(?:[+-]?(?:[0-9]+)))/(?(?:[+-]?(?:[0-9]+)))/(?(?:[+-]?(?:[0-9]+)))/(?\S+) (?(?:[+-]?(?:[0-9]+)))/(?(?:[+-]?(?:[0-9]+))))

Thank you @jordansissel

Page 5: 5   manas gupta - achieving common ground via logging

All good?

Yes. But...

DevOps

SupportProducts

Page 6: 5   manas gupta - achieving common ground via logging

Where to begin?

“Request Completed”

Masterzen - 10 Commandments of Logging

Page 7: 5   manas gupta - achieving common ground via logging

Context

Request (f67a) completed for user

George-Michael (token: weqeqweq)

to fakeblock in 3.16275 seconds.

Page 8: 5   manas gupta - achieving common ground via logging

Context

{ "msg": "Request completed", "runtime_s": 3.16275, "request": { "action": "fakeblock", "accessToken": "yjfhakfsf", "user": "George-Michael" }, "requestId": "f67a"}

Page 9: 5   manas gupta - achieving common ground via logging

Context + Correlation{ .... "msg": "Request completed", "runtime_s": 3.16275, "request": { "action": "faceblock", "accessToken": "yjfhakfsf", "user": "George-Michael" }, "requestId": "f67a", "host": "i-90zas2",}

{ ... "host": "load-balancer", "status": "200", "request": "POST /url/ HTTP/1.1", "http_user_agent": "iphone", "x_requestId": "f67a", "request_time": 3.9}

Page 10: 5   manas gupta - achieving common ground via logging

Ship them!

Page 11: 5   manas gupta - achieving common ground via logging

level : ‘error’

... and class : ‘mailer’

... and host : ‘i-8904’

Page 12: 5   manas gupta - achieving common ground via logging

action : ‘fakeblock’

... and runtime > 2.1

Page 13: 5   manas gupta - achieving common ground via logging

level : ‘error’

... and ...

... and ...

is count > threshold

Critical, Warn, OK?

Page 14: 5   manas gupta - achieving common ground via logging

Wait a sec...

{ "msg": "Request completed", "runtime_s": 3.16275, "request": { "action": "fakeblock", "accessToken": "yjfhakfsf", "user": "George-Michael" }, "requestId": "f67a"}

Page 15: 5   manas gupta - achieving common ground via logging

type : ‘user_log’and

user : ‘George-Michael’

Page 16: 5   manas gupta - achieving common ground via logging

“invalid identifier returned”

Page 17: 5   manas gupta - achieving common ground via logging

But we are a small team...

Page 18: 5   manas gupta - achieving common ground via logging

Defaults work well

• 40 GB index/day

• 3k events/sec indexed

• m1.xlarge x 2

• Chef Cookbook available

• pyes (ES Api in py)

Page 19: 5   manas gupta - achieving common ground via logging

Bonus

Page 20: 5   manas gupta - achieving common ground via logging

Thanks

Manas Gupta@ngrep_q