Slide 1

Slide 1 text

SENTRY Ash Wu 2012.11.09 12年11月7⽇日星期三

Slide 2

Slide 2 text

Sentry? 12年11月7⽇日星期三

Slide 3

Slide 3 text

Sentry Stan Lee 最早原創的 Marvel 英雄 12年11月7⽇日星期三

Slide 4

Slide 4 text

Sentry ⾼高中時喝下神秘藥劑 擁有了⼀一百萬個太陽 爆炸的能量(汗) 12年11月7⽇日星期三

Slide 5

Slide 5 text

強到爆炸 12年11月7⽇日星期三

Slide 6

Slide 6 text

Sentry Exceptional error aggregation Developed by DISQUS in 2010 Open source Cloud service: http://getsentry.com 12年11月7⽇日星期三

Slide 7

Slide 7 text

Error Aggregation? 12年11月7⽇日星期三

Slide 8

Slide 8 text

Error Aggregation? Multiple and massive servers, log files 12年11月7⽇日星期三

Slide 9

Slide 9 text

Error Aggregation? Client side logger: iOS, Android, browsers...etc. 12年11月7⽇日星期三

Slide 10

Slide 10 text

Error Aggregation? Management, analysis 12年11月7⽇日星期三

Slide 11

Slide 11 text

What is Sentry? 12年11月7⽇日星期三

Slide 12

Slide 12 text

Sentry is... A web service with RESTful API Provides real-time web interface 12年11月7⽇日星期三

Slide 13

Slide 13 text

Sentry supports... Python PHP Java Ruby JavaScript, Node.js Other unofficial clients: iOS... 12年11月7⽇日星期三

Slide 14

Slide 14 text

Extensibility Easy to write a client for any language/platform Parse DSN, build JSON, post with authentication headers Write plugins in Python Unified Interface ex: message, exception, stacktrace... 12年11月7⽇日星期三

Slide 15

Slide 15 text

Scale? Queue and workers mode (db, redis) Redis backend update buffers UDP server avoiding single point of failure Just like how you scale any web services... BTW you shouldn’t have such a high concurrency of errors 12年11月7⽇日星期三

Slide 16

Slide 16 text

Server Usage sentry start http #start http server sentry start udp #start udp server Again, we could use supervisord to run sentry as a daemon. 12年11月7⽇日星期三

Slide 17

Slide 17 text

Client Usage Setup client with DSN Override the origin error handler Capture a message/exception Add tags you want 12年11月7⽇日星期三

Slide 18

Slide 18 text

PHP Example 12年11月7⽇日星期三

Slide 19

Slide 19 text

Other Example Javascript: window.onerror Obj-C: NSSetUncaughtExceptionHandler 12年11月7⽇日星期三

Slide 20

Slide 20 text

Capture message Capture a message or exception Try/catch block Special case ex: third-party service unavailable 12年11月7⽇日星期三

Slide 21

Slide 21 text

Event Id You’ll get a unique “event_id” whenever you capture a msg/exception You could display a error page with this id to user They’ll come up with this id and we could find it’s error very easily. Or not. 12年11月7⽇日星期三

Slide 22

Slide 22 text

Tags Add tags when... Client init Capture a message/exception For instance... Env? production or develop? App version? 1.1.4? 1.1.5? 12年11月7⽇日星期三

Slide 23

Slide 23 text

Web Interface 12年11月7⽇日星期三

Slide 24

Slide 24 text

12年11月7⽇日星期三

Slide 25

Slide 25 text

12年11月7⽇日星期三

Slide 26

Slide 26 text

Q & A Special Thanks to @TiberiusTeng 12年11月7⽇日星期三

Slide 27

Slide 27 text

Thank You 12年11月7⽇日星期三