Git Product home page Git Product logo

influxdb-rails's Introduction

influxdb-rails

This library is now updated to require influxdb-ruby v0.2.0 and greater, meaning that only InfluxDB v0.9.x and higher will be supported. If you want to use this library with InfluxDB v0.8.x, you'll need to use v0.1.10 or earlier.

We encourage you to submit a pull request if you have a contribution. Maintained by @toddboom.


Build Status

Auotmatically instrument your Ruby on Rails applications and write the metrics directly into InfluxDB.

Install

$ [sudo] gem install influxdb-rails

Or add it to your Gemfile, etc.

Usage

To get things set up, just create an initializer:

$ rails g influxdb

Then, you can edit the file at config/initializers/influxdb-rails.rb. The default config should look something like this:

InfluxDB::Rails.configure do |config|
  config.influxdb_database = "rails"
  config.influxdb_username = "root"
  config.influxdb_password = "root"
  config.influxdb_hosts    = ["localhost"]
  config.influxdb_port     = 8086

  # config.series_name_for_controller_runtimes = "rails.controller"
  # config.series_name_for_view_runtimes       = "rails.view"
  # config.series_name_for_db_runtimes         = "rails.db"
end

Out of the box, you'll automatically get reporting of your controller, view, and db runtimes for each request. You can also call through to the underlying InfluxDB::Client object to write arbitray data like this:

InfluxDB::Rails.client.write_point("events", {url: "/foo", user_id: current_user.id})

Additional documentation for InfluxDB::Client lives in the influxdb-ruby repo.

influxdb-rails's People

Contributors

toddboom avatar mvz avatar beckettsean avatar sonormed-dev avatar tobowers avatar jameselkins avatar jvshahid avatar bmxpert1 avatar peeja avatar

Watchers

Steffen Moelter avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.