Enable observability and Smart Placement
Two production-readiness settings are opt-in because they change how your Worker is observed and placed:
- Observability (
observability.enabled = true) retains your Worker’s logs so you can query them in the dashboard. - Smart Placement (
placement.mode = "smart") lets Cloudflare run your Worker in the location closest to the backend it talks to most.
Both write into wrangler.jsonc (or wrangler.json); comments and formatting are preserved.
At scaffold time
Section titled “At scaffold time”Pass the flags to the application generator:
bunx nx g @naxodev/nx-cloudflare:application apps/my-worker --type=hello-world --observability --smartPlacement
On an existing Worker
Section titled “On an existing Worker”Use the worker-config generator:
-
Enable observability
bunx nx g @naxodev/nx-cloudflare:worker-config --project=my-worker --observability -
Enable Smart Placement
bunx nx g @naxodev/nx-cloudflare:worker-config --project=my-worker --smartPlacement
You can pass both flags at once. At least one is required.
Verify
Section titled “Verify”Open wrangler.jsonc — you should see:
{
"observability": { "enabled": true },
"placement": { "mode": "smart" }
}
Next steps
Section titled “Next steps”- worker-config generator — full option reference
- Cloudflare: Workers observability
- Cloudflare: Smart Placement
- Manage Worker secrets