Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Monitoring and Logging on Doorbell.io
Search
Philip Manavopoulos
June 11, 2014
Programming
2
500
Monitoring and Logging on Doorbell.io
Philip Manavopoulos
June 11, 2014
Tweet
Share
Other Decks in Programming
See All in Programming
ローコードSaaSのUXを向上させるためのTypeScript
taro28
1
630
macOS でできる リアルタイム動画像処理
biacco42
9
2.4k
PHP でアセンブリ言語のように書く技術
memory1994
PRO
1
170
レガシーシステムにどう立ち向かうか 複雑さと理想と現実/vs-legacy
suzukihoge
14
2.3k
NSOutlineView何もわからん:( 前編 / I Don't Understand About NSOutlineView :( Pt. 1
usagimaru
0
340
聞き手から登壇者へ: RubyKaigi2024 LTでの初挑戦が 教えてくれた、可能性の星
mikik0
1
130
受け取る人から提供する人になるということ
little_rubyist
0
250
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
120
Laravel や Symfony で手っ取り早く OpenAPI のドキュメントを作成する
azuki
2
120
とにかくAWS GameDay!AWSは世界の共通言語! / Anyway, AWS GameDay! AWS is the world's lingua franca!
seike460
PRO
1
900
Macとオーディオ再生 2024/11/02
yusukeito
0
380
Compose 1.7のTextFieldはPOBox Plusで日本語変換できない
tomoya0x00
0
200
Featured
See All Featured
Optimising Largest Contentful Paint
csswizardry
33
2.9k
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
The Invisible Side of Design
smashingmag
298
50k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
Building Adaptive Systems
keathley
38
2.3k
10 Git Anti Patterns You Should be Aware of
lemiorhan
655
59k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Automating Front-end Workflow
addyosmani
1366
200k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
Optimizing for Happiness
mojombo
376
70k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
28
2k
How STYLIGHT went responsive
nonsquared
95
5.2k
Transcript
Monitoring(and(Logging(on( Doorbell.io !@manavo
What%is%Doorbell.io
The$Stack LAMP%with: • PHP$5.5,$using$Laravel$4 • Memcache • Beanstalkd$(message$queue) • Mashape$(3rd$party$APIs$like$senDment$analysis)
• Mandrill/Mailgun$(sending/receiving$emails) • Twilio$(sending$SMS)
Logging&and&Monitoring&101 • Knowing(when(the(site(is(unreachable • Logging(uncaught(PHP(and(JS(errors • Finding(breaking(changes(from(libraries • Making(sure(the(Queue(processor(will(always(be( running
Logging&and&Monitoring&101 • Knowing(when(the(site(is(unreachable Pingdom • Logging(uncaught(PHP(and(JS(errors • Finding(breaking(changes(from(libraries Sentry,.New.Relic •
Making(sure(the(Queue(processor(will(always(be( running Supervisor
Case%study%#1:%Queues
Queues%in%Laravel Queue::push( 'SendEmail@send', array('thread_id' => 2) ); OR Queue::push(function($job) use
($id) { Account::delete($id); $job->delete(); });
Queues%in%Doorbell.io%.%New%feedback 1. Queue&closure 2. Closure&loops&through&email&addresses&to&no7fy 3. Send&email 4. Delete&job
Problem(#1:(Dele-ng(the(job(at(the(end // Done with the job, delete it $job->delete(); If#an#error#occurs,#the#job#never#gets#deleted.
There%was%no%maximum%number%of%tries. So#it#runs#again,#and#again,#and#again,#and#again,# and....
Problem(#1(solu-on Quick&fix: 1. Manually)delete)job)from)Queue 2. Stop)using)the)Queue)for)this)specific)problem Long%term*fix: Figure'out'why'the'Queue'processor'failed
Problem(#2 A"good"message:
Problem(#2 A"bad"message: This%means%Greek%in%the%serialized%data...
Which%leads%to... Blocked(Queue Saved&by Because'CPU'usage'was'100%
Moral&of&the&story Moved&the&$job->delete()&call&to&the&top&of&the& func0on,&so&it&won't&keep&retrying&forever Make%sure%you%fix%the%root%cause%of%the%problem,%or% you'll%have%the%same%thing%happening%again
Case%study%#2:%External%services
Case%study%#2:%External%services • Easily(add(func.onality(to(applica.on((sen.ment( analysis,(etc) • They(break,(and(it's(out(of(your(control
Examples • Sen%ment(analysis(failed(occasionally • Incoming(webhooks(from(Mailgun(failed • FogBugz(makes(a(change(to(authen%ca%on
Updated'Stack • Pingdom • New,Relic • Sentry • Supervisor •
Papertrailapp.com • Custom0dashboard
Papertrail
Logging&in&PHP Good$library$to$use:$Monolog h4ps:/ /github.com/Seldaek/monolog
Custom'Dashboard Basic,'but'enough'to'see'threads'with'no'sen3ment.
Moral&of&the&story Logs%hosted%on%a%server%don't%allow%you%to%be%reac5ve
Case%study%#3:%Your%own%bugs,%and% mysteries
Example(#1:(Innocent(looking(commit Saves&making&a&query&to&the&sen3ment&analysis&API
Reality(of(commit Hard%coded%every%new%feedback%thread%to%be% posi5ve,%without%analyzing... Which%leads%to:
Example(#2:(Stuck(queue,(New(Relic(doesn't( report(CPU(100% For$reasons$s)ll$unknown$to$me,$the$queue$got$stuck,$ and$didn't$know$it. This%means: • Not%running%sen-ment%analysis • No%email%no-fica-ons%sent%for%new%feedback% threads%or%replies
Even%worse... People&reported&on&Doorbell&itself&the&bug,&and&I&got& no&no6fica6on...
Report'#1
Report'#2
Solu%on'#1:'Charts Replies'per'day
Solu%on'#1:'Charts Sen$ment'analysis'of'new'threads'per'day'now
Solu%on'#1:'Charts Sen$ment'analysis'of'new'threads'per'day'before'fix
Solu%on'#2:'Extend'Custom'Dashboard
Solu%on'#3:'Email'report'cron Cron%running%every%10%minutes,%le3ng%me%know%if%the% queue%is%not%empty.
Conclusion • It$is$necessary • Good$monitoring/logging$is$possible$on$a$budget • Reac8ve$not$proac8ve • Peace$of$mind
Ques%ons?