Cronitor 2026.2.78

dotnet add package Cronitor --version 2026.2.78
                    
NuGet\Install-Package Cronitor -Version 2026.2.78
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Cronitor" Version="2026.2.78" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Cronitor" Version="2026.2.78" />
                    
Directory.Packages.props
<PackageReference Include="Cronitor" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Cronitor --version 2026.2.78
                    
#r "nuget: Cronitor, 2026.2.78"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Cronitor@2026.2.78
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Cronitor&version=2026.2.78
                    
Install as a Cake Addin
#tool nuget:?package=Cronitor&version=2026.2.78
                    
Install as a Cake Tool

<img src="https://raw.githubusercontent.com/gonace/Cronitor/master/assets/icon.png" width="32" alt=""> Cronitor API Client

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.

Nuget Nuget

This .NET library has two parts:

For the full documentation, please read our wiki.

Install

dotnet add package Cronitor

Or download it from NuGet.

Quick start

CronitorClient.Configure("apiKey");

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

Setup

Static

Configure the static CronitorClient once, then use it anywhere in your application. It used to be called Cronitor; that name still works but is obsolete, since it shares its name with the namespace and can only be called as Cronitor.Cronitor.

Without a host:

CronitorClient.Configure("apiKey");

With the .NET Generic Host (Microsoft.Extensions.Hosting):

await Host.CreateDefaultBuilder()
    .UseCronitor((context) => context.Configuration.GetValue<string>("Cronitor:ApiKey"))
    .Build()
    .RunAsync();

Dependency injection

.ConfigureCronitor() registers ITelemetriesClient, IMonitorsClient, IIssuesClient and INotificationsClient in the service container instead. It does not configure the static CronitorClient.

await Host.CreateDefaultBuilder()
    .ConfigureCronitor((context) => context.Configuration.GetValue<string>("Cronitor:ApiKey"))
    .Build()
    .RunAsync();

Both .UseCronitor() and .ConfigureCronitor() also accept the API key as a plain string.

Telemetry

Telemetry events report the state of a job to a monitor. Each event has a sync and an async (…Async) method:

Method Event
Run The job has started
Complete The job has finished successfully
Fail The job has failed
Tick A heartbeat, for monitors without a start/end
Ping Sends a custom Command

All events except Ping take a monitor key and an optional message and environment. A monitor that doesn't exist yet is created by its first event.

A monitor key is a MonitorKey, and a string converts to one. It follows Cronitor's rules for keys: it can't be blank, contain /, be longer than 100 Unicode characters (an emoji counts as one), or start or end with whitespace, and it must be valid Unicode. An invalid key throws an ArgumentException before anything is sent, since Cronitor would otherwise drop the event without telling.

Telemetry never breaks the job it monitors because of Cronitor: transient failures are retried, and if an event still can't be delivered the method returns false instead of throwing.

Events that can't be delivered are logged as errors, see Logging.

Using block

CronitorClient.Start() (or ITelemetriesClient.Start()) reports the run and returns an ITelemetryRun. Call Complete() when the job succeeds; if the run is disposed without it (for example because an exception was thrown), it's reported as failed.

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

Every run gets its own series, so overlapping runs of the same monitor are matched correctly. Use run.Fail(message) to report a failure with a reason. Use run.Abandon(message) for a run that was stopped before it could end, such as when the service goes offline: the message is reported as a tick, so the monitor keeps its state instead of failing, and Cronitor keeps the run open until the job runs again. The message is required. An abandoned run doesn't alert: if the job doesn't run again on schedule, Cronitor alerts on the missed run as usual; if it does, the work of the abandoned run isn't reported as failed.

Static

try
{
    await CronitorClient.RunAsync("monitorKey");
    // ... do the work
    await CronitorClient.CompleteAsync("monitorKey");
}
catch (Exception ex)
{
    await CronitorClient.FailAsync("monitorKey", ex.Message, environment: "production");
    throw;
}

Dependency injection

public class SomeJob
{
    private readonly ITelemetriesClient _telemetriesClient;

    public SomeJob(ITelemetriesClient telemetriesClient)
    {
        _telemetriesClient = telemetriesClient;
    }

    public async Task ExecuteAsync()
    {
        using (var run = await _telemetriesClient.StartAsync("monitorKey"))
        {
            // ... do the work
            await run.CompleteAsync();
        }
    }
}

BackgroundService

A BackgroundService usually repeats its work in a loop. Report each pass through the loop as a run of its own:

public class CleanupService : BackgroundService
{
    private readonly ITelemetriesClient _telemetries;
    private readonly ILogger<CleanupService> _logger;

    public CleanupService(ITelemetriesClient telemetries, ILogger<CleanupService> logger)
    {
        _telemetries = telemetries;
        _logger = logger;
    }

    protected override async Task ExecuteAsync(CancellationToken stoppingToken)
    {
        using var timer = new PeriodicTimer(TimeSpan.FromMinutes(5));
        do
        {
            using (var run = await _telemetries.StartAsync("cleanup"))
            {
                try
                {
                    // ... do the work
                    await run.CompleteAsync();
                }
                catch (Exception exception) when (!stoppingToken.IsCancellationRequested)
                {
                    await run.FailAsync(exception.Message);
                    _logger.LogError(exception, "Cleanup failed");
                }
            }
        }
        while (await timer.WaitForNextTickAsync(stoppingToken));
    }
}

Register it next to Cronitor:

await Host.CreateDefaultBuilder()
    .ConfigureCronitor((context) => context.Configuration.GetValue<string>("Cronitor:ApiKey"))
    .ConfigureServices(services => services.AddHostedService<CleanupService>())
    .Build()
    .RunAsync();
  • A failed pass doesn't stop the service: the exception is reported with its message and logged, and the loop continues. Without the catch, an exception in ExecuteAsync stops the whole application by default.
  • A pass interrupted by shutdown is reported as failed, since its run is disposed without being completed.
  • Cronitor only alerts when the work stops if the monitor has a schedule. Give it the loop's interval, in the Cronitor dashboard or with Schedule.Every(5).Minutes through Management. PeriodicTimer starts a pass every five minutes, as long as each pass takes less than that; a pass that runs longer is followed by the next one right away. Task.Delay instead waits five minutes after each pass, so the interval grows with the time the work takes.

Custom commands

Use Ping when you need more than a message and environment, such as metrics, host or series:

using Cronitor;
using Cronitor.Commands;
using Cronitor.Constants;

var command = new CompleteCommand()
    .WithApiKey("apiKey")
    .WithMonitorKey("monitorKey")
    .WithHost("worker-01")
    .WithMetric(Metric.Count, 42)
    .WithMetric(Metric.Duration, 12.5);

await CronitorClient.PingAsync(command);

Logging

Events that can't be delivered, even after retries, are logged as errors through ILogger (Microsoft.Extensions.Logging). With the console logger, an entry starts like this, followed by the exception:

fail: Cronitor.TelemetriesClient[1]
      Could not deliver run event for monitor nightly-backup to Cronitor

With the .NET Generic Host, both .ConfigureCronitor() and .UseCronitor() use the host's logging automatically, so there is nothing to set up. For .UseCronitor(), logging applies from when the host starts:

await Host.CreateDefaultBuilder()
    .UseCronitor("apiKey")
    .Build()
    .RunAsync();

Without a host, pass an ILoggerFactory, either to the static CronitorClient or to a client:

using var loggerFactory = LoggerFactory.Create(builder => builder.AddConsole());

CronitorClient.Configure("apiKey", loggerFactory);
// or
var telemetriesClient = new TelemetriesClient("apiKey", loggerFactory);

AddConsole() comes from the Microsoft.Extensions.Logging.Console package; any logging provider works. Without an ILoggerFactory, nothing is logged.

Management

Monitors, issues and notifications are managed through CronitorClient.Monitors, CronitorClient.Issues and CronitorClient.Notifications (or the injected IMonitorsClient, IIssuesClient and INotificationsClient). For example, creating a job monitor:

using Cronitor;
using Cronitor.Assertions;
using Cronitor.Models.Monitors;
using Cronitor.Requests;
using Cronitor.Scheduling;

var job = new Job("nightly-backup")
{
    Schedule = Schedule.Cron.Daily(hour: 3),
    Assertions = new[]
    {
        Assertion.Metric.Duration.LessThan("30m"),
    }
};

var monitors = await CronitorClient.Monitors.CreateAsync(new CreateMonitorRequest(job));

Assertion and Schedule are fluent builders, so you don't have to write raw assertion or cron strings. See the wiki for all operations and options.

Monitor keys are MonitorKeys here too, with the same rules as for telemetry. Keys read from Cronitor are taken as they are, even if they break those rules, so a monitor you've read can always be passed back, such as GetAsync(monitor.Key).

Timezone

A monitor's schedule is evaluated in its Timezone, which Cronitor expects as an IANA name such as Europe/Berlin. CronitorTimezone.Of() gives the IANA name of a TimeZoneInfo, also on Windows, where time zones have Windows names such as W. Europe Standard Time:

using Cronitor.Scheduling;

var job = new Job("nightly-backup")
{
    Schedule = Schedule.Cron.Daily(hour: 3),
    Timezone = CronitorTimezone.Of(TimeZoneInfo.Local),
};

Of() throws for a time zone without an IANA name, such as a custom one; CronitorTimezone.TryGetIanaName() returns false instead.

Integrations

These packages report a scheduler's jobs to Cronitor without any reporting code in the jobs themselves. See each package's README for installation and setup.

Package Scheduler Reports
Cronitor.Quartz Quartz.NET every job
Cronitor.Hangfire Hangfire every recurring job
Cronitor.TickerQ TickerQ every cron job
Cronitor.Coravel Coravel every job scheduled with ScheduleWithCronitor

Contributing

Pull requests and features are happily considered! By participating in this project you agree to abide by the Code of Conduct.

To contribute

Fork, then clone the repo:

git clone git@github.com:your-username/Cronitor.git

Push to your fork and submit a pull request

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (5)

Showing the top 5 NuGet packages that depend on Cronitor:

Package Downloads
Cronitor.Extensions.Hosting

Hosting and startup abstractions for Cronitor. When using NuGet 3.x this package requires at least version 3.4....

Cronitor.TickerQ

Reports every TickerQ cron job to Cronitor: run when it starts, complete when it succeeds and fail when it fails.

Cronitor.Quartz

Reports every Quartz.NET job to Cronitor: run when it starts, complete when it succeeds and fail when it throws.

Cronitor.Hangfire

Reports every Hangfire recurring job to Cronitor: run when it starts, complete when it succeeds and fail when it throws.

Cronitor.Coravel

Reports Coravel scheduled jobs to Cronitor: run when they start, complete when they succeed and fail when they throw.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2026.2.78 584 11/10/2026
2026.1.77 374 10/13/2026
2025.2.69 915 11/10/2025
2025.2.67 349 10/31/2025 2025.2.67 is deprecated because it has critical bugs.
2025.1.68 3,792 11/10/2025
2025.1.66 369 10/31/2025 2025.1.66 is deprecated because it has critical bugs.
2025.1.62 307 7/28/2025
1.4.59 10,961 1/20/2024
1.4.58 474 11/22/2023
1.4.57 336 7/11/2023
Loading failed