diff --git a/src/content/docs/workers/wrangler/configuration.mdx b/src/content/docs/workers/wrangler/configuration.mdx index d5f9a6060e60da..9e5a14721a763d 100644 --- a/src/content/docs/workers/wrangler/configuration.mdx +++ b/src/content/docs/workers/wrangler/configuration.mdx @@ -63,6 +63,10 @@ Top-level keys apply to the Worker as a whole (and therefore all environments). - Whether Wrangler should keep variables configured in the dashboard on deploy. Refer to [source of truth](#source-of-truth). +- `migrations` + + - When making changes to your Durable Object classes, you must perform a migration. Refer to [Durable Object migrations](/durable-objects/reference/durable-objects-migrations/). + - `send_metrics` - Whether Wrangler should send usage metrics to Cloudflare for this project. @@ -161,13 +165,13 @@ At a minimum, the `name`, `main` and `compatibility_date` keys are required to d - `logpush` - - Enables Workers Trace Events Logpush for a Worker. Any scripts with this property will automatically get picked up by the Workers Logpush job configured for your account. Defaults to `false`. + - Enables Workers Trace Events Logpush for a Worker. Any scripts with this property will automatically get picked up by the Workers Logpush job configured for your account. Defaults to `false`. Refer to [Workers Logpush](/workers/observability/logs/logpush/). - `limits` - Configures limits to be imposed on execution at runtime. Refer to [Limits](#limits). -* `observability` object optional +* `observability` - Configures automatic observability settings for telemetry data emitted from your Worker. Refer to [Observability](#observability). @@ -322,6 +326,26 @@ Example: crons = ["* * * * *"] ``` +## Observability + +The [Observability](/workers/observability/logs/workers-logs) setting allows you to automatically ingest, store, filter, and analyze logging data emitted from Cloudflare Workers directly from your Cloudflare Worker's dashboard. + +- `enabled` + + - When set to `true` on a Worker, logs for the Worker are persisted. Defaults to `true` for all new Workers. + +- `head_sampling_rate` + - A number between 0 and 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%). Read more about [head-based sampling](/workers/observability/logs/workers-logs/#head-based-sampling). + +Example: + +```toml title="wrangler.toml" +[observability] +enabled = true +head_sampling_rate = 0.1 # 10% of requests are logged +``` + + ## Custom builds You can configure a custom build step that will be run before your Worker is deployed. Refer to [Custom builds](/workers/wrangler/custom-builds/). @@ -510,7 +534,7 @@ When making changes to your Durable Object classes, you must perform a migration - The new Durable Objects being defined. -- `renamed_classes` +- `renamed_classes` - The Durable Objects being renamed. @@ -629,28 +653,6 @@ binding = "" id = "" ``` -### Observability - -The [Observability](/workers/observability/logs/workers-logs) setting allows you to automatically ingest, store, filter, and analyze logging data emitted from Cloudflare Workers directly from your Cloudflare Worker's dashboard. - -- `enabled` boolean required - - - When set to `true` on a Worker, logs for the Worker are persisted. Defaults to `true` for all new Workers. - -- `head_sampling_rate` number optional - - A number between 0 and 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%). Read more about [head-based sampling](/workers/observability/logs/workers-logs/#head-based-sampling). - -Example: - -```toml title="wrangler.toml" -[observability] -enabled = true - -[observability] -enabled = true -head_sampling_rate = 0.1 # 10% of requests are logged -``` - ### Queues [Queues](/queues/) is Cloudflare's global message queueing service, providing [guaranteed delivery](/queues/reference/delivery-guarantees/) and [message batching](/queues/configuration/batching-retries/). To interact with a queue with Workers, you need a producer Worker to send messages to the queue and a consumer Worker to pull batches of messages out of the Queue. A single Worker can produce to and consume from multiple Queues.