Skip to content

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.

Pass the flags to the application generator:

bunx nx g @naxodev/nx-cloudflare:application apps/my-worker --type=hello-world --observability --smartPlacement

Use the worker-config generator:

  1. Enable observability

    bunx nx g @naxodev/nx-cloudflare:worker-config --project=my-worker --observability
  2. 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.

Open wrangler.jsonc — you should see:

{
  "observability": { "enabled": true },
  "placement": { "mode": "smart" }
}