Skip to main content

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)