Camera Health Monitoring
The CameraPingOrchestrator is a Durable Functions orchestration that performs system-wide camera health checks using a fan-out/fan-in pattern.
Fan-Out/Fan-In Patternβ
How It Worksβ
Step 1: Get Camera Listβ
The GetCameraIdRequest activity fetches all active camera IDs from the data store.
Step 2: Parallel Health Checkβ
For each camera, a GetModelNumberByDevice activity is launched in parallel:
- Calls
IVAPIXClient.GetModelNumberAsync()on the camera - If the camera responds, it returns the model number
- If the camera is unreachable, it throws an exception
Step 3: Collect Resultsβ
The orchestrator waits for all activities to complete using Task.WhenAll().
Step 4: Log Failuresβ
Cameras that failed to respond are written to Blob Storage via WriteErrorCamerasToBlob:
- Creates a blob with the list of non-responsive cameras
- Includes the error details and timestamp
- Can be used for alerting and dashboards
When It Runsβ
The orchestrator can be triggered:
- Manually via HTTP endpoint for on-demand health checks
- On schedule via timer trigger for periodic monitoring
Why Not Use Individual Timers?β
With hundreds of cameras, individual timer-triggered health checks would create excessive function invocations. The fan-out/fan-in pattern:
- Uses a single orchestrator instance
- Runs all checks in parallel within the Durable Functions framework
- Handles partial failures gracefully (one camera failing doesn't block others)