Getting Started
Get up and running with ActiveRabbit in under 5 minutes.
The quickest way to get started is signing up at app.activerabbit.ai. After creating an account, integrate with just a few lines of code.
Prerequisites
- Ruby 3.2.3 or higher
- Rails 7.0 or higher
- An ActiveRabbit account (sign up for free)
Ruby on Rails
Add the ActiveRabbit gem to your Gemfile:
# Gemfile
gem 'activerabbit-ai'Then run bundle install:
bundle installCreate an initializer to configure ActiveRabbit:
# config/initializers/activerabbit.rb
ActiveRabbit::Client.configure do |config|
config.api_key = ENV['ACTIVERABBIT_API_KEY']
config.project_id = ENV['ACTIVERABBIT_PROJECT_ID']
config.environment = Rails.env
endThat's it! 🎉 Errors, performance data, and N+1 queries are now being tracked automatically.
Next.js / Node.js
Install the npm package:
npm install @activerabbit/nextjsAdd the provider to your app layout:
// app/layout.tsx or _app.tsx
import { ActiveRabbitProvider } from '@activerabbit/nextjs'
export default function RootLayout({ children }) {
return (
<ActiveRabbitProvider
projectId={process.env.NEXT_PUBLIC_ACTIVERABBIT_PROJECT_ID}
apiKey={process.env.ACTIVERABBIT_API_KEY}
>
{children}
</ActiveRabbitProvider>
)
}What Gets Tracked Automatically
| Category | What's Tracked |
|---|---|
| Errors | StandardError, NoMethodError, ActiveRecord::*, ActionController::*, and 20+ more |
| Performance | Controller actions, database queries, view renders, background jobs |
| Database | N+1 queries, slow queries, connection issues |
| Background Jobs | Sidekiq jobs, ActiveJob, failures and retries |
Test Your Integration
Verify that ActiveRabbit is configured correctly:
# In rails console
rails console
# Manual error tracking when needed
begin
risky_operation
rescue => e
ActiveRabbit::Client.track_exception(e, context: { user_id: user.id })
raise
end
# Performance monitoring
ActiveRabbit::Client.performance_monitor.measure('heavy_operation') do
perform_heavy_calculation
end
# Custom events
ActiveRabbit::Client.track_event('user_signup', { plan: 'premium' })Next Steps
- Configure advanced options like custom error grouping and filtering
- Learn about error tracking features and how to add custom context
- Set up performance monitoring to track slow requests and queries
- Configure alerts to get notified when errors occur
💡 Pro Tip
ActiveRabbit automatically captures unhandled exceptions in your Rails application. You don't need to add any additional code for basic error tracking to work.