New Worker Timing Field Available in Ruleset Engine
Cloudflare has introduced the cf.timings.worker_msec field to the Ruleset Engine, giving developers direct visibility into Worker execution performance. This new field reports the wall-clock time spent executing a Cloudflare Worker on a per-request basis, measured in milliseconds.
Key Capabilities
The new field enables several practical use cases:
- Performance Monitoring: Identify slow Worker executions and monitor execution time trends
- Regression Detection: Detect unexpected increases in Worker processing time that indicate performance regressions
- Conditional Rules: Build rules that respond differently based on Worker latency, such as logging, rate limiting, or routing based on execution time
- Threshold-Based Actions: Create alerts or actions when Worker execution exceeds specified thresholds
Field Details
The cf.timings.worker_msec field returns an integer representing milliseconds spent in Worker execution. If no Worker was invoked for a request, the field returns 0.
Usage Example
Developers can create filter expressions like:
cf.timings.worker_msec > 500
This would match any request where Worker execution exceeded 500 milliseconds, allowing for targeted alerting or logging of slow requests.
Getting Started
Refer to the Fields reference documentation for complete implementation details and additional examples.