SteadyCron.Monitoring 0.1.0

dotnet add package SteadyCron.Monitoring --version 0.1.0
                    
NuGet\Install-Package SteadyCron.Monitoring -Version 0.1.0
                    
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="SteadyCron.Monitoring" Version="0.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SteadyCron.Monitoring" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="SteadyCron.Monitoring" />
                    
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 SteadyCron.Monitoring --version 0.1.0
                    
#r "nuget: SteadyCron.Monitoring, 0.1.0"
                    
#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 SteadyCron.Monitoring@0.1.0
                    
#: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=SteadyCron.Monitoring&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=SteadyCron.Monitoring&version=0.1.0
                    
Install as a Cake Tool

SteadyCron .NET SDK

SteadyCron.Monitoring is the official .NET code-monitoring SDK for SteadyCron.

Wrap your scheduled jobs with TrackAsync and SteadyCron will:

  • Know when a job started, succeeded, or failed
  • Alert you when a job doesn't run on time (missed heartbeat)
  • Detect stuck runs that start but never finish

The monitor must already exist — create it in the Dashboard, via YAML manifest, or Terraform. The SDK never creates monitors. For a fully code-driven workflow, declare the monitor in your Terraform configuration or YAML manifest and reference it from your application by key: the cron schedule, alert rules, and SDK instrumentation all live in the same repository.


Installation

dotnet add package SteadyCron.Monitoring

Quick start

ASP.NET Core / Generic Host

// Program.cs
builder.Services.AddSteadyCron(o =>
{
    o.ApiKey = builder.Configuration["SteadyCron:ApiKey"]; // read-only key
    o.Environment = builder.Environment.EnvironmentName;   // optional
});
// YourWorker.cs
public class BackupWorker(ISteadyCronMonitor monitor) : BackgroundService
{
    protected override async Task ExecuteAsync(CancellationToken ct)
    {
        await monitor.TrackAsync("nightly-db-backup", async ct =>
        {
            await RunBackupAsync(ct);
        }, ct);
    }
}

Console / standalone (no DI)

var monitor = SteadyCronMonitor.Create(new SteadyCronOptions
{
    ApiKey = Environment.GetEnvironmentVariable("STEADYCRON_API_KEY"),
});

await monitor.TrackAsync("nightly-db-backup", ct => RunBackupAsync(ct));

Authentication

The SDK uses a read-only API key to resolve monitor keys to ping tokens at startup. Create one in:

SteadyCron Dashboard → Settings → API keys → New key → Scope: Read-only

Set it via:

  • Environment variable: STEADYCRON_API_KEY=sc_ro_...
  • SteadyCronOptions.ApiKey directly
  • "SteadyCron:ApiKey" in appsettings.json

How it works

  1. On first use, the SDK calls GET /api/monitors/resolve?key=<your-key> with the read-only API key to retrieve the ping token. The token is cached for 1 hour (configurable).
  2. All pings are fire-and-forget: a bounded timeout (~5 s) is applied; transport errors are logged and swallowed, never propagated.
  3. Resolution errors (404 unknown key, 409 ambiguous key, wrong kind) are raised immediately — they indicate misconfiguration.
  4. On exception inside TrackAsync, a fail ping is sent and the original exception is rethrown unchanged.

Configuration

Property Default Env var fallback
ApiKey null STEADYCRON_API_KEY
ApiUrl https://api.steadycron.com STEADYCRON_API_URL
PingUrl https://ping.steadycron.com STEADYCRON_PING_URL
Environment null STEADYCRON_ENVIRONMENT
CaptureErrors false
PingTimeout 5 seconds
ResolveCacheTtl 1 hour

Direct / token mode (hardened path)

If you cannot use API key resolution (e.g. air-gapped environments), set the ping token directly:

o.Monitors["nightly-db-backup"] = "hRkmWz8oZtlMFzvTAUdnRE";

The token is visible via Job detail → Code monitoring → Reveal ping token in the Dashboard.


Reliability contract

  • Ping failures are never propagated. A transport error, timeout, or non-2xx response from a ping is logged at Warning/Debug and discarded.
  • Resolution errors always propagate. A 404 or 409 from the resolve endpoint raises on first use; fix the key or remove the decorator.
  • Original exceptions pass through unchanged. TrackAsync does not wrap exceptions. The fail ping is sent before rethrowing.
  • No ping blocks the job. Pings run inline but are bounded by PingTimeout (default 5 s). A slow ping delays but never hangs the job.

License

MIT

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 was computed.  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 was computed.  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

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0 168 6/17/2026