SLA Monitoring¶
Craft Easy Admin includes two built-in SLA views accessible from the admin sidebar under the sla route group: the Violations Dashboard and the Upcoming Schedule Calendar.
SLA Violations Dashboard¶
Route: /(admin)/sla/violations
The violations dashboard lists all SLA violations detected by the backend. A violation is created when an import template with a schedule expectation misses its expected delivery window.
What Is Displayed¶
Each violation card shows:
| Field | Description |
|---|---|
| Template name | The import template that missed its SLA |
| Severity badge | INFO, WARNING, or CRITICAL |
| Status | open, escalated, resolved, or acknowledged |
| Expected | When the delivery was expected to arrive |
| Deadline | Latest acceptable arrival time |
| Detected | When the violation was first detected |
| Missed windows | Number of consecutive missed windows (shown when > 1) |
| Resolved | Timestamp when the late delivery arrived (shown when resolved) |
Status Filter¶
The dashboard provides four filter tabs:
| Tab | Shows |
|---|---|
| Open | New, unacknowledged violations |
| Escalated | Violations that have missed multiple consecutive windows |
| Resolved | Violations resolved by a late-arriving delivery |
| Acknowledged | Violations manually acknowledged by an operator |
Acknowledging a Violation¶
Violations with status open or escalated display an Acknowledge button. Pressing it calls:
Acknowledged violations are moved to the acknowledged status and removed from the open filter view.
API Endpoints Used¶
GET /sla/violations?status={status}&limit=50 → { items: SLAViolation[], total: number }
POST /sla/violations/{id}/acknowledge → 200 OK
Configuring SLA on an Import Template¶
SLA is configured per import template using a schedule expectation — a structured object that defines when deliveries are expected and how violations should be escalated.
The ScheduleExpectationEditor field widget appears on import template create/edit forms when the backend schema exposes a schedule_expectation field of widget type schedule_expectation.
Schedule Expectation Fields¶
| Field | Type | Description |
|---|---|---|
cron_expression |
string | Standard 5-field cron expression defining the expected delivery schedule |
timezone |
string | IANA timezone for evaluating the cron expression (e.g. Europe/Stockholm) |
tolerance_minutes_before |
integer | Minutes before the scheduled time when a delivery is considered on-time |
tolerance_minutes_after |
integer | Minutes after the scheduled time before a violation is raised |
grace_period_misses |
integer | Number of consecutive misses before escalation (default: 1) |
warning_severity |
string | Severity level for the first miss (info, warning, or critical) |
critical_severity |
string | Severity level after grace period is exceeded |
holiday_calendar |
string | null | ID of a holiday calendar; scheduled windows on holidays are skipped |
alert_channels |
string[] | List of alert channel identifiers to notify on violation |
is_active |
boolean | Disabling prevents new violations from being generated |
Cron Quick-Presets¶
The editor provides one-tap presets for common patterns:
| Label | Expression |
|---|---|
| Weekdays 07:00 | 0 7 * * 1-5 |
| Daily 23:00 | 0 23 * * * |
| Monday 04:00 | 0 4 * * 1 |
| 1st of month | 0 0 1 * * |
Example Configuration¶
{
"cron_expression": "0 7 * * 1-5",
"timezone": "Europe/Stockholm",
"tolerance_minutes_before": 0,
"tolerance_minutes_after": 60,
"grace_period_misses": 1,
"warning_severity": "warning",
"critical_severity": "critical",
"holiday_calendar": "se-public-holidays",
"alert_channels": ["ops-slack"],
"is_active": true
}
With this configuration, a violation is raised if no delivery arrives between 07:00 and 08:00 Stockholm time on a weekday. The first miss generates a warning; a second consecutive miss escalates to critical.
Which Views Show SLA Data¶
- ImportTemplate DetailView — displays the current
schedule_expectationin read-only format - ImportTemplate EditView — shows the
ScheduleExpectationEditorfor modifying the expectation - SLA Violations Dashboard — lists all violations across all templates
- Upcoming Schedule Calendar — shows future delivery windows for a specific template
Upcoming Schedule Calendar¶
Route: /(admin)/sla/schedule
The schedule calendar shows all expected delivery windows for a single import template over the next N days.
How to Use¶
- Enter the Template ID in the input field.
- Press Load to fetch the calendar.
- The view shows the template name and timezone in a header, followed by a list of expected delivery windows.
What Is Displayed¶
Each row in the calendar shows:
| Column | Description |
|---|---|
| Expected | The start of the delivery window (expected_at) |
| Deadline | Latest acceptable arrival (deadline_at) |
| HOLIDAY badge | Shown when the window falls on a configured holiday — the delivery is still listed but will be skipped by the SLA engine |
Holiday entries are displayed with a muted background to distinguish them from regular windows.
Days Range¶
The default view covers the next 14 days. The days query parameter is passed to the backend:
GET /sla/import-templates/{templateId}/schedule-calendar?days=14
→ {
template_id: string,
template_name: string,
timezone: string,
entries: [{ expected_at, deadline_at, is_holiday }]
}
Navigation¶
The schedule calendar is accessible from the admin sidebar as a fixed route (/sla/schedule) — it is not tied to the schema-driven resource list. No schema configuration is required for it to appear.