Project

crontinel

0.0
The project is in a healthy, maintained state
Crontinel monitors your 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.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies
 Project Readme

Crontinel Ruby

Ruby SDK 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.

Installation

Add to your Gemfile:

gem "crontinel", "~> 0.1"

Or install directly:

gem install crontinel

Quick Start

require "crontinel"

# Configure with your API key (or set CRONTINEL_API_KEY and call Crontinel.client)
client = Crontinel.client(api_key: "your_api_key_here")

# Do your work...
result = send_daily_summary

# Record success
client.task_finished(name: "send-daily-summary", duration_ms: 520)

With error handling

client = Crontinel.client(api_key: ENV["CRONTINEL_API_KEY"])

begin
  process_invoices
  client.task_finished(name: "process-invoices", duration_ms: 3200)
rescue => e
  client.task_failed(name: "process-invoices", error: e.message, duration_ms: 150)
  raise
end

Worker heartbeat

For queue workers (Sidekiq, etc.):

worker = Crontinel.client(api_key: ENV["CRONTINEL_API_KEY"])

# In your worker loop or at intervals
worker.worker_heartbeat(
  name: "email-worker",
  status: "running",
  jobs_processed: 142,
  jobs_failed: 2,
  memory_mb: 128
)

Configuration

client = Crontinel.client do |config|
  config.api_key = ENV["CRONTINEL_API_KEY"]
  config.endpoint = "https://app.crontinel.com/api/v1" # optional, default works for hosted
  config.timeout = 10       # seconds, default: 10
  config.open_timeout = 5    # seconds, default: 5
end

API

Crontinel.client(api_key:, endpoint: nil)

Create a new Crontinel client.

#task_started(name:, output: nil)

Does nothing. Crontinel records a run when it ends, so call task_finished or task_failed.

#task_finished(name:, output: nil, duration_ms: nil)

Record that a task completed successfully.

#task_failed(name:, error: nil, output: nil, duration_ms: nil)

Record that a task failed.

#worker_heartbeat(name:, status:, jobs_processed: nil, jobs_failed: nil, memory_mb: nil)

Send a heartbeat for a queue worker.

#task_runs(name:, limit: 10)

Get recent task runs. Returns an array of Crontinel::TaskRun objects.

#health_check

Returns true if Crontinel is reachable, false otherwise.

Supported Ruby Versions

Ruby 2.7+

License

MIT © Harun R Rayhan