Giter Club home page Giter Club logo

metrician-ruby's Introduction

Metrician

Automatically get metrics for Instrumental from your Ruby on Rails (RoR) application.

Build Status

Automatic Metrics For Ruby

Automatic metrics for commonly used Ruby gems:

  • ActiveRecord
  • Redis
  • Memcached
  • Dalli
  • Delayed Job
  • Sidekiq
  • Resque
  • Honeybadger

Request Metrics:

  • 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.

Installation

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)

Configuration

Rack Middleware

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.

Release Process

  1. Pull latest master
  2. Merge feature branch(es) into master
  3. script/test
  4. Increment version in:
  • lib/metrician/version.rb
  1. Run rake matrix:install to generate new gem lockfiles
  2. Update CHANGELOG.md
  3. Commit "Release vX.Y.Z"
  4. Push to GitHub
  5. Release packages: rake release
  6. Verify package release at https://rubygems.org/gems/metrician

Version Policy

This library follows Semantic Versioning 2.0.0.

metrician-ruby's People

Contributors

janxious avatar jason-o-matic avatar mediocretes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

metrician-ruby's Issues

Release as proper gem

  • add install instructions to readme
  • versioned
  • changelogged
  • document the metrics that will be reported per thing

Method Timing should be moved to the agent

We no longer rely on the functionality inside Metrician for any of our other instrumentation and it's very different from the rest of the pieces in terms of configuration, other than having an enable flag, so probably it should be in the piece of tech that is built around the idea of full customization instead of automatic make do right.

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.