0.0
The project is in a healthy, maintained state
Celerbrake Ruby is a plain Ruby notifier for Celerbrake (https://celerbrake.com), a cloud-based, wire-compatible error-tracking service. It provides a minimalist API for sending any Ruby exception to a Celerbrake dashboard. The library is extremely lightweight and suits plain Ruby applications well. For apps built with Rails, Sinatra or any other Rack-compliant framework we offer the celerbrake gem (https://github.com/celerbrake/celerbrake), which reports unhandled exceptions automatically and integrates with Resque, Sidekiq, Delayed Job and many more. Celerbrake Ruby began as a fork of airbrake-ruby (https://github.com/airbrake/airbrake-ruby) and remains wire-compatible with the Airbrake v3 notice API; the default host points at Celerbrake rather than a third-party service.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 0
~> 13
~> 3
~> 1.2
~> 3.8
~> 0.9

Runtime

~> 0.1
~> 1.0
~> 0.6
 Project Readme

Celerbrake Ruby

Celerbrake Ruby is a lightweight, dependency-light Ruby notifier for Celerbrake — a self-hosted error- and exception-tracking service. It captures Ruby exceptions and ships them to a Celerbrake instance, where they are grouped, de-duplicated, and rendered with full backtraces, occurrence timelines, and request context.

This gem is the plain-Ruby core. If you run Rails, Sinatra, or any other Rack-compliant framework, use the higher-level celerbrake gem instead — it depends on this one and wires up automatic, unhandled-exception reporting plus integrations with ActiveJob, Sidekiq, Resque, Delayed Job, and more.

Heritage. Celerbrake Ruby began life as a fork of airbrake-ruby (v6.2.1) and stays wire-compatible with the Airbrake v3 create-notice API. The substantive difference is that the default reporting host is https://api.celerbrake.com instead of a third-party service, so you control the whole pipeline. We are grateful to Airbrake Technologies, Inc. for the original, MIT-licensed work — see LICENSE.md.

Installation

Bundler

gem 'celerbrake-ruby'

Manual

gem install celerbrake-ruby

Key features

  • Asynchronous (and synchronous) exception reporting with a background worker pool and bounded queue
  • Automatic backtrace parsing, code-hunk extraction, and root-directory trimming
  • A flexible filter chain for adding context, ignoring notices, or redacting sensitive data before it leaves your process
  • Built-in redaction of common secret-shaped keys (password, secret, *_token, authorization, ...)
  • Minimal dependencies; suitable for plain Ruby scripts, daemons, and gems

Configuration

Before sending notices, configure the notifier with the project id and project key issued by your Celerbrake instance (created at /admin/projects on the server).

require 'celerbrake-ruby'

Celerbrake.configure do |c|
  c.project_id  = 123
  c.project_key = 'fa0123456789abcdef0123456789abcd'

  # Defaults to https://api.celerbrake.com. Point this at your own instance.
  c.host = 'https://errors.example.com'

  # Report only from these environments.
  c.environment         = ENV['RACK_ENV']
  c.ignore_environments = %w[development test]
end

Notable configuration options

Option Default Description
project_id nil Numeric project id from the Celerbrake admin page. Required.
project_key nil Project API key from the Celerbrake admin page. Required.
host https://api.celerbrake.com Base URL of the Celerbrake instance receiving notices.
environment nil Current environment name (e.g. production).
ignore_environments [] Environments from which notices are dropped.
root_directory app root Used to trim and group backtrace frames.
blocklist_keys [] Keys whose values are redacted before sending.
allowlist_keys [] If set, only these keys are sent; everything else is redacted.
remote_config false Off by default — Celerbrake does not serve a remote-config endpoint.

Usage

Sending a notice

begin
  raise 'Oops!'
rescue => exception
  Celerbrake.notify(exception)
end

Celerbrake.notify is asynchronous and returns a promise. Use Celerbrake.notify_sync when you need to block until the notice is delivered (e.g. in a one-off script or a Rake task):

Celerbrake.notify_sync(StandardError.new('hello from a script'))

Adding context

Celerbrake.notify(exception) do |notice|
  notice[:context][:user] = { id: 42, email: 'user@example.com' }
  notice[:params][:document_id] = document.id
end

Adding filters

Filters run on every notice and can mutate it, add context, or ignore it entirely:

# Ignore a class of errors.
Celerbrake.add_filter do |notice|
  notice.ignore! if notice[:errors].any? { |e| e[:type] == 'PageNotFound' }
end

# Redact a custom sensitive key.
Celerbrake.blocklist_keys << /credit_card/i

Supported Ruby versions

Celerbrake Ruby supports Ruby 2.5+ (matching its upstream baseline). CI targets current stable Ruby releases.

Contributing

Bug reports and pull requests are welcome. Run the test suite with:

bundle install
bundle exec rspec
bundle exec rubocop

License

Celerbrake Ruby is released under the MIT License. It is a derivative work of airbrake-ruby, also MIT-licensed; the original copyright is preserved in LICENSE.md.