Tail Worker for Cloudflare Analytics Engine
Overview
Section titled “Overview”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.
Core Structure
Section titled “Core Structure”- 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)
Operational Principles
Section titled “Operational Principles”- Asynchronous data loading to minimize impact on build performance
- Logs only are retained upon transmission failure; main workflow is not interrupted
Related Documents
Section titled “Related Documents”- GitHub Actions and Worker Debugging — Logpush·Version Logging
- Messaging and Observability Analysis — Observability Solution Comparison