RESTful Metrics

This add-on is operated by Restful Labs LLC

Big data for developers

RESTful Metrics

Last Updated: 18 March 2014

This article is a work in progress, or documents a feature that is not yet released to all users. This article is unlisted. Only those with the link can access it.

Table of Contents

This add-on have been deprecated, and is now disabled for new installs.

RESTful Metrics is a business intelligence tool built for developers. You add some hooks within your application and you can instantly begin reporting on those metrics.

Deploying to Heroku

To use RESTful Metrics on Heroku, install the addon:

$ heroku addons:add restful_metrics

To use the Ruby client, add the gem to your Gemfile:

gem "restful_metrics"

If you’d prefer to use the REST interface, see our docs on using RESTful Metrics via REST.

An application identifier is automatically created for you using your Heroku App ID. If you do not know your Heroku App ID or you’d like to create a custom one, visit the addon’s admin panel. You can find more information about application identifiers here.

Local setup

Obtain the API key that was assigned to you when you added the RESTful Metrics addon:

$ heroku config

Your API key will be the Heroku environment variable: RESTFUL_METRICS_API_KEY.

If you’re using the Ruby client, you’ll want to initialize the client settings when your application loads. If you have a Rails application, this is best done with an initializer stored in config/initializers/restful_metrics.rb:

RestfulMetrics::Client.set_credentials(<your_api_key>)

If you’re application has a worker, the Ruby client can automatically send data points asychronously by adding this to your initializer:

RestfulMetrics::Client.async = true

To send metric data points, use these hooks throughout your application:

RestfulMetrics::Client.add_metric(<application_identifier>, <metric_name>, <metric_value>)

To send compound metric data points:

RestfulMetrics::Client.add_compound_metric(<application_identifier>, <compound_metric_name>, <compound_metric_value>)

The Ruby client will automatically skip sending data points when you’re application is not being run in a production environment.

Further reading