Skip to content

Commit ab0b2b0

Browse files
authored
[Logs]Update workers-logs.mdx
The info on CF dashboard is 0-100% and the valid range in wrangler is 0 - 1 (where 1 = 100% and 0.1 = 10%).
1 parent 8274d3c commit ab0b2b0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/content/docs/workers/observability/logs/workers-logs.mdx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,14 +147,17 @@ After you deploy the code above, view your Worker's logs in [the dashboard](/wor
147147

148148
Head-based sampling allows you to log a percentage of incoming requests to your Cloudflare Worker. Especially for high-traffic applications, this helps reduce log volume and manage costs, while still providing meaningful insights into your application's performance. When you configure a head-based sampling rate, you can control the percentage of requests that get logged. All logs within the context of the request are collected.
149149

150-
To enable head-based sampling, set `head_sampling_rate` within the observability configuration. The valid range is from 0 to 1, where 0 indicates zero out of one hundred requests are logged, and 1 indicates every request is logged. If `head_sampling_rate` is unspecified, it is configured to a default value of 1 (100%). In the example below, `head_sampling_rate` is set to 0.01, which means one out of every one hundred requests is logged.
150+
To enable head-based sampling, set `head_sampling_rate` within the observability configuration in your Worker's `wrangler.toml`. The valid range is from 0 to 1, where 0 indicates zero out of one hundred requests are logged, and 1 indicates every request is logged. If `head_sampling_rate` is unspecified, it is configured to a default value of 1 (100%). In the example below, `head_sampling_rate` is set to 0.01, which means one out of every one hundred requests is logged.
151151

152152
```toml
153153
[observability]
154154
enabled = true
155155
head_sampling_rate = 0.01 # 1% sampling rate
156156
```
157+
:::note
158+
The head-based sampling range displayed on the Cloudflare dashboard is from 0 to 100(%).
157159

160+
:::
158161
## Limits
159162

160163
| Description | Retention |

0 commit comments

Comments
 (0)