Skip to content

Monitoring, Metrics, and Logging Oh My

Andrew Serff edited this page Nov 21, 2015 · 1 revision

HOME > [NFJS 2015](NFJS 2015) > [Monitoring, Metrics, and Logging Oh My](Monitoring, Metrics, and Logging Oh My)

Matt Stine

Why do we do this? VISIBILITY

Measure Everything! You never know what you’ll need to know in the future.

  • you could even do automated trending on things you are collecting.

###Dropwizard Metrics: https://dropwizard.github.io/metrics

  • Gauges - instantaneous values of something.
    • Only want to use this when it cost nothing to get/report an answer (i.e you don’t have to go to the db to get a count)
  • Counter
  • Meters - An average rate of events over a period of time
    • requests / second
    • A mean time is useless to figure out what’s happening right now
  • Histogram
  • Timer
  • Histogram

###Spring-Boot Metrics /metrics - should give you a bunch of metrics You can add drop wizard to the class path and it will auto add it.

###Logging TRACE level is never meant to be committed to version control Don’t try/catch/log/rethrow Make your log messages human readable. He likes templates because you know how it will be formatted and you didn’t get spaces wrong Semantic Logging - slfj4 you can use their appender to build a log and output as json

###Alerting Nagios is what most people use, but no one likes it Sensu is better but hard to use?

###Shipping your Metrics StatsD

Graphite

  • Easy to use
  • timeseries database
  • Graphing

###Stop managing log files ELK:

  • Elasticsearch - Search
  • Logstash - Log shipper
  • Kibana - UI for Logstash

He has a Docker compose files that will start log stash, statsd, graphite

###If we can build things faster, we win!

Clone this wiki locally