Automatically get metrics for Instrumental from your Ruby on Rails (RoR) application.
Automatic Metrics For Ruby
Automatic metrics for commonly used Ruby gems:
- Delayed Job
- apdex metrics
- request time, broken down by controller and action
- middleware execution time
- idle time
- content length
- web server queue time (for servers that set HTTP_X_QUEUE_START like nginx)
And also you can report generic method timing.
gem install metrician instrumental_agent
Grab your project token from https://instrumentalapp.com/docs/tokens and activate metrician with:
I = Instrumental::Agent.new(PROJECT_TOKEN) Metrician.activate(I)
In rails, the middleware will be inserted into your middleware stack automatically. If you control your middleware stack manually in rails, you can load the functionality using the following manual instructions:
In your application.rb file:
# request timing should be first so we get the correct queue time and start the # middleware timer config.middleware.insert_before("ActionDispatch::Static", "RequestTiming") # if you want to track content length add the rack middleware config.middleware.insert_before("ActionDispatch::Static", "Rack::ContentLength") # application timing should be last/just before the request is processed config.middleware.use("ApplicationTiming")
If you run
rake middleware, you should see something like:
use RequestTiming use Rack::ContentLength use ActionDispatch::Static # etc. use ActionDispatch::BestStandardsSupport use ApplicationTiming run YOUR_APP::Application.routes
Your exception tracking middleware may try to get in first (hey, Honeybadger), so you will have to change the load order in an initializer, because we want to track that as middleware time, too.
- Pull latest master
- Merge feature branch(es) into master
- Increment version in:
rake matrix:installto generate new gem lockfiles
- Update CHANGELOG.md
- Commit "Release vX.Y.Z"
- Push to GitHub
- Release packages:
- Verify package release at https://rubygems.org/gems/metrician
This library follows Semantic Versioning 2.0.0.