Lyo.Job.Alerts
2.0.1
dotnet add package Lyo.Job.Alerts --version 2.0.1
NuGet\Install-Package Lyo.Job.Alerts -Version 2.0.1
<PackageReference Include="Lyo.Job.Alerts" Version="2.0.1" />
<PackageVersion Include="Lyo.Job.Alerts" Version="2.0.1" />
<PackageReference Include="Lyo.Job.Alerts" />
paket add Lyo.Job.Alerts --version 2.0.1
#r "nuget: Lyo.Job.Alerts, 2.0.1"
#:package Lyo.Job.Alerts@2.0.1
#addin nuget:?package=Lyo.Job.Alerts&version=2.0.1
#tool nuget:?package=Lyo.Job.Alerts&version=2.0.1
Lyo.Job.Alerts
Hosted JobAlertConsumer that binds the job.notifications.alert routing key on the job.events exchange, deserializes JobAlertEvent payloads, and sends them through INotificationPublisher (in-process handlers) and/or an optional HTTP webhook.
Alert producers include JobService (SLA breaches), JobScheduler (failures, circuit breaker), and JobMaintenanceService (dead jobs, SLA scans) via IJobEventPublisher.PublishAlertAsync.
Examples
Register in DI
services.AddJobAlerts(configuration);
// Or inline options:
services.AddJobAlerts(o => {
o.AlertWebhookUrl = "https://hooks.example.com/job-alerts";
});
Options (JobAlertsOptions.SectionName = "JobAlerts")
{
"JobAlerts": {
"AlertWebhookUrl": "https://hooks.example.com/job-alerts"
}
}
Registration
IMqService must already be registered and connected. INotificationPublisher is optional. When it is missing, only the webhook path runs (if configured).
Options (JobAlertsOptions.SectionName = "JobAlerts")
| Property | Default | Notes |
|---|---|---|
AlertWebhookUrl |
null |
Each alert is POSTed as JSON to this URL when it is set. |
JobAlertConsumer does not read per-definition AlertWebhookUrl on JobDefinition (that field is persisted for custom integrations). Alerts from this package leave through JobAlertsOptions.AlertWebhookUrl (or INotificationPublisher handlers).
Alert kinds (JobAlertType)
| Type | Usually produced by |
|---|---|
Failure |
After consecutive failures the scheduler fires (AlertOnFailure) |
CircuitBreakerTripped |
The scheduler turns the definition off |
DeadJob |
Maintenance timeout (heartbeat missing) |
SlaBreach |
SLA checks in JobService start/finish; maintenance SLA scan |
JobAlertEvent payload
public sealed record JobAlertEvent(
Guid DefinitionId,
Guid? RunId,
JobAlertType AlertType,
string Message,
DateTime Timestamp) : INotification;
When you use INotificationPublisher, implement INotificationHandler<JobAlertEvent> (or your app's notification pipeline).
How it flows
flowchart LR
pub[JobService / Scheduler / Maintenance] --> ex[job.events]
ex -->|job.notifications.alert| q[job.notifications.alert queue]
q --> c[JobAlertConsumer]
c --> n[INotificationPublisher]
c --> w[HTTP webhook]
A transient dispatch failure requeues the message (HandleMessageAsync returns true).
Metrics
job.scheduler.circuit_breaker.trippedjob.sla.breach(Constants.Metrics.Sla.Breach)job.maintenance.dead_jobs.failed
Dependencies
Generated from ProjectReference / PackageReference (same model as docs/Lyo.ProjectGraph.html).
Lyo.Common.Core(direct, lyo)Lyo.Job.Models(direct, lyo)Lyo.MessageQueue(direct, lyo)Lyo.Metrics(direct, lyo)Lyo.Notification(direct, lyo)Microsoft.Extensions.Hosting.Abstractions10.0.5(direct, microsoft)Microsoft.Extensions.Http10.0.5(direct, microsoft)Microsoft.Extensions.Options.ConfigurationExtensions10.0.5(direct, microsoft)Lyo.Api.Models(transitive, lyo)Lyo.Common.Json(transitive, lyo)Lyo.Common.Metadata(transitive, lyo)Lyo.DateAndTime(transitive, lyo)Lyo.Exceptions(transitive, lyo)Lyo.Health(transitive, lyo)Lyo.Parameters(transitive, lyo)Lyo.Query.Models(transitive, lyo)Lyo.Result(transitive, lyo)Lyo.Schedule.Models(transitive, lyo)Microsoft.Bcl.AsyncInterfaces10.0.5(transitive, microsoft, netstandard2.0)Microsoft.Extensions.DependencyInjection10.0.5(transitive, microsoft)Microsoft.Extensions.Logging.Abstractions10.0.5(transitive, microsoft)System.Diagnostics.DiagnosticSource10.0.5(transitive, microsoft, netstandard2.0)System.Memory4.6.3(transitive, microsoft, netstandard2.0)System.Text.Json10.0.5(transitive, microsoft, netstandard2.0)
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
-
net10.0
- Lyo.Common.Core (>= 2.0.0)
- Lyo.Job.Models (>= 2.0.1)
- Lyo.MessageQueue (>= 2.0.1)
- Lyo.Metrics (>= 2.0.0)
- Lyo.Notification (>= 2.0.0)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.5)
- Microsoft.Extensions.Http (>= 10.0.5)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.5)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.