honeycombio/rack-honeycomb

Name: rack-honeycomb

Owner: Honeycomb

Description: Rack middleware for logging request data to Honeycomb.

Created: 2016-11-17 21:49:40.0

Updated: 2018-05-24 05:25:15.0

Pushed: 2018-05-24 05:25:13.0

Homepage: http://rubygems.org/gems/rack-honeycomb

Size: 56

Language: Ruby

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Honeycomb middleware for Rack applications

This is Rack middleware that sends request/response data to Honeycomb. You can use Rack::Honeycomb with any Ruby web framework based on Rack, including Ruby on Rails and Sinatra.

For more information about using Honeycomb, check out our docs and our Ruby SDK.

Adding instrumentation to a Sinatra application

Attaching the middleware is simple. Inside handlers, you also have the choice of attaching custom fields to be added to the events sent to Honeycomb.

sr/bin/env ruby -rubygems
ire 'sinatra'
ire 'rack/honeycomb'

Rack::Honeycomb::Middleware, writekey: "<YOUR WRITEKEY HERE>", dataset: "<YOUR DATASET NAME HERE>"

'/hello') do
ck::Honeycomb.add_field :greeting, 'hello'
ello, world!\n"

Adding instrumentation to a Rails application

For more fully-featured Rails support, see honeycomb-rails.

If honeycomb-rails doesn't work for you, this Rack middleware should work for Rails apps too:

nfig/application.rb
ire 'rack/honeycomb'

s Application < Rails::Application
nfig.middleware.use Rack::Honeycomb::Middleware, writekey: "<YOUR WRITEKEY HERE>", dataset: "<YOUR DATASET NAME HERE>"

Installation

To install the latest stable release of rack-honeycomb, simply:

m install rack-honeycomb

or add this to your Gemfile

"rack-honeycomb"

To follow the bleeding edge, it's easy to track the git repo:

"rack-honeycomb", :git => "https://github.com/honeycombio/rack-honeycomb.git"
Documentation

See rubydoc for gem documentation.

Contributions

Features, bug fixes and other changes are gladly accepted. Please open issues or a pull request with your change. Remember to add your name to the CONTRIBUTORS file!

All contributions will be released under the Apache License 2.0.

Releasing a new version

Travis will automatically upload tagged releases to Rubygems. To release a new version, run

 patch --tag   # Or bump minor --tag, etc.
push --follow-tags

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.