Docs › Sidekiq cron job monitoring with RunVouch
Sidekiq cron job monitoring with RunVouch
Sidekiq cron job monitoring for the schedule Sidekiq Web says is fine: sidekiq-cron loads config/schedule.yml into Redis and a poller in the Sidekiq process enqueues jobs on time. A job that raises goes to the retry set, retries for 25 attempts over about 21 days, then goes to the Dead set. A job that was never enqueued goes nowhere.
- How it runs on Sidekiq cron (sidekiq-cron, sidekiq-scheduler)
- Store the key
- Report the run (two HTTP calls)
- Register the cadence and caps
- What goes silent on Sidekiq cron (sidekiq-cron, sidekiq-scheduler)
- What Sidekiq cron (sidekiq-cron, sidekiq-scheduler) does not tell you
- What RunVouch detects
- Set up in two minutes
How it runs on Sidekiq cron (sidekiq-cron, sidekiq-scheduler)
Inside perform, with two Net::HTTP calls around the work (no gem required), or shell out to rv run if the job runs a script. Report the run from the job, not from the schedule, so a job that was enqueued but never picked up is a MISSED start.
Store the key
ENV["RUNVOUCH_KEY"] on the Sidekiq process, from Rails credentials (Rails.application.credentials.runvouch_key) or the process environment.
Report the run (two HTTP calls)
# config/schedule.yml (sidekiq-cron)
nightly_report:
cron: "0 2 * * *"
class: NightlyReportJob
queue: reports
# app/jobs/nightly_report_job.rb
require "net/http"; require "json"
class NightlyReportJob
include Sidekiq::Job
sidekiq_options retry: 2
API = "https://api.runvouch.com"
def post(path, body)
uri = URI(API + path)
req = Net::HTTP::Post.new(uri, "X-API-Key" => ENV.fetch("RUNVOUCH_KEY"), "content-type" => "application/json")
req.body = body.to_json
JSON.parse(Net::HTTP.start(uri.host, uri.port, use_ssl: true, read_timeout: 10) { |h| h.request(req) }.body)
rescue StandardError => e
Rails.logger.warn("runvouch unreachable: #{e.message}"); {} # fail open
end
def perform
run_id = post("/v1/runs/start", agent: "nightly-report", source: "sidekiq")["run_id"]
rows = Report.build! # your work
post("/v1/runs/end", run_id: run_id, status: "ok", evidence: { rows_written: rows > 0 })
rescue StandardError => e
post("/v1/runs/end", run_id: run_id, status: "fail", meta: { error: e.message[0, 500] }) if run_id
raise
end
endThe start call returns run_id; the end call takes status (ok or fail), optional cost and tokens, and evidence as a JSON object of booleans. Full reference on the API page.
Register the cadence and caps
rv agent nightly-report --cadence 24h --grace 30m --max-runtime 1h --evidence --cap-run-cost 2
Register the agent once, from anywhere with the key. Cadence is what turns a schedule that stopped into an alert; --evidence makes a run without evidence a failure; the caps pause the agent when it overspends.
What goes silent on Sidekiq cron (sidekiq-cron, sidekiq-scheduler)
- The cron poller runs inside the Sidekiq process. Sidekiq down, or a
schedule.ymlthat failed to parse at boot, means nothing is enqueued; MISSED is the only external signal. - A job enqueued to a queue no process listens to (a queue renamed in the deploy) is enqueued forever; RunVouch sees no start.
- Default retries: 25 attempts over about 21 days before the Dead set. With an LLM call inside, that is 25 bills.
retry: 2above plus the per-run cost cap bound it. - A job that rescues everything and returns is a success in Sidekiq Web; evidence is what separates it from a good run.
What Sidekiq cron (sidekiq-cron, sidekiq-scheduler) does not tell you
Sidekiq Web shows queues, the retry set, the Dead set and a Cron tab with each schedule's last enqueue time. Sidekiq itself sends no notifications; error trackers (Sentry, Honeybadger) receive exceptions from jobs that ran. There is no exception for a poller that is not running, a schedule that did not load, or a job that completed with nothing to show.
What RunVouch detects
| Alert | What it means here |
|---|---|
| MISSED | cadence plus grace passed and no run started |
| FAILED | non-zero exit or a reported failure, with the stderr excerpt |
| NO_EVIDENCE | the run said ok but the file, URL or assertion you required is missing |
| STALLED | a run started and never ended within max runtime |
| RETRY_STORM | the same tool called with identical input many times in one run |
| BUDGET_RUN / BUDGET_DAY | cost cap crossed; the agent is paused until you resume it |
| DRIFT | duration or output size far off its 7-run baseline |
Set up in two minutes
- Get a free key (3 agents, no card) and store it where this page says.
- report the run (two http calls): copy the snippet above into the scheduled job.
- Register the cadence once:
rv agent nightly-report --cadence 24h --grace 30m --evidence, or let the first run create the agent and set the cadence on the dashboard. - Send one test alert:
curl -X POST https://api.runvouch.com/v1/settings/test-alert -H "X-API-Key: $RUNVOUCH_KEY". The next missed, failed or empty run reaches the same channels.
Need a key? Get a free key · Stuck? contact