Lesson 9 of 9 · 26m
Production Rollout, Observability, and Operations
Operate Deno services with explicit versioning, permission manifests, health contracts, telemetry, rollback drills, and incident-ready deployment evidence.
The migration is not done when the service starts. It is done when the service survives deploys, dependency updates, bad configuration, traffic spikes, and an engineer trying to diagnose it at 3 a.m. Deno gives you clean tooling, but operations are still operations: versioned artifacts, clear health semantics, logs you can query, rollback you have rehearsed, and permissions that document intent.
Make versions and provenance visible
At minimum expose build metadata internally:
const build = {
version: Deno.env.get("APP_VERSION") ?? "dev",
deno: Deno.version.deno,
v8: Deno.version.v8,
typescript: Deno.version.typescript,
};
Deno.serve((req) => {
if (new URL(req.url).pathname === "/internal/version") {
return Response.json(build);
}
return new Response("not found", { status: 404 });
});When an incident starts, "which artifact is running?" should be a query, not archaeology. Include lockfile digest and image digest in deploy records.
Health checks need semantics
Do not return 200 because the process can allocate a response. Distinguish:
/livez process is running
/readyz required dependencies and initialization are usable
/healthz aggregate only if you define component semantics clearlyReadiness should fail when the database is unavailable, migration state is incompatible, or mandatory configuration is missing. It should not flap because a noncritical optional dependency hiccups.
Telemetry is a compatibility requirement
If the Node service emitted traces and the Deno replacement does not, you did not achieve operational parity. Validate:
structured logs with request IDs
OpenTelemetry traces through inbound and outbound calls
metrics for latency, errors, saturation, and dependency health
shutdown and panic behavior
runtime version and dependency provenanceA common migration regression is losing context propagation because the HTTP abstraction changed. Users experience this as "the system feels flaky"; operators experience it as blindness.
Roll out as a controlled experiment
Use canary percentages, shadow traffic, or blue/green deployment depending on platform maturity. Record the exact comparison:
baseline p50/p95/p99 latency
error rate by class
memory and CPU at steady state
cold-start or startup time
connection pool behavior
queue lag or background job completion
permission denials and unexpected host accessDo not only measure average latency. Runtime differences often show up in tail latency, shutdown behavior, connection reuse, or memory growth over hours.
Permission denials are production telemetry
A permission denial is often the first sign that a dependency changed behavior. Treat it as a security-relevant event. If a package suddenly attempts network access to a new host, do not reflexively widen permissions. Investigate whether the update is expected, whether the host belongs in the architecture, and whether the permission boundary exposed a supply-chain change.
Field notes
- Runtime startup success is not readiness; dependency initialization belongs in the readiness contract.
- Record Deno runtime version, artifact digest, lockfile digest, and deploy time together.
- Watch tail latency and memory over time, not only median response time in a five-minute canary.
- Keep rollback artifacts immutable. Rebuilding old source under a new dependency graph is not rollback.
- Alert on new permission denials; they are behavioral diffs, not merely noisy crashes.
Was this lesson helpful?