Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Poznań JUG: Listen to the sounds of your applic...

Poznań JUG: Listen to the sounds of your application

Maciej Biłas

January 21, 2014
Tweet

More Decks by Maciej Biłas

Other Decks in Programming

Transcript

  1. Agenda • Monitoring, huh? • Introducing Graphite • Log analysis

    – the whys • Logstash architecture & use cases • Exploring logs with Kibana
  2. Yammer metrics private final Meter successfulLogins =
 metrics.meter(name(LoginHandler.class, "successful")); !

    public void login(String user, String password) { if (canLogin(user,password)) { successfulLogins.mark(); // ... } else { // ... } }
  3. Metrics Types: • Gauges • Counters • Meters • Histograms

    • Timers • Health Checks Reporters: • STDOUT • CSV • SLF4J • JMX • Graphite • Ganglia
  4. You can also check out • collectd https://collectd.org • StatsD

    https://github.com/etsy/statsd/ • Riemman http://riemann.io/ • Twitter’s Ostrich https://github.com/twitter/ostrich • Ganglia http://ganglia.sourceforge.net/ • Dashboards:
 http://shopify.github.io/dashing/
 https://github.com/obfuscurity/descartes
 https://github.com/obfuscurity/dusk
  5. Event Sourcing Tracing and storing all the events Current app

    state: replaying the stream Great for data mining and analysis
  6. Log aggregation • Less invasive way to build an “event

    stream” • Logs are data with plenty of value
  7. Logstash • Open source • Written in JRuby • Gathers

    logs from various inputs • Parses and extracts metadata • Writes to various outputs
  8. Inputs collectd drupal_dblog elasticsearch eventlog exec file ganglia gelf gemfire

    generator graphite heroku imap irc log4j lumberjack pipe rabbitmq redis relp s3 snmptrap sqlite sqs stdin stomp syslog tcp twitter udp unix varnishlog websocket wmi xmpp zenoss zeromq
  9. Grok time 2013-11-10 19:41:25.321 thread main loglevel INFO source o.a.camel.impl.DefaultCamelContext

    message Apache Camel 2.11.1 (CamelContext: camel-1) started in 4.450 seconds 2013-11-10 19:41:25.321 [main] INFO o.a.camel.impl.DefaultCamelContext - Apache Camel 2.11.1 (CamelContext: camel-1) started in 4.450 seconds Thin layer on top of a regular expression
  10. Grok grok { patterns_dir => “./some-dir“ match => ["message", "%{TIMESTAMP_ISO8601:time}

    
 \[%{DATA:thread}\] %{LOGLEVEL:loglevel}
 %{DATA:source} - % {MULTILINE_GREEDYDATA:message}"] } 2013-11-10 19:41:25.321 [main] INFO o.a.camel.impl.DefaultCamelContext - Apache Camel 2.11.1 (CamelContext: camel-1) started in 4.450 seconds
  11. Outputs boundary circonus cloudwatch csv datadog datadog_metric s elasticsearch elasticsearch_ht

    tp elasticsearch_ri ver email exec file ganglia gelf gemfire google_bigquer y google_cloud_st orage graphite graphtastic hipchat http irc jira juggernaut librato loggly lumberjack metriccatcher mongodb nagios nagios_nsca null opentsdb pagerduty pipe rabbitmq redis riak riemann s3 sns solr_http sqs statsd stdout stomp syslog tcp udp websocket xmpp zabbix zeromq
  12. References • Graphite
 http://graphite.readthedocs.org/en/latest/ • Yammer Metrics
 http://metrics.codahale.com/ • Logstash


    http://logstash.net/ • Surfing the event stream by Sam Newman at Geecon
 http://www.slideshare.net/spnewman/surfing-the-event-stream • Lessons from Building and Scaling LinkedIn by Jay Kreps
 http://www.infoq.com/presentations/linkedin-architecture-stack • Code as Craft
 http://codeascraft.com/