🖥️

System Health & Monitoring

Monitor system metrics, storage usage, background jobs, and configure scheduled reports

4 min read

Overview

The System Health section provides platform admins with visibility into the technical health of the SehaFile infrastructure. Monitor API response times, database performance, storage consumption, background job statuses, and overall system availability. This section also includes scheduled reports management, allowing you to automate regular report delivery. Requires the settings.view permission for viewing and reports.manage for managing scheduled reports.

System health dashboard showing service status, metrics, and storage indicators

System Health Overview

  1. Navigate to System > Health from the sidebar.
  2. Service status panel — Shows the operational status of each component:
    • API Server — Backend service status (healthy/degraded/down)
    • Database (PostgreSQL) — Connection pool status, query latency
    • Redis Cache — Cache hit rate, memory usage
    • Object Storage (MinIO/GCS) — Availability and response time
    • Email Service — SMTP connectivity status
    • SMS Provider — OTP delivery status
  3. Status indicators — Green circle (healthy), yellow (degraded performance), red (service down or unreachable).

System Metrics

  1. Navigate to System > Metrics for detailed performance data.
  2. Key metrics displayed:
    • API Response Time — Average, P95, and P99 latency over the past hour
    • Request Volume — Total API requests per minute/hour with trend chart
    • Error Rate — Percentage of 4xx and 5xx responses
    • Database Queries — Average query execution time, slow query count
    • Active Connections — Current database and Redis connection counts
    • Memory Usage — Application memory consumption
  3. Time range selector — View metrics for the last 1 hour, 6 hours, 24 hours, or 7 days.

Storage Usage

  1. Navigate to System > Storage to view platform-wide storage consumption.
  2. Storage breakdown:
    • Total storage used — Aggregate across all clinics
    • By clinic — Top 20 clinics by storage consumption
    • By file type — Documents, images, X-rays, lab results, prescriptions
    • Growth trend — Monthly storage growth rate
  3. Storage alerts — The system warns when total usage approaches plan limits or when individual clinics exceed their allocated storage.

Background Jobs

  1. Navigate to System > Jobs to monitor background task execution.
  2. Job categories:
    • Subscription checks — Automated expiry detection and grace period transitions
    • Notification delivery — Queued notification processing
    • Analytics aggregation — Clinical analytics pipeline runs
    • Report generation — Scheduled report compilation
    • Credential expiry checks — Doctor credential monitoring
    • Backup tasks — Database backup status
  3. Job status indicators — Running (blue spinner), Completed (green check), Failed (red X with error details), Scheduled (clock icon with next run time).

Scheduled Reports

  1. Navigate to Reports > Scheduled to manage automated report delivery.
  2. Create a scheduled report:
    • Click "New Scheduled Report"
    • Select report type (revenue, growth, clinic health, enforcement pipeline, etc.)
    • Set frequency: daily, weekly (choose day), or monthly (choose date)
    • Set delivery method: email to specified addresses, or downloadable from the platform
    • Set format: PDF, CSV, or JSON
  3. Manage existing reports — Edit schedule, pause/resume, trigger manually, or delete.
  4. View run history — Click "History" on any scheduled report to see past executions, delivery status, and download previous outputs.
  5. Trigger manually — Click "Run Now" to generate a report immediately outside its normal schedule.
Tip: Set up a weekly scheduled report for "Enforcement Pipeline" to be emailed every Sunday evening. This gives you a Monday morning view of clinics that need attention, without manually checking the dashboard.
Warning: If a background job shows "Failed" status repeatedly, investigate immediately. Failed subscription check jobs can result in clinics not being properly transitioned to grace period or suspension, causing revenue leakage.

Platform Settings

  1. Navigate to System > Settings to view and modify platform-wide configuration.
  2. Available settings include:
    • Default trial period days
    • Default grace period days
    • Maximum file upload size
    • OTP expiry duration
    • Session timeout duration
    • Maintenance mode toggle
  3. Batch update — Modify multiple settings at once using the batch update form. Changes take effect immediately.

FAQ

What should I do if a service shows "degraded" status?

Degraded status means the service is operational but performing below normal thresholds. Check the metrics page for details on what is slow (database queries, external API calls, etc.). If degradation persists for more than 15 minutes, escalate to the engineering team.

How often do background jobs run?

Subscription checks run every hour. Analytics aggregation runs every 6 hours. Credential expiry checks run daily at 2 AM Cairo time. Report generation runs according to each report's configured schedule.

Can I receive alerts when a service goes down?

System health monitoring is configured at the infrastructure level (Cloud Run health checks). Platform admins see the status on the dashboard. For real-time alerting, use the platform's integration with monitoring services configured by the engineering team.

Was this article helpful?