Home - gonace/Cronitor GitHub Wiki

Cronitor is a service for heartbeat-style monitoring of anything that can send an HTTP request. It's particularly well suited for monitoring cron jobs, Jenkins jobs, or any other scheduled task.

This is the documentation for Cronitor, the .NET client for the Cronitor API. It has two parts:

  • Telemetry: report when your jobs run, complete or fail.
  • Management: create, read, update and delete monitors, issues and notifications, and read a monitor's activity.

Quick start

dotnet add package Cronitor
CronitorClient.Configure("apiKey");

using (var run = await CronitorClient.StartAsync("monitorKey"))
{
    // ... do the work
    await run.CompleteAsync();
}

The run is reported when it starts, and as complete when CompleteAsync is called. If the work throws, the run is disposed without it and reported as failed. A monitor that doesn't exist yet is created by its first event.

CronitorClient used to be called Cronitor. That name still works but is obsolete: it shares its name with the namespace Cronitor, so it can only be called as Cronitor.Cronitor.

Pages

Getting started

  • Setup: install, the static class, the .NET Generic Host and dependency injection.
  • Errors and logging: what happens when a call fails, and how to log it.

Telemetry (Telemetry API)

  • Telemetry: run, complete, fail and tick, the using block, environments and custom commands.

Management

Integrations

  • Integrations: report Quartz.NET, Hangfire, TickerQ and Coravel jobs without any reporting code in the jobs.

Links