This gem adds allow your Rails app to report performance metrics for database queries and response times to InfluxDB.


Add this line to your application's Gemfile:

gem 'influxdb-metrics'

If you're using the 8.x line of InfluxDB, you'll need this line as well:

gem 'influxdb', '~> 0.1.9'

And then execute:

$ bundle


InfluxDB::Rails is a really great project. It allows tracking controller metrics right out of the box. It also includes exception tracking, which is really great if you don't have it setup yet. I use a different service to do exception tracking, so I just want to use InfluxDB for performance metrics.

Also, I wanted to be able to track SQL query performance. That's included.


InfluxDB::Metrics.configure do |config| = ''
  # or
  config.hosts = ['', '']

  # The following values are defaults:

  # config.app_name = 'rails'
  # config.username = 'root'
  # config.password = 'root'
  # config.database = 'rails'
  # config.port = 8086

  # You can customize which stats get recorded:
  # = :action_controller, :active_record


  1. Fork it ( )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request