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
メンテが命: PHPフレームワークのコンテナ化とアップグレード戦略
shunta27
0
330
CSS Linter による Baseline サポートの仕組み
ryo_manba
1
160
責務と認知負荷を整える! 抽象レベルを意識した関心の分離
yahiru
9
1.6k
はじめてのIssueOps - GitHub Actionsで実現するコメント駆動オペレーション
tmknom
2
360
iOSでQRコード生成奮闘記
ktcryomm
2
140
kintone開発を効率化するためにチームで試した施策とその結果を大放出!
oguemon
0
370
Introduction to C Extensions
sylph01
3
130
運用しながらリアーキテクチャ
nealle
0
200
Djangoにおける複数ユーザー種別認証の設計アプローチ@DjangoCongress JP 2025
delhi09
PRO
4
510
はじめての Go * WASM * OCR
sgash708
1
120
Google Cloudとo11yで実現するアプリケーション開発者主体のDB改善
nnaka2992
1
150
変化の激しい時代における、こだわりのないエンジニアの強さ
satoshi256kbyte
1
500
Featured
See All Featured
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
21
2.5k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
7.1k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
46
2.4k
The World Runs on Bad Software
bkeepers
PRO
67
11k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
32
2.2k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Bash Introduction
62gerente
611
210k
Docker and Python
trallard
44
3.3k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
11
550
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
233
17k
BBQ
matthewcrist
87
9.5k
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?