Ruby on Rails
import { Aside } from ‘@astrojs/starlight/components’;
Quickstart
Historical package install steps below. Prefer check-in recipes for new setups.
Get from zero to your first data in under 3 minutes.
1. Prerequisites
- Ruby 3.0+
- Rails 6.1+
- A Crontinel account (sign up free)
- An app created in the dashboard
- Your API key (
crn_live_...) from app settings
2. Install
Add to your Gemfile:
gem "crontinel", "~> 0.1"gem "crontinel-rails", "~> 0.1"bundle install3. Configure
Create config/initializers/crontinel.rb:
Crontinel.setup do |config| config.api_key = ENV.fetch("CRONTINEL_API_KEY")endSet the environment variable:
# .env or exportCRONTINEL_API_KEY=crn_live_xxxxxxxxxxxx4. Add to a job
Add the module to any ActiveJob:
class MyJob < ApplicationJob include Crontinel::Rails::ActiveJob
def perform(*args) # your job work — auto-reported endend5. Dashboard verification
- Queue the job:
MyJob.perform_later - Run your worker:
bundle exec sidekiqorbundle exec good_job start - Go to app.crontinel.com → Apps → your app
- Check the Queue section — you should see
MyJobwith its run data
Requirements
- Ruby 3.0+
- Rails 6.1+
Install
Add to your Gemfile:
gem "crontinel", "~> 0.1"gem "crontinel-rails", "~> 0.1"bundle installConfiguration
Create config/initializers/crontinel.rb:
Crontinel.setup do |config| config.api_key = ENV.fetch("CRONTINEL_API_KEY")endSet the environment variable:
CRONTINEL_API_KEY=crn_live_...ActiveJob integration
Automatically tracks all ActiveJob.perform_later jobs:
class MyJob < ApplicationJob include Crontinel::Rails::ActiveJob
def perform(*args) # your job work — auto-reported endendThe module wraps around_perform automatically. No other changes needed.
ActiveScheduler integration
Automatically tracks jobs scheduled with ActiveScheduler:
Rails.application.config.active_scheduler do |scheduler| scheduler.include Crontinel::Rails::ActiveSchedulerendSidekiq server middleware
require "crontinel/rails/sidekiq/server_middleware"
Sidekiq.configure_server do |config| config.server_middleware do |chain| chain.add Crontinel::Rails::Sidekiq::ServerMiddleware endendRake tasks
namespace :reports do task daily: :environment do crontinel = Crontinel.client(api_key: ENV["CRONTINEL_API_KEY"])
crontinel.task_started(name: "reports:daily") begin GenerateDailyReport.call crontinel.task_finished(name: "reports:daily", duration_ms: 0) rescue => e crontinel.task_failed(name: "reports:daily", error: e.message, duration_ms: 0) raise end endendEnvironment variables
| Variable | Default | Description |
|---|---|---|
CRONTINEL_API_KEY | — | Your Crontinel API key (required) |
CRONTINEL_API_URL | https://app.crontinel.com | SaaS or self-hosted endpoint |