Skip to content

Commit d022a17

Browse files
authored
[Rules] Add cf.timings.worker_msec field and changelog (#29074)
1 parent 290628f commit d022a17

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
title: Worker execution timing field now available in Rules
3+
description: Use the new cf.timings.worker_msec field to build rules based on Cloudflare Worker execution time.
4+
date: 2026-03-18
5+
---
6+
7+
The `cf.timings.worker_msec` field is now available in the Ruleset Engine. This field reports the wall-clock time that a Cloudflare Worker spent handling a request, measured in milliseconds.
8+
9+
You can use this field to identify slow Worker executions, detect performance regressions, or build rules that respond differently based on Worker processing time, such as logging requests that exceed a latency threshold.
10+
11+
### Field details
12+
13+
| Field | Type | Description |
14+
| --- | --- | --- |
15+
| `cf.timings.worker_msec` | Integer | The time spent executing a Cloudflare Worker in milliseconds. Returns `0` if no Worker was invoked. |
16+
17+
Example filter expression:
18+
19+
```
20+
cf.timings.worker_msec > 500
21+
```
22+
23+
For more information, refer to the [Fields reference](/ruleset-engine/rules-language/fields/reference/cf.timings.worker_msec/).

src/content/fields/index.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -940,6 +940,23 @@ entries:
940940
# Matches requests where the origin response time (TTFB) was greater than 2 seconds:
941941
cf.timings.origin_ttfb_msec > 2000
942942
943+
- name: cf.timings.worker_msec
944+
data_type: Integer
945+
categories: [Request]
946+
keywords: [request, timing, workers, performance, latency]
947+
summary: The time spent executing a Cloudflare Worker in milliseconds.
948+
description: |-
949+
This field provides the wall-clock time that a Cloudflare Worker spent handling the request, measured in milliseconds.
950+
951+
Use this field to identify slow Worker executions, set up alerts for performance regressions, or add Worker execution time as a request header using Transform Rules for downstream observability.
952+
953+
If the request did not invoke a Worker, the value of this field will be `0`.
954+
example_value: |-
955+
12
956+
example_block: |-
957+
# Matches requests where the Worker execution time exceeded 500 milliseconds
958+
cf.timings.worker_msec > 500
959+
943960
- name: cf.waf.content_scan.has_obj
944961
data_type: Boolean
945962
categories: [Request]

0 commit comments

Comments
 (0)