Skip to content

Commit 0cd8470

Browse files
committed
[workers-observability] add pricing partial, environment copy improvements
1 parent 16e56ce commit 0cd8470

File tree

3 files changed

+33
-11
lines changed

3 files changed

+33
-11
lines changed

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

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ sidebar:
1111

1212
---
1313

14-
import { TabItem, Tabs, Steps } from "~/components"
14+
import { TabItem, Tabs, Steps, Render } from "~/components"
1515

1616
Workers Logs lets you automatically collect, store, filter, and analyze logging data emitted from Cloudflare Workers. Data is written to your Cloudflare Account, and you can query it in the dashboard for each of your Workers. All newly created Workers will come with the observability setting enabled by default.
1717

@@ -32,19 +32,19 @@ You must add the observability setting for your Worker to write logs to Workers
3232
```toml
3333
[observability]
3434
enabled = true
35-
head_sampling_rate = 0.01 # optional. default = 1.
35+
head_sampling_rate = 1 # optional. default = 1.
3636
```
3737

3838
The default value for `head_sampling_rate` is 1, meaning 100% of your logs are sampled. `head_sampling_rate` can be set to a value between 0 and 1. For example, 0.01 indicates that 1% of your logs are sampled.
3939

4040
### Enabling with environments
4141

42-
[Environments](workers/wrangler/environments/) allow you to deploy the same Worker application with different configurations. To configure observability for your environment:
42+
[Environments](workers/wrangler/environments/) allow you to deploy the same Worker application with different configurations. For example, you may want to configure a different `head_sampling_rate` to staging and production. To configure observability for your environment:
4343
1. Add the following configuration below `[env.<NAME>]`
4444
```toml
4545
[env.<NAME>.observability]
4646
enabled = true
47-
head_sampling_rate = 0.1 # optional
47+
head_sampling_rate = 1 # optional
4848
```
4949
2. Deploy your Worker with `npx wrangler deploy -e <NAME>`
5050
3. Repeat step 1 and 2 for each environment.
@@ -119,11 +119,11 @@ async function handleRequest(request) {
119119

120120
</TabItem> </Tabs>
121121

122-
After you deploy the above code, view your Worker's logs in [the dashboard](/workers/observability/logs/workers-logs/#view-logs-from-the-dashboard) or with [real-time logs](/workers/observability/logs/real-time-logs/).
122+
After you deploy the code above, view your Worker's logs in [the dashboard](/workers/observability/logs/workers-logs/#view-logs-from-the-dashboard) or with [real-time logs](/workers/observability/logs/real-time-logs/).
123123

124124
### Head-based Sampling
125125

126-
Head-based sampling allows you to log only a subset of incoming requests to your Cloudflare Workers. Especially for high-traffic applications, this helps reduce log volume and manage costs, while still providing meaningful insights into your applications 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.
126+
Head-based sampling allows you to log only a subset of incoming requests to your Cloudflare Workers. 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.
127127

128128
To enable head-based sampling, simply set `head_sampling_rate` within the observability configuration. For example, setting a sampling rate of 0.01 (1%) will log one out of every one hundred requests. If the `head_sampling_rate` is unspecified, it is configured to a default value of 1 (100%).
129129

@@ -141,11 +141,10 @@ To enable head-based sampling, simply set `head_sampling_rate` within the observ
141141

142142
## Pricing
143143

144-
| | Logs | Retention |
145-
| ------------------ | ------------------------------------------------------------------ | ---------- |
146-
| **Workers Free** | 200,000 per day | 7 Days |
147-
| **Workers Paid** | 20 million included per month <br /> +$0.60 per additional million | 7 Days |
148-
144+
:::note[Billing start date]
145+
Workers Logs billing will begin on November 1, 2024.
146+
:::
147+
<Render file="workers_logs_pricing" />
149148

150149
### Example Pricing
151150

src/content/docs/workers/platform/pricing.mdx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,16 @@ To change your default account-wide usage model:
186186

187187
Existing Workers will not be impacted when changing the default usage model. You may change the usage model for individual Workers without affecting your account-wide default usage model.
188188

189+
## Workers Logs
190+
191+
<Render file="workers_logs_pricing" />
192+
193+
:::note[Workers Logs documentation]
194+
195+
For more information and [examples of Workers Logs billing](/workers/observability/logs/workers-logs/#example-pricing), refer to the [Workers Logs documentation](/workers/observability/logs/workers-logs).
196+
197+
:::
198+
189199
## Workers Trace Events Logpush
190200

191201
Workers Logpush is only available on the Workers Paid plan.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
{}
3+
4+
---
5+
6+
import { Markdown } from "~/components"
7+
8+
Workers Logs is included in both the Free and Paid [Workers plans](/workers/platform/pricing/).
9+
10+
| | Log Lines Written | Retention |
11+
| ------------------ | ------------------------------------------------------------------ | ---------- |
12+
| **Workers Free** | 200,000 per day | 7 Days |
13+
| **Workers Paid** | 20 million included per month <br /> +$0.60 per additional million | 7 Days |

0 commit comments

Comments
 (0)