Here's how to get up and running with Ruby application monitoring and Instrumental. Like all our agents, the Ruby agent is designed to prevent exceptions from impacting your application. It's also completely non-blocking.
Add the agent to your Gemfile:
Be sure to Bundle install:
$ bundle install
Require the library and configure it with your project token. Using Rails? We recommend putting this in an initializer.
require 'instrumental_agent' I = Instrumental::Agent.new('PROJECT_TOKEN')
Automated Metrics with Metrician
When you install the Instrumental ruby agent, you also get Metrician, a tool that will automatically report metrics from your ruby application without having to configure anything. Read more about automated metric collection with Metrician.
Sending Custom Metrics
Increments are simple counters. learn more
Gauges represent a value at a point in time. learn more
The time method measures code execution time.
I.time('app.query_time.post.find') do post = Post.find(1) end
Notices are project specific events with an optional duration.
I.notice("Deployed revision 038ade4 to production") I.notice("event in the past with a duration", 1.day.ago, 20.seconds)