Project

vestige

0.0
No commit activity in last 3 years
No release in over 3 years
Distributed tracing for Rails applications
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.11
~> 5.0
>= 0
~> 10.0
 Project Readme

Vestige

Distributed tracing for Rails applications.

Installation

Add this line to your application's Gemfile:

gem 'vestige'

Usage

Vestige relies on ActionDispatch::RequestId middleware to generate request id, saves it to thread local variable accessible as Vestige.trace_id and forwards it to different API clients to enable cross-application tracing. At the moment it's tightly coupled with Rails and supports Sidekiq, delayed_job and Faraday.

Sidekiq

Add client and server middlewares to config/initializers/sidekiq.rb

Sidekiq.configure_server do |config|
  config.logger.formatter = Vestige::Sidekiq::Formatter.new

  config.server_middleware do |chain|
    chain.add Vestige::Sidekiq::Server
  end

  config.client_middleware do |chain| # Fan-out support
    chain.add Vestige::Sidekiq::Client
  end
end

Sidekiq.configure_client do |config|
  config.logger.formatter = Vestige::Sidekiq::Formatter.new

  config.client_middleware do |chain|
    chain.add Vestige::Sidekiq::Client
  end
end

delayed_job

Add plugin to config/initializers/delayed_job.rb

Delayed::Worker.plugins << Vestige::DelayedJob::Plugin

Faraday

Add middleware to Faraday stack

connection = Faraday.new("http://example.com") do |conn|
  conn.request :vestige
  conn.response :logger, Rails.logger
end

You'll probably want to tag Rails log as well by adding config.log_tags = [:uuid] to config/application.rb

License

The gem is available as open source under the terms of the MIT License.