Skip to main content

Telemetry & Monitoring

The Image Acquisition Engine uses Application Insights for custom telemetry tracking, providing visibility into acquisition success rates, camera health, and performance.

Custom Metricsโ€‹

The engine tracks custom metrics via TelemetryClient (registered as a singleton):

Acquisition Success/Failureโ€‹

MetricValueMeaning
SUCCESS10Image captured and stored successfully
FAIL1Image capture or storage failed

The asymmetric values (10 vs 1) ensure that a high success rate is clearly visible in aggregated dashboards โ€” a single failure doesn't skew the average.

Dimensionsโ€‹

Each telemetry event includes:

  • Device ID โ€” Which camera
  • Error Kind โ€” Failure category (camera unreachable, storage timeout, VAPIX error, etc.)
  • Acquisition Rate โ€” Configured capture interval
  • Mode โ€” Current acquisition mode

Monitoring Approachโ€‹

Real-Time Healthโ€‹

  • DurableDataStoreService syncs entity state to Table Storage every iteration
  • The Admin API reads Table Storage for dashboard displays
  • SignalR broadcasts provide real-time status to the frontend

ESRI Status Reportingโ€‹

  • Camera online/offline status is submitted to ESRI feature layers
  • Status changes are detected by comparing current capture success to the previous iteration
  • This updates the camera's status on the public-facing map

Application Insights Queriesโ€‹

Common KQL queries for monitoring:

Acquisition success rate by camera:

customMetrics
| where name == "ImageAcquisition"
| summarize SuccessRate = sumif(value, value == 10) / sum(value) * 100 by deviceId
| order by SuccessRate asc

Failure trends over time:

customMetrics
| where name == "ImageAcquisition" and value == 1
| summarize Failures = count() by bin(timestamp, 1h), deviceId
| order by timestamp desc

CORS Middlewareโ€‹

The engine includes a CorsMiddleware for local development:

  • Allows * origin
  • Allows standard HTTP methods and the x-api-key header
  • Only active in local development โ€” not applied in deployed environments