Rails integration for Crontinel — open-source monitoring for cron jobs, background workers, and scheduled tasks.
Unlike generic uptime tools, Crontinel knows when a job started but crashed silently, when a queue worker stopped processing, or when a cron fired but did nothing.
Add to your Gemfile:
gem "crontinel-rails", "~> 0.1"
gem "crontinel", "~> 0.1"bundle installCreate config/initializers/crontinel.rb:
Crontinel.setup do |config|
config.api_key = ENV.fetch("CRONTINEL_API_KEY")
config.endpoint = "https://app.crontinel.com/api/v1" # optional
endOr via environment variables:
CRONTINEL_API_KEY=your_key_here
CRONTINEL_ENDPOINT=https://app.crontinel.com/api/v1 # optionalAutomatically tracks all ActiveJob.perform_later jobs:
# Just include the module — it wraps around_perform automatically
class MyJob < ApplicationJob
include Crontinel::Rails::ActiveJob
def perform(*args)
# your job work
end
endAutomatically tracks Sidekiq jobs via middleware:
# lib/crontinel_rails.rb
require "crontinel/rails/sidekiq/server_middleware"
Sidekiq.configure_server do |config|
config.server_middleware do |chain|
chain.add Crontinel::Rails::Sidekiq::ServerMiddleware
end
endCrontinel.client.task_started(name: "my-cron-job")
# do work...
Crontinel.client.task_finished(name: "my-cron-job", duration_ms: 150)Rails 6.1+
MIT © Harun R Rayhan