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 on a budget
Search
C J Silverio
June 03, 2016
Programming
2
280
Monitoring on a budget
How npm does monitoring & metrics on a budget.
C J Silverio
June 03, 2016
Tweet
Share
More Decks by C J Silverio
See All by C J Silverio
The economics of package management
ceejbot
4
1.5k
The future of (javascript) modules (in node)
ceejbot
1
280
Keeping JavaScript safe
ceejbot
3
410
ceej's how to solve it
ceejbot
6
760
work-life balance at npm
ceejbot
5
780
hash functions and you!
ceejbot
2
350
The accidental noder
ceejbot
2
140
Design Patterns & Modularity in the npm Registry
ceejbot
3
180
Cheating Gall's Law: MediterraneaJS edition
ceejbot
4
330
Other Decks in Programming
See All in Programming
PHPとAPI Platformで作る本格的なWeb APIアプリケーション(入門編) / phpcon 2024 Intro to API Platform
ttskch
0
390
Simple組み合わせ村から大都会Railsにやってきた俺は / Coming to Rails from the Simple
moznion
3
2.2k
非ブラウザランタイムとWeb標準 / Non-Browser Runtimes and Web Standards
petamoriken
0
430
GitHub CopilotでTypeScriptの コード生成するワザップ
starfish719
26
6k
Запуск 1С:УХ в крупном энтерпрайзе: мечта и реальность ПМа
lamodatech
0
950
QA環境で誰でも自由自在に現在時刻を操って検証できるようにした話
kalibora
1
140
chibiccをCILに移植した結果 (NGK2025S版)
kekyo
PRO
0
130
asdf-ecspresso作って 友達が増えた話 / Fujiwara Tech Conference 2025
koluku
0
1.4k
Jaspr Dart Web Framework 박제창 @Devfest 2024
itsmedreamwalker
0
150
“あなた” の開発を支援する AI エージェント Bedrock Engineer / introducing-bedrock-engineer
gawa
4
250
毎日13時間もかかるバッチ処理をたった3日で60%短縮するためにやったこと
sho_ssk_
1
550
DevFest - Serverless 101 with Google Cloud Functions
tunmise
0
140
Featured
See All Featured
Java REST API Framework Comparison - PWX 2021
mraible
28
8.3k
Code Reviewing Like a Champion
maltzj
521
39k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3.1k
Documentation Writing (for coders)
carmenintech
67
4.5k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
98
18k
GitHub's CSS Performance
jonrohan
1030
460k
Being A Developer After 40
akosma
89
590k
Unsuck your backbone
ammeep
669
57k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
2k
A Philosophy of Restraint
colly
203
16k
Faster Mobile Websites
deanohume
305
30k
Transcript
monitoring on a budget
a few animated gifs with the Twelfth Doctor (0 cats)
C J Silverio vp of engineering, @ceejbot
let's talk npm by the numbers
205 million packages Tuesday 10K requests/sec
npm is 25 people 4 of us run the registry
when the company was formed 5 people total
you outsource many services when you're tiny
you pull them back in-house when you succeed
success is sometimes a catastrophe
npm's scale: runaway success npm's staff: wouldn't this be neat
mission: know this on a budget
None
2 questions: is the registry up? how well is it
performing?
is the registry up? monitoring
how well is it performing? metrics
monitoring
monitoring == pull ask questions that you know the right
answers for
Is this host up? Is this cert about to expire?
Is the DB replication keeping up?
if you get the wrong answer somebody gets paged
nagios state of the art in free
None
It's okay. We never look at it. It just triggers
Pager Duty.
nagios’s virtues: reliability & custom checks
goal: never page anybody
self-healing checks automate the fix if you can!
monitoring == unit tests a ratchet for continuous improvement
external monitoring ping services
you must monitor but that's just the start
monitoring tells you what it doesn't tell you why
metrics
Q: What's a metric? A: A name + a value
+ a time.
counter: it happened N times gauge: it's Y-sized right now
rate: it's happening N times/second timing: it took X milliseconds
metrics == push the app gives you numbers
emit from a service store in timeseries db query &
graph
the usual stack statsd ➜ graphite ➜ grafana
None
None
statsd uses UDP
Q: Why not send metrics over UDP? A: You care
about receiving them.
just try to install graphite
for-pay/SAAS services exist but I can't afford them
monitoring 400 processes right now 12+ GB of log data
a day
interlude: when should you pay?
convert the £$€ cost into engineer hours/month
pay when it's cheaper than investing an engineer (be honest
about the cost)
numbat was born “How hard can it be?” I said.
None
https://github.com/ numbat-metrics numbat - powered metrics
None
npm’s stack numbat ➜ influxdb ➜ grafana
var Emitter = require('numbat-emitter'); var emitter = new Emitter({ uri:
'tcp://localhost:3333', app: 'www', }); process.emit('metric', { name: 'request.latency', value: 30 }); process.emit('metric', { name: 'disk.used.percent', value: 36 }); process.emit('metric', { name: 'login' });
so easy to emit a metric that we just do
it any time something interesting happens
4000 metrics/sec from the registry
None
None
None
None
metrics ➜ alerts
Server handling expected traffic? Latency higher than normal? Error rate
higher than usual?
metrics comprise a data stream send the stream to more
than one place!
anomaly detection
recap time!
your web apps are backed by something
what's it up to? how do you know?
get data on what your services are up to
what: monitoring yes/no questions
why: metrics data changing over time
next: anomaly detection predictions & trends
automate don't require humans
npm install -g npm@latest @ceejbot on all the things npm
loves you