README.md in instrumental_agent-1.0.1 vs README.md in instrumental_agent-2.0.0.alpha

- old
+ new

@@ -1,23 +1,23 @@ # Instrumental Ruby Agent Instrumental is a [application monitoring platform](https://instrumentalapp.com) built for developers who want a better understanding of their production software. Powerful tools, like the [Instrumental Query Language](https://instrumentalapp.com/docs/query-language), combined with an exploration-focused interface allow you to get real answers to complex questions, in real-time. -This agent supports custom metric monitoring for Ruby applications. It provides high-data reliability at high scale, without ever blocking your process or causing an exception. +This agent supports custom metric monitoring for Ruby applications. It provides high-data reliability at high scale, without ever blocking your process or causing an exception. ## Setup & Usage Add the gem to your Gemfile. ```sh gem 'instrumental_agent' ``` -Visit [instrumentalapp.com](https://instrumentalapp.com) and create an account, then initialize the agent with your API key, found in the Docs section. +Visit [instrumentalapp.com](https://instrumentalapp.com) and create an account, then initialize the agent with your [project API token](https://instrumentalapp.com/docs/tokens). ```ruby -I = Instrumental::Agent.new('YOUR_API_KEY', :enabled => Rails.env.production?) +I = Instrumental::Agent.new('PROJECT_API_TOKEN', :enabled => Rails.env.production?) ``` You'll probably want something like the above, only enabling the agent in production mode so you don't have development and production data writing to the same value. Or you can setup two projects, so that you can verify stats in one, and release them to production in another. Now you can begin to use Instrumental to track your application. @@ -57,19 +57,14 @@ User.find_each do |user| I.increment('signups', 1, user.created_at) end ``` -## Server Stats +## Server Metrics -Want some general server stats (load, memory, etc.)? Check out the [instrumental_tools](https://github.com/instrumental/instrumental_tools) gem. +Want server stats like load, memory, etc.? Check out [InstrumentalD](https://github.com/instrumental/instrumentald). -```sh -gem install instrumental_tools -instrument_server -``` - ## Agent Control Need to quickly disable the agent? set :enabled to false on initialization and you don't need to change any application code. @@ -97,9 +92,23 @@ If you plan on tracking metrics in Resque jobs, you will need to explicitly cleanup after the agent when the jobs are finished. You can accomplish this by adding `after_perform` and `on_failure` hooks to your Resque jobs. See the Resque [hooks documentation](https://github.com/resque/resque/blob/master/docs/HOOKS.md) for more information. You're required to do this because Resque calls `exit!` when a worker has finished processing, which bypasses Ruby's `at_exit` hooks. The Instrumental Agent installs an `at_exit` hook to flush any pending metrics to the servers, but this hook is bypassed by the `exit!` call; any other code you rely that uses `exit!` should call `I.cleanup` to ensure any pending metrics are correctly sent to the server before exiting the process. +## Automated Metric Collection + +v2.x+ of the Instrumental Agent introduced automated metric collection for your application by way of the [Metrician gem](https://github.com/Instrumental/metrician-ruby). You can read more about the metrics it collects in the [Instrumental documentation](https://instrumentalapp.com/docs/metrician/installation). + +### Upgrading from 1.x + +If you are upgrading from the pre-2.x version of instrumental and **do not** want automated metric collection, you can disable it by setting the following in your agent setup: + +``` +I = Instrumental::Agent.new('PROJECT_API_TOKEN', + :enabled => Rails.env.production?, + :metrician => false +) +``` ## Troubleshooting & Help We are here to help. Email us at [support@instrumentalapp.com](mailto:support@instrumentalapp.com).