stasd & graphite - measure anything, measure everything

19
Measure Anything, Measure Everything StatsD & Graphite By Avi Revivo / 2015

Upload: avi-revivo

Post on 15-Feb-2017

257 views

Category:

Software


1 download

TRANSCRIPT

Page 1: StasD & Graphite - Measure anything, Measure Everything

Measure Anything, Measure EverythingStatsD & Graphite

By Avi Revivo / 2015

Page 2: StasD & Graphite - Measure anything, Measure Everything

New development checklist Code standards Comments Logic Error handling Testable code Logging What is missing?

Page 3: StasD & Graphite - Measure anything, Measure Everything

What about? Feature usage Performance Business KPIs

Page 4: StasD & Graphite - Measure anything, Measure Everything

So why is it not there?2 main reasons

Page 5: StasD & Graphite - Measure anything, Measure Everything

#1 ComplexityIt’s just not simple enough

Page 6: StasD & Graphite - Measure anything, Measure Everything

#2 Understanding the Developer’s Role“Dear Engineers, Your job is not to write code. I know. You think you were hired to write code. In fact, your entire interview process centered around how well you could write code. And I’m sure you do it really well.

But it’s not your job. Your job is to improve our product for our users.”

Blog post Link

Page 7: StasD & Graphite - Measure anything, Measure Everything

Let’s focus on complexityHow simple should it be? Dead simple!As simple as writing a log line…

Page 8: StasD & Graphite - Measure anything, Measure Everything

Meet StatsD A network service that runs on the Node.js that listens for statistics, like counters and timers, sent over UDP or TCP and sends aggregates to one or more pluggable backend services.

Page 9: StasD & Graphite - Measure anything, Measure Everything

Example: Sending a Metric

echo "foo:1|c" | nc -u -w0 127.0.0.1 8125

<metricname>:<value>|<type>

Page 10: StasD & Graphite - Measure anything, Measure Everything

Key Concepts Buckets - Each stat is in its own "bucket". They

are not predefined anywhere. Values - Each stat will have a value. Flush - After the flush interval timeout, stats are

aggregated and sent to an upstream backend service.

Page 11: StasD & Graphite - Measure anything, Measure Everything

Available Metric TypesCountin

g

gorets:1|c

Timing

glork:320|ms|@0.1

Gauges

gaugor:333|g

Sets

uniques:765|s

Sampling supported

Page 12: StasD & Graphite - Measure anything, Measure Everything

Meet Graphite An all-in-one solution for storing and visualizing realtime time-series data in an efficient manner.

Page 13: StasD & Graphite - Measure anything, Measure Everything
Page 14: StasD & Graphite - Measure anything, Measure Everything

Graphite ArchitectureGraphite

Web A powerful

dashboard for our metrics and

a powerful plotting API.

CarbonThe core of Graphite. It

consists of set of three processes that take care of

receiving incoming data, aggregating it

and persisting it to disk.

Whisper

An efficient time-series

based database.

Page 15: StasD & Graphite - Measure anything, Measure Everything

Understanding CarbonCarbon's job is to make that data available for real-time graphing immediately and try to get it stored on disk as fast as possible.It support configurable data persistency rules and full control over the way data is aggregated.

Page 16: StasD & Graphite - Measure anything, Measure Everything

Carbon Retention Rules

For a timespan of 6 hours I want to store my data in intervals of 10 seconds.

For a timespan of 7 days I want to store my data in intervals of 1 minute.

For a timespan of 1 year I want to store my data in intervals of 1 hour.

For a timespan of 5 year I want to store my data in intervals of 24 hours.

[counts]Pattern = \.count$ retentions = 10s:6h;1m:7d;1h:1y,1d:5y

Page 17: StasD & Graphite - Measure anything, Measure Everything

Carbon Aggregation Rules[sum]Pattern= \.count$aggregationMethod = sum

stats.app.users.logins.countstats.app.emails.sent.count

Avergage, Min, Max etc.

Page 18: StasD & Graphite - Measure anything, Measure Everything
Page 19: StasD & Graphite - Measure anything, Measure Everything

DEMO