# 5. Integration Monitoring

User Type: **Super Administrator**
Source: *Mi Digital Academy - Education CRM Features Document*

---

## 5. Integration Monitoring

### 5.1 Connection Health Monitoring
**What it does:** Monitors the health and status of every active integration connection.
**Sub-features:**
- Health status per integration (healthy, degraded, down).
- Health check frequency and method (ping, auth check, test call).
- Credential expiry warnings (before expiry).
- Health dashboard (all integrations at a glance).
- available on web
- event logging (action performed)
- Audit logging of connection health monitoring
**Super Admin User Journey:**
1. Open Integrations & APIs → Monitoring → Connection Health.
2. Review the health dashboard for all integrations.
3. Check the health check frequency and method per integration.
4. Review credential expiry warnings.
5. Investigate any degraded or down connection.
**Rules & Edge Cases:**
- A connection that fails consecutive health checks is marked down and alerted.
- A credential expiring within the warning window raises a warning (not yet an alert).
- A degraded connection (intermittent failures) is marked degraded with the failure rate.
- A recovered connection is marked healthy and a recovery event is logged.
- A health check method that requires auth uses a read-only test call (no side effects).

### 5.2 Sync Status Tracking
**What it does:** Tracks the status of every sync operation across integrations.
**Sub-features:**
- Last sync time and duration per integration.
- Records synced (added, updated, removed, skipped).
- Pending/backlog count (records waiting to sync).
- Sync history (per run: start, end, result, counts).
- available on web
- event logging (action performed)
- Audit logging of sync status tracking
**Super Admin User Journey:**
1. Open Monitoring → Sync Status.
2. Review the last sync time and duration per integration.
3. Check the records synced counts and pending backlog.
4. Open the sync history for a specific run.
5. Investigate any run with a high skip or failure count.
**Rules & Edge Cases:**
- A sync that exceeds the expected duration is flagged as slow.
- A backlog growing beyond the threshold raises an alert.
- A skipped record is counted and listed with the skip reason.
- A sync history entry is immutable (not edited after the run completes).
- A manual sync run is distinguished from an automated run in the history.

### 5.3 Error Logging & Alerting
**What it does:** Logs integration errors and raises alerts on failures.
**Sub-features:**
- Error log (timestamp, integration, error type, message, record).
- Error classification (transient, permanent, auth, network).
- Retry tracking (attempts, backoff, final outcome).
- Alert rules (thresholds, severity, notification channel).
- Dead-letter queue (failed items for manual review).
- available on web
- event logging (action performed)
- Audit logging of error logging & alerting
**Super Admin User Journey:**
1. Open Monitoring → Errors & Alerts.
2. Review the error log and filter by integration/type.
3. Check the retry tracking for failed operations.
4. Configure the alert rules and notification channels.
5. Review the dead-letter queue and reprocess items.
**Rules & Edge Cases:**
- A transient error is retried; a permanent error is not (moved to dead-letter).
- An auth error suspends the integration and raises a high-severity alert.
- An alert fires only when the threshold is met (no alert spam below threshold).
- A dead-letter item reprocessed successfully is removed from the queue.
- A repeated error pattern (same error, many records) is grouped into one alert.

### 5.4 Data Consistency Checks
**What it does:** Detects and reconciles data mismatches between the platform and connected systems.
**Sub-features:**
- Consistency check scope (enrollment, grades, demographics, payments).
- Check frequency (scheduled, on-demand).
- Mismatch detection (field-level differences).
- Reconciliation action (auto-fix, flag for review, report only).
- Consistency report (mismatches found, resolved, outstanding).
- available on web
- event logging (action performed)
- Audit logging of data consistency checks
**Super Admin User Journey:**
1. Open Monitoring → Data Consistency.
2. Set the check scope and frequency.
3. Run a consistency check.
4. Review the mismatches found.
5. Apply the reconciliation action (auto-fix, flag, or report).
**Rules & Edge Cases:**
- A mismatch with action "report only" is logged but not changed.
- An auto-fix applies the source-of-truth value and logs the change.
- A mismatch that cannot be auto-resolved is flagged for manual review.
- A consistency check never deletes records (only updates or flags).
- A recurring mismatch (same record, repeated checks) is escalated.
