BigSession
BigSession is a rubygem that helps tracing session over a chain of multiple applications (it's a big session!).
It is inspired heavily by ZipkinTracer, ReuestTracer and general ideas of tracing with slight difference in its concept.
Installation
Add this line to your application's Gemfile:
gem 'big_session'
And then execute:
$ bundle
Or install it yourself as:
$ gem install big_session
Usage
Use BigSession with Rails and Faraday
(It is an only way to use BigSession at the moment.)
Install BigSession to your rails application*s* and put these lines below to your Rails configuration files, config/initializers/big_session.rb
for example.
# inbound
::BigSession::RackMiddleware.activate
# outbound
::BigSession::FaradayBigSession.activate
It makes the application receives/generates a big session id for every request.
You can then pass the id to another rails application via HTTP Header (X-Bigse-SessionId
) when you use Faraday to send HTTP request.
Check ./example
for expected use cases.
Development
After checking out the repo, run bin/setup
to install dependencies. Then, run rake spec
to run the tests. You can also run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
. To release a new version, update the version number in version.rb
, and then run bundle exec rake release
, which will create a git tag for the version, push git commits and tags, and push the .gem
file to rubygems.org.
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/speee/big_session.
License
The gem is available as open source under the terms of the MIT License.