Integration

Beacon for Rails

Report incidents, update components, and send heartbeats from your Rails application. One gem. Zero configuration.

$ gem "beacon-rails"

Quick Start

Up and running in three steps

1

Install

gem "beacon-rails"
$ bundle install
2

Configure

Create an initializer file

# config/initializers/beacon.rb
Beacon.configure do |config|
  config.token     = ENV["BEACON_API_TOKEN"]
  config.base_url  = ENV.fetch("BEACON_BASE_URL", "https://app.beaconstatus.com")
  config.page_slug = ENV["BEACON_PAGE_SLUG"]
end
3

Use

Beacon.create_incident(
  title: "Service degradation detected",
  impact: "minor"
)

Code Examples

Speak fluent Ruby

Report an Incident

Create an incident on your status page from anywhere in your app.

Beacon.create_incident(
  title: "Database connection errors",
  impact: "major",
  state: "investigating",
  message: "Elevated connection timeouts from primary DB."
)

Update Component Status

Beacon.update_component(component_id, status: "degraded")

Resolve an Incident

Beacon.resolve_incident(incident_id,
  message: "Database connections restored after failover."
)

Heartbeat with Sidekiq

class InvoiceProcessingJob
  include Sidekiq::Job

  def perform
    process_invoices
    Beacon.heartbeat("invoice-processing-token")
  end
end

Health Check Endpoint

# config/routes.rb
get "/health", to: proc { [200, {}, [{ status: "ok" }.to_json]] }

Rescue From in Controller

class ApplicationController < ActionController::Base
  rescue_from StandardError do |e|
    if e.is_a?(CriticalDatabaseError)
      Beacon.create_incident(
        title: "Critical database failure",
        impact: "critical"
      )
    end
    raise e
  end
end

Features

Built for Rails developers

Zero dependencies

Uses Net::HTTP from the Ruby standard library. No extra gems.

Thread-safe async mode

Non-blocking API calls that work safely in multi-threaded environments.

Auto-configures from ENV

Reads credentials from environment variables automatically.

Rails 7+ and Ruby 3.1+

Tested across all current active Rails and Ruby releases.

Start monitoring your Rails app

Add the gem, configure your token, and ship status updates from your codebase.

Also available: Laravel → / Node.js → / WordPress →