30
Erlang Application Metrics with Folsom Joe Williams (@williamsjoe) Boundary (@boundary / boundary.com) Friday, March 30, 12

Erlang Application Metrics with Folsom

Embed Size (px)

Citation preview

Page 1: Erlang Application Metrics with Folsom

Erlang Application Metrics with Folsom

Joe Williams (@williamsjoe)

Boundary (@boundary / boundary.com)

Friday, March 30, 12

Page 2: Erlang Application Metrics with Folsom

Who Am I?

• Joe Williams

• @williamsjoe

• Ops at Boundary

Friday, March 30, 12

Page 3: Erlang Application Metrics with Folsom

What is Boundary?

• Realtime Monitoring and Analytics Platform

• We’re hiring!

• TRY MY PRODUCT

Friday, March 30, 12

Page 4: Erlang Application Metrics with Folsom

Agenda

• Current and Future Monitoring Systems

• Define “Application Metrics”

• What is Folsom?

• How do you use Folsom?

Friday, March 30, 12

Page 5: Erlang Application Metrics with Folsom

Legacy Monitoring Tools

• Consumers of application metrics

• Munin, Ganglia, etc

• Wide variety of protocols, interfaces and formats

• Usually RRD, results in inflexible, infrequently refreshed PNGs on HTML

• Not what this talk is about.

Friday, March 30, 12

Page 6: Erlang Application Metrics with Folsom

Current Monitoring Tools

• Consumers of application metrics

• OpenTSDB, statsd, Rienmann, etc are a steps in the right direction

• Hopefully fewer protocols, interfaces and formats

• Realtime, dynamic graphing

• Not what this talk is about.

Friday, March 30, 12

Page 7: Erlang Application Metrics with Folsom

Application Metrics

• “.. code generates business value when it runs.” ~ Coda Hale

Friday, March 30, 12

Page 8: Erlang Application Metrics with Folsom

Application Metrics

• Code instrumentation

• Write code to measure code

• Verify code behaves as you expect

• Exporting results of instrumentation

• General VM health

Friday, March 30, 12

Page 9: Erlang Application Metrics with Folsom

Folsom

• Application-level metrics

• Multiple metric types

• Powerful statistical analysis

• Easily extensible

Friday, March 30, 12

Page 10: Erlang Application Metrics with Folsom

Folsom

DEMO!

Friday, March 30, 12

Page 11: Erlang Application Metrics with Folsom

Metric Types• Counters

• Gauges

• Histograms

• Histories

• Meters

• Erlang VM Metrics

Friday, March 30, 12

Page 12: Erlang Application Metrics with Folsom

Counters

• Counter metrics provide increment and decrement capabilities for a single scalar value.

Friday, March 30, 12

Page 13: Erlang Application Metrics with Folsom

Counters

> folsom_metrics:new_counter(Name).> folsom_metrics:notify({Name, {inc, Value}}).> folsom_metrics:notify({Name, {dec, Value}}).

Friday, March 30, 12

Page 14: Erlang Application Metrics with Folsom

Gauges

• Gauges are point-in-time single value metrics.

Friday, March 30, 12

Page 15: Erlang Application Metrics with Folsom

Gauges

> folsom_metrics:new_gauge(Name). > folsom_metrics:notify({Name, Value}).

Friday, March 30, 12

Page 16: Erlang Application Metrics with Folsom

Histograms

• Histograms are collections of values that have statistical analysis done to them, such as mean, min, max, kurtosis and percentile.

• The can be used like "timers" as well with the timed update functions.

Friday, March 30, 12

Page 17: Erlang Application Metrics with Folsom

Histograms

> folsom_metrics:new_histogram(Name). > folsom_metrics:histogram_timed_update(Name, Mod, Fun, Args).

> folsom_metrics:histogram_timed_update(Name, Fun, Args). > folsom_metrics:histogram_timed_update(Name, Fun).

> folsom_metrics:notify({Name, Value}).

Friday, March 30, 12

Page 18: Erlang Application Metrics with Folsom

Histories

• Histories are a collection of past events, such as errors or log messages.

Friday, March 30, 12

Page 19: Erlang Application Metrics with Folsom

Histories

> folsom_metrics:new_history(Name). > folsom_metrics:get_history_values(Name, Count).

> folsom_metrics:notify({Name, Value}).

Friday, March 30, 12

Page 20: Erlang Application Metrics with Folsom

Meters

• Meters are increment only counters with mean rates and exponentially weighted moving averages applied to them, similar to a unix load average.

Friday, March 30, 12

Page 21: Erlang Application Metrics with Folsom

Meters

> folsom_metrics:new_meter(Name). > folsom_metrics:notify({Name, Value}).

Friday, March 30, 12

Page 22: Erlang Application Metrics with Folsom

Erlang VM

• General VM metrics provided by Erlang VM.

Friday, March 30, 12

Page 23: Erlang Application Metrics with Folsom

Erlang VM

> folsom_vm_metrics:get_memory().> folsom_vm_metrics:get_system_info().> folsom_vm_metrics:get_statistics().> folsom_vm_metrics:get_port_info().

> folsom_vm_metrics:get_process_info().

Friday, March 30, 12

Page 24: Erlang Application Metrics with Folsom

Statistics

• Statistical Analysis

• Exponentially Weighted Moving Average (EWMA)

• Rate / Acceleration

• Avg, Mean, Min, Max, etc

• Distribution

• Percentiles / Histograms

• Covariance / Correlation

Friday, March 30, 12

Page 25: Erlang Application Metrics with Folsom

Sampling

• Exponentially decaying

• Uniform

• None

Friday, March 30, 12

Page 26: Erlang Application Metrics with Folsom

Extensibility

• Clean Native API

• Folsom Wrappers

• REST+JSON

• Munin plugins!

• SNMP? Graphite? CollectD?

Friday, March 30, 12

Page 27: Erlang Application Metrics with Folsom

Future Work

• Metrics REST+JSON Spec

• Performance Improvements

• Better Querying, Slicing and etc of metric values

• More metric types (meter reader, timer, etc)

Friday, March 30, 12

Page 28: Erlang Application Metrics with Folsom

Similar Tools• Coda Hale’s Metrics (JVM) - github.com/coda/metrics

• Ruby - github.com/johnewart/ruby-metrics

• JavaScript - github.com/mikejihbe/metrics

• .NET Metrics - github.com/danielcrenna/metrics-net

• Ostrich - github.com/twitter/ostrich

• Python Ostrich - github.com/wadey/python-ostrich

• .Net Ostrich - github.com/ewhauser/OstrichNet

Friday, March 30, 12

Page 29: Erlang Application Metrics with Folsom

Folsom

DEMO!

Friday, March 30, 12

Page 30: Erlang Application Metrics with Folsom

Questions?

Joe Williams (@williamsjoe)

Boundary (@boundary / boundary.com)

https://github.com/boundary/folsom

Friday, March 30, 12