← Standards

worker

A repo with a wrangler.toml or wrangler.jsonc enables both [observability] and [observability.logs] with invocation_logs = true, and sets workers_dev = false, since every estate worker is reached on its own routed or custom domain. Reference's own site/wrangler.toml is the live example; the web starter in ../repository/templates/web-starter/wrangler.toml ships the same blocks.

What this standard checks

Generated from ./check.sh, in the order the check runs them.

assertion target pattern or value note
applies at all, or stops the run wrangler.toml or wrangler.jsonc a repo with no wrangler file deploys no worker, and nothing here governs it; governs repos that deploy a Cloudflare Worker
some file matches wrangler.toml ^\[observability\]|"observability"[[:space:]]*: a worker deployed without the observability block keeps no request record to read when it misbehaves; any file of that name in the repo, or matching wrangler.jsonc; build dirs skipped
some file matches wrangler.[t]oml ^\[observability\.logs\]|"logs"[[:space:]]*: the logs table is what turns on persisted logs, separately from the sampled traces above it; any file of that name in the repo, or matching wrangler.jsonc; build dirs skipped
some file matches wrangler.t[o]ml ^enabled = true|"enabled"[[:space:]]*:[[:space:]]*true a block left at enabled = false reads as configured and records nothing; any file of that name in the repo, or matching wrangler.jsonc; build dirs skipped
some file matches wrangler.to[m]l ^invocation_logs = true|"invocation_logs"[[:space:]]*:[[:space:]]*true without invocation logs a worker that threw before reaching its own logging leaves no trace; any file of that name in the repo, or matching wrangler.jsonc; build dirs skipped
some file matches wrangler.tom[l] ^workers_dev = false|"workers_dev"[[:space:]]*:[[:space:]]*false left on, the worker answers on its workers.dev hostname beside its routed domain, an unmonitored second front; any file of that name in the repo, or matching wrangler.jsonc; build dirs skipped

How to satisfy

workers_dev = false

[observability]
enabled = true
head_sampling_rate = 1

[observability.logs]
enabled = true
invocation_logs = true

Done when check.sh reports green. A repo with no wrangler file is not governed and reports not applicable. A worker that is meant to be reached on workers.dev declares worker/grep:wrangler.tom[l] in Deviations.

fetch as markdown
curl https://reference.dunn.dev/standards/worker/index.md
check conformance
just -f ~/gitlab.com/dunn.dev/reference/justfile check