0.0
The project is in a healthy, maintained state
Automatically captures request context, performance data, and error information for Koderift log analytics.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

>= 7.1, < 9
~> 3.12

Runtime

>= 0.11, < 2
>= 7.1, < 9
 Project Readme

koderift-rails

Rails instrumentation gem for Koderift log analytics.

Automatically captures request context, performance data, and error information — no manual ApplicationController changes needed.

Installation

Requires Ruby >= 2.7 and Rails 7.1-8.x.

Add to your Gemfile:

gem 'koderift-rails', '~> 1.3'

Run bundle install. Lograge is a dependency of this gem and is installed with it - you do not need to add it yourself.

Configuration

Create config/initializers/koderift.rb:

Koderift::Rails.configure do |config|
  config.project_token = ENV['KODERIFT_PROJECT_TOKEN']

  # Optional: customise how the current user is resolved
  # config.current_user = ->(controller) { controller.current_user }
end

Set KODERIFT_PROJECT_TOKEN in your environment to the token from your project's Log Analytics settings page in Koderift.

What it captures

  • Controller, action, path, method, status, duration
  • DB runtime, view runtime, allocations
  • Current user ID
  • Request ID, IP address, user agent, referer
  • Request params (filtered — passwords, tokens etc removed)
  • Top 5 slowest partials with render times
  • Top 5 slowest SQL queries
  • Last 20 breadcrumbs (ordered partial renders + SQL queries)
  • Exception class, message, and cause chain
  • Stack traces (requires keep_original_rails_log: true)

Requirements

  • Ruby >= 2.7
  • Rails >= 6.1
  • lograge >= 0.11