Repository navigation
fix(api): SLA compliance endpoint honors the definition's targets and exclusion flags (#9371) - #9494
Conversation
… exclusion flags; drop dead history read (#9371) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Deploying breeze with
|
| Latest commit: |
f76bf89
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://25b30cbd.breeze-9te.pages.dev |
| Branch Preview URL: | https://fix-9371-sla-compliance-hone.breeze-9te.pages.dev |
…ported, group targets denied to narrowed callers, DST-safe weekend window (#9371) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Review run: /pr-review-toolkit:review-pr (code-reviewer, scoped to code + tests + error handling) |
Summary
GET /analytics/sla/:id/compliancenow measures the definition's own targets (site/device/groupviatarget_type+target_ids; org-wide otherwise; a scoped definition with no targets measures nothing, never the whole org) and returnsuptimeTarget,meetsTargetand anexclusionsblock alongsideliveUptime.exclude_weekends: Sat/Sun do not count toward the window length (window reaches back over the same number of weekdays).exclude_maintenance_windows: devices in a maintenance window right now (existingisDeviceInMaintenance) leave numerator and denominator. Point-in-time only, checked for up to 500 target devices (exclusions.maintenanceWindows=applied/skipped_too_many_devices). Historical window overlap needs the availability-interval work (Uptime KPIs from data Breeze already has: site WAN and device availability, with maintenance excluded #9273).history: []returned honestly (nothing writessla_compliance; no period-close writes added). Deadhistory[0].compliancePercentagereads removed from the web page.Linked Issues
Closes #9371
Merge Danger
Door: two-way (revert the PR; no schema/migration change)
Blast radius: SLA uptime figure on the Analytics page / compliance endpoint
Type of Change
Tests
apps/apivitest run src/routes/analytics.test.ts: 51 passed.apps/webvitest run src/components/analytics: 3 files / 10 tests passed.tsc --noEmitexit 0 inapps/apiandapps/web.🤖 Generated with Claude Code