Skip to content

Tail Worker for Cloudflare Analytics Engine

Tail Workers Pattern: Intercepts logs and execution status from the main build worker in real time, transmits them to the Cloudflare Analytics Engine, then builds a real-time dashboard using SQL.

Tail Workers are not executed separately; they are automatically triggered by Cloudflare infrastructure whenever logs are generated by the main worker.

  • tail(events): Processes event arrays
  • event: scriptName, outcome, exceptions, logs, eventTimestamp
  • MONITORING_ENGINE.put(metadata): Sends blobs (domain, outcome, scriptName, error message) and doubles (timestamp, exception count)
  • Asynchronous data loading to minimize impact on build performance
  • Logs only are retained upon transmission failure; main workflow is not interrupted